summaryrefslogtreecommitdiffstats
path: root/sys/scsi (follow)
Commit message (Collapse)AuthorAgeFilesLines
* "non-existant" is one of those words that don't exist, so use "non-existent"phessler2019-02-101-4/+4
| | | | | | | instead From Pamela Mosiejczuk, many thanks! OK phessler@ deraadt@
* No leading space(s) before labels.krw2019-01-203-14/+14
| | | | Prodded by guenther@
* When retiring a SCSI request, sometimes the buf's b_error value iskrw2019-01-203-14/+21
| | | | | | | | forcibly set to a value. Make sure that in all those cases the B_ERROR flag is cleared (if b_error is being set to 0) or set (if b_error is being set to non-zero) appropriately. ok dlg@ jmatthew@
* Remove the port id check entirely. We don't do anything with the portjmatthew2018-08-091-2/+2
| | | | | | id after that, so it seems like a silly reason to reject a target. ok dlg@ deraadt@
* hds arrays can have more ports now, apparently; this lets theo use 4 pathsjmatthew2018-07-271-2/+2
| | | | | | to his array rather than just 2. ok dlg@
* Delete superfluous includes of <sys/file.>guenther2018-04-271-2/+1
| | | | ok krw@
* Don't pull in <sys/file.h> just to get fcntl.hguenther2017-12-302-4/+4
| | | | ok deraadt@ krw@
* Fix a broken compilation when using SCSIDEBUG options(4).mlarkin2017-11-111-5/+7
| | | | | | Diff from Carlos Cardenas, thanks! ok krw@
* If you use sys/param.h, you don't need sys/types.hderaadt2017-09-087-15/+8
|
* sd: flush cache when closing writable FDsf2017-05-291-4/+5
| | | | | | | | | Don't skip the cache flush until the last opening of the device is closed. Otherwise, when umounting a writable partition while a different partition is still mounted read-only, the necessary disk flush may be delayed for a very long time. ok krw@ deraadt@
* Add an ioctl to tell storage devices to flush their internal cachessf2017-05-291-11/+25
| | | | | | | Currently implemented for wd and sd. Initially ported from netbsd by pedro@ ok deraadt@
* To prevent anyone else from stumbling on this (now) archaic bit ofkrw2017-05-295-36/+5
| | | | | | | | history, nuke all mentions of XS_NO_CCB and the #define. 2006 - 2017. R.I.P. ok kettenis@ inferred ok dlg@
* Add some comments about the assumptions of the scsi mid layersf2017-05-191-2/+8
| | | | ok krw@
* Also pass the blk offset to disk_unbusy(), so that it can pass it toderaadt2017-05-042-6/+6
| | | | | | the random subsystem as entropy. This value is pretty much unknown, and anyways our entropy input ring does not saturate from knowns. ok mikeb djm
* all pools have their ipl set via pool_setipl, so fold it into pool_init.dlg2016-09-151-8/+5
| | | | | | | | | | | | | | | | | | | | | | the ioff argument to pool_init() is unused and has been for many years, so this replaces it with an ipl argument. because the ipl will be set on init we no longer need pool_setipl. most of these changes have been done with coccinelle using the spatch below. cocci sucks at formatting code though, so i fixed that by hand. the manpage and subr_pool.c bits i did myself. ok tedu@ jmatthew@ @ipl@ expression pp; expression ipl; expression s, a, o, f, m, p; @@ -pool_init(pp, s, a, o, f, m, p); -pool_setipl(pp, ipl); +pool_init(pp, s, a, ipl, f, m, p);
* Remove support for tape block devices. Nobody mount(8)s tapes any longer.naddy2016-09-041-13/+2
| | | | ok deraadt@ guenther@
* Do not run into sdgetdisklabel() when scsi disk is dying. Addbluhm2016-03-191-4/+5
| | | | | special error handling in sdopen() as temporary hack. OK krw@
* After sleeping and before accessing sc_link, check that scsi diskbluhm2016-03-181-1/+51
| | | | | is not dying. OK krw@
* Do not access the scsi link structure in sdclose() if the diskbluhm2016-03-171-2/+17
| | | | | | device is already dying. Delete the sc_timeout when setting the SDF_DYING flag as the timeout delete in sdclose() may not be reached. OK krw@
* Add SDF_DYING checks to more functions in scsi disk, to prevent anbluhm2016-03-161-5/+15
| | | | | use after free of the scsi link structure during detach. OK krw@
* Standardize on calling local scsi_link variables 'link' instead ofkrw2016-03-129-365/+365
| | | | | | | | | | | 'sc_link'. 'sc_link' is a field in the various device *_softc structures, where the sc_ prefix was for 'softc'. Reduces potential mental confusion. Newer code from down under was already using 'link'. No functional change. Prompted by bluhm@'s adventures in scsi. ok dlg@ jmatthew@
* When unplugging an USB umass stick, the kernel could panic becausebluhm2016-03-121-2/+34
| | | | | | | | | | of a use after free. In sdopen() the scsi link pointer is taken from the scsi disk struct. While the scsi disk memory is refcounted by autoconf, the scsi link may be detached and freed during sleep. The solution is to check wether the disk is dying after every sleep. The SDF_DYING flag is set before scsi bus and scsi disk are detached, so without this flag the link must be valid. input and OK krw@
* "if (_3btol(cmd->len) != 0)" is more likely to be a useful test thankrw2016-03-111-2/+2
| | | | | | | | | "if (cmd->len) != 0)", as cmd->len is a 3 byte array. Broken since media_blkno accounting was introduced in r1.72 (2007!). Might fix some obscure tape issues around miscounting variable sized blocks. Spotted by mmcc@ and his friend clang.
* Enforce some naming sanity. Stop using 'sc_link' to mean two differentkrw2016-03-103-86/+86
| | | | | | | | things by renaming the field 'SLIST_HEAD(, scsi_link) sc_link' to 'sc_link_list' in struct scsibus_softc. Use 'sb' as the short name for scsibus_softc variables. Impetus from & ok bluhm@
* Sync no-argument function declaration and definition by adding (void).naddy2016-03-071-2/+2
| | | | ok mpi@ millert@
* Do not access the scsi link of the disk at the beginning of sdopen()bluhm2016-02-031-3/+7
| | | | | | and sdminphys() if the scsi disk is dying. The memory of the link may have been freed already. OK krw@
* When accessing the scsi link of a scsi disk, use a variable "sc_link"bluhm2016-02-031-61/+81
| | | | | | | everywhere. This is the first step to fix a use after free of the sc_link when the disk detaches. If a function gets a scsi transfer, the scsi link is always valid. Call this variable "link" consistently. OK krw@
* add some sizes to free. looked over by deraadttedu2015-08-235-24/+28
|
* More damned eye searing whitespace.krw2015-06-0715-67/+67
|
* use correct capitalization of 'BlackBerry'jasper2015-04-021-2/+2
| | | | "sure" deraadt@
* Remove some includes include-what-you-use claims don'tjsg2015-03-149-18/+9
| | | | | | | have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
* Fix some format specifiers in debug code.krw2015-03-082-4/+4
| | | | | | | Pointed out by Kor son of Rynar (sic) when trying to test some debug code. ok matthew@
* prevent umass devices from being considered for paths.dlg2015-03-041-1/+4
| | | | ok deraadt@
* we dont need sys/lock.h because we dont use lockmgr, but we do needdlg2015-02-111-2/+2
| | | | sys/atomic.h for atomic_setbits_int.
* remove the second void * argument on tasks.dlg2015-01-271-7/+7
| | | | | | | | | | | | | | | | | | | | | when workqs were introduced, we provided a second argument so you could pass a thing and some context to work on it in. there were very few things that took advantage of the second argument, so when i introduced pools i suggested removing it. since tasks were meant to replace workqs, it was requested that we keep the second argument to make porting from workqs to tasks easier. now that workqs are gone, i had a look at the use of the second argument again and found only one good use of it (vdsp(4) on sparc64 if you're interested) and a tiny handful of questionable uses. the vast majority of tasks only used a single argument. i have since modified all tasks that used two args to only use one, so now we can remove the second argument. so this is a mechanical change. all tasks only passed NULL as their second argument, so we can just remove it. ok krw@
* primary change: move uvm_vnode out of vnode, keeping only a pointer.tedu2014-12-161-8/+8
| | | | | | objective: vnode.h doesn't include uvm_extern.h anymore. followup changes: include uvm_extern.h or lock.h where necessary. ok and help from deraadt
* convert bcopy to memcpy. ok dlg krwtedu2014-12-154-18/+18
|
* Fix bug in taskq conversion that would lead to a null pointer dereference.kettenis2014-09-201-2/+2
| | | | ok krw@, jsg@
* Some disks, such as the Seagate Cheetah 73LP FC with Sun firmwarekettenis2014-09-181-2/+6
| | | | | | | | | | | (ST373405FSUN72G) respond to a START STOP UNIT command that spins down the disk with a "Logical Unit Not Ready, Initialization Command Required". Besides causing some dmesg spam, our sd(4) driver responds to such a response by spinning the disk back up. Prevent this from happening by respecting the SCSI_IGNORE_NOT_READY flag and using that flag when spinning down the disk. ok miod@
* remove uneeded proc.h includesjsg2014-09-1412-24/+12
| | | | ok mpi@ kspillner@
* Replace all queue *_END macro calls except CIRCLEQ_END with NULL.doug2014-09-131-2/+2
| | | | | | | | CIRCLEQ_* is deprecated and not called in the tree. The other queue types have *_END macros which were added for symmetry with CIRCLEQ_END. They are defined as NULL. There's no reason to keep the other *_END macro calls. ok millert@
* remove the scsi_task() wrapper around workq_add_task now that nothingdlg2014-09-091-5/+1
| | | | uses it. dont need to include workq.h anymore here either now.
* rework the hotplug requests to use tasks rather than workqs.dlg2014-09-091-7/+13
| | | | tested on mpi(4) sas.
* use mallocarray where arguments are multiplied; ok teduderaadt2014-07-132-5/+6
|
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-127-26/+26
| | | | after discussions with beck deraadt kettenis.
* Now that sd(4) drives under softraid0 have their cache flushed whenmpi2014-07-101-34/+3
| | | | | | | DVACT_POWERDOWN is propagated in this subtree, there is no need for this shutdown hook anymore. RIP. ok kettenis@
* take the biglock before calling the xs completion handler.dlg2014-07-011-1/+3
| | | | should be safe to call the midlayer io path without the biglock now.
* take the biglock when calling an adapters scsi_cmd handler.dlg2014-07-011-1/+3
|
* start on being able to safely run io through the midlayer withoutdlg2014-07-011-6/+29
| | | | | | | | | | | | the kernel biglock. the plan is to have the midlayer assume its running without the biglock, but that it cant call adapters or devices without taking the biglock first. this diff just wraps the calls to the adapter iopool get and put handlers up in the biglock. this is safe now because of kettenis' commit to src/sys/kern/init_main.c r1.120. ive been running this in various places since early 2011.
* move pointer use to after a NULL pointer checkjsg2014-05-011-2/+3
| | | | ok dlg@