summaryrefslogtreecommitdiff
path: root/sys/scsi
AgeCommit message (Collapse)Author
2011-04-27whitespace fixes.David Gwynne
2011-04-27use dma safe memory when talking to devices. this was written before bigmemDavid Gwynne
required this. requested by deraadt@
2011-04-27if a path returns XS_SELTIMEOUT, retry the io down another path like weDavid Gwynne
do for XS_RESET. adapters return SELTIMEOUT when the device is gone.
2011-04-26Add some defines for the logout request and response and fix theClaudio Jeker
response struct (one of the reserved fields is actually the response). OK dlg@
2011-04-22delete a bogus blank lineTheo de Raadt
2011-04-17if mpath is disabled in config or ukc, then prevent path drivers fromDavid Gwynne
attaching since theyre useless without mpath. the path drivers ask mpath if its ok to use the device before doing their own matches (this is so mpath can prevent paths attaching to itself), so im just adding this check there. this uses code from miod to walk cfdata for the mpath entry and then checks its state. this is ok because mpath is only attached in one place, so there arent multiple cfdata entries for it. ok krw@ deraadt@ miod@ matthew@
2011-04-08Since we don't print "drive offline" anymore, there is no need toKenneth R Westerback
print the "sdN:" at the start of the now empty line. Noted by miod@.
2011-04-07Do not use NULL in integer comparisons. No functional change.Miod Vallat
ok matthew@ tedu@, also eyeballed by at least krw@ oga@ kettenis@ jsg@
2011-04-07'disk offline' is not helpful. Silence is golden.Kenneth R Westerback
Prodded repeatedly by deraadt@
2011-04-06add a new "serial" devid type for scsi devices. add code to usb that fakesDavid Gwynne
it up by using the usb devices iSerial thing. ok deraadt@
2011-04-06unconditionally print scsi device ids instead of just when mpath isDavid Gwynne
enabled so people can get used to it. ok deraadt@
2011-04-05do inquiries against dmaable memory while probing devices.David Gwynne
found by marco@ ok and tweaks deraadt@ krw@
2011-04-05move forward with scsi multipathing.David Gwynne
the big change is how paths between mpath capable devices and the kernel are managed. originally the midlayer would steal the links to the devices and hide them behind mpath. all the changes an adapter made to a link (eg activate or detach), the midlayer had to test if it was an mpath link and then call special mpath code to handle it. the original code also assumed that all paths behaved the same, but the reality is that different devices have different command sets and behaviours. figuring out which behaviour to pick and prioritising them is basically the same job autoconf does with match and attach. rather than special casing mpath in the midlayer and reimplimenting autoconf, this turns paths into actual device drivers with match and attach routines. after they figure out if the path is active, they then give it to mpath(4) to use as a backend. i have written drivers for symmetric access devices (sym(4)) where all paths to the same logical unit are as good as each other, lsi/engenio arrays (rdac(4), and emc arrays (emc(4)). the rdac and emc drivers only detect active paths at attach time, the do not cope if the controller changes state unless you unplug the path and plug it in again to retest the active state. they also do not have support for directing array failover. operating and hoplugging has been tested with mpii(4), fc and sas mpi(4), and iscsi via vscsi (claudio did this too). ok krw@ deraadt@
2011-03-31- use nitems(); no binary change.Jasper Lievisse Adriaanse
ok krw@
2011-03-18Fix stdetach() to call vdevgone() with the right device minor numbers.Matthew Dempsky
Some stylistic tweaks after discussions with krw@ and deraadt@. ok krw@; "Lovely" deraadt@
2011-03-18Add ukdetach() so that detaching an unknown SCSI device doesn't resultMatthew Dempsky
in a kernel panic. ok krw@
2011-03-17use dma_alloc/dma_free instead of malloc to allocate buffers which needTheo de Raadt
to be in the right address space. help from matthew and krw
2011-03-02Sync ASC/ASCQ errors with www.t10.org/lists/asc-num.txt of 11/15/10.Kenneth R Westerback
Prompted by dlg@'s tape library trying to report a failure to thread a media (0x53, 0x04).
2011-02-21If a spin up command can't be started becaause of a lack of openings,Kenneth R Westerback
delay and retry the original command rather than immediately erroring out. Fixes USB drives that spin themselves down due to inactivity, as confirmed by pirofti@ and jsg@. ok miod@, rough agreement pending more general solution dlg@.
2010-12-24Have sd(4) devices check for and respect read-only information theKenneth R Westerback
way st(4) does. Have both decline to open read-only devices for anything but read-only access. Suggestion to fail opens rather than individual i/o's from deraadt@. Problem USB device found and donated by chefren, who also tested diffs. Thanks! ok dlg@ marco@
2010-11-22SCSI devices are assumed to be T_FIXED unless they say otherwise.Kenneth R Westerback
cd(4) did not believe any T_FIXED device was its responsibility. Thus when a USB CD forgot to mention that it is T_REMOV, it appeared as uk(4). Make cd(4) accept even T_FIXED devices that claim to be T_CDROM or T_WORM. Noticed and fix tested by Rene Maroufi. Closes PR #6513.
2010-10-13No need to check ST_DYING flag twice in succession.Kenneth R Westerback
Noticed by Damien McGuckin. Thanks!
2010-10-12Force openings to 1 for devices that can't do tagged i/o, i.e. moreKenneth R Westerback
than 1 i/o active at once. This reduces the chances that concurrent i/o's for such devices will confuse the device or the adapter code. It also eliminates a reason for adapter code to maintain its own queues. Tweak all drivers that fake INQUIRY results to set the SID_CmdQue flag, thus continuing to claim to be able to do tagged i/o. Positive feedback from matthew@ and marco@ for an earlier version. ok dlg@
2010-09-27A few M_ZEROs without any M_WAITOK/M_NOWAITs.Thordur I. Bjornsson
2010-09-24init err to 0 in sd_get_parms to avoid confusion when checking rigidDavid Gwynne
geometry. it doesnt matter waht the value there is cos rigid will be NULL, but this is clearer.
2010-09-23Introduce a DKF_NOLABELREAD flag, which is used by a device to preventJoel Sing
automatic reading of disklabel on attach. ok deraadt@ miod@ krw@
2010-09-23descripe a few bits of the write same commands.David Gwynne
2010-09-22All users of physio(9) now pass NULL as the buf pointer argument, soMatthew Dempsky
no point in keeping it around. "i like this" thib@ (a while back); ok krw@ and oga@; reminder to update the man page and tweaks jmc@
2010-09-21Add a real DIOCGPDINFO, allowing access to the physical informationKenneth R Westerback
about the device rather than the contents of whichever disklabel was read. Tweak whitespace in sd.c to make the code appearance consistant.
2010-09-21opcodes, cdbs, and payloads for WRITE SAME 10/16 and UNMAP commands.David Gwynne
ok deraadt@ krw@ matthew@
2010-09-20bufq_drain() does not need to be done in deactivate; we only needTheo de Raadt
to deactivate transactions we are currently doing. ok dlg
2010-09-20bring back scsi_base.c r1.195 and scsiconf.h r1.138 now thatDavid Gwynne
src/sys/dev/ata/atascsi.c r1.92 solves the problem that my scsi_link change tickled. tested by josh elsasser who reported the problem in pr6470 deraadt@ is letting it in again so it can get widespread testing
2010-09-17revert scsi_base.c r1.195 and scsiconf.h r1.138 as it screws up with someDavid Gwynne
disks in atascsi. as reported in pr6470
2010-09-14dont leak an xs in ststart if its called while the device is dying.David Gwynne
pointed out by matthew@
2010-09-14scsi_xsh_del the xs handler on DEACTIVATE.David Gwynne
same change as sd.c r1.212. matthew@ pointed out that cd(4) and st(4) would need the same change.
2010-09-14Clean up sense mode handling to make residual value handling clearerKenneth R Westerback
and more plausibly correct. Tested by jsing@ and myself.
2010-09-14the openings member of scsi_link is the maximum number of commands that aDavid Gwynne
scsi device can have in flight. instead of counting users of openings on the bus by taking away from the openings value, count the number of pending commands on the bus in a new pending variable. this lets us know how many outstanding commands there are. we can then use that to make sure that all commands a device has generated get completed before detaching the device. this helps avoid resource leaks and use after frees. tested by me on pci ehci/umass, fc mpi, and sas mpi. tested by jakemsr on cardbus ohci umass. it found issues in sas mpi which were fixed as a result of this diff. ok krw@
2010-09-13i got the order of the bits in the cache page back to front. howDavid Gwynne
embarrsssment. discovered by okan@
2010-09-12Garbage collect rot_rate from disk_parms. No longer in disk label so noKenneth R Westerback
need to calculate and save. Not used anywhere in tree.
2010-09-12Make cd the same as sd by calling the cd_parms member of the softc 'params'Kenneth R Westerback
rather than 'sc_params'. No change to .o file.
2010-09-11Be more ruthlessly consistent in variable names for blk/block ==Kenneth R Westerback
512 == DEV_BSIZE units and variable-sized physical device 'sectors'. I hope this reduces confusion a bit more. No change to .o files. ok for intent miod@, with tweak.
2010-09-10scsi_xsh_del the io handler in deactivate to prevent it from being run onDavid Gwynne
a device thats now gone, or from being on the list of pending io when the device is actually detached. found and fix tested by jakemsr@ "go for it" jakemsr@
2010-09-08Introduce a disk_lookup() function which calls device_lookup(), beforeJoel Sing
verifying that the resulting device is present on the disklist. This avoids a race whereby the disk driver can be accessed as soon as the softc has been allocated, but before the disk has completed initialisation and has called disk_attach() (up until this point dk_label is still a null pointer). Cut cd(4), sd(4) and wd(4) across to disk_lookup(). All callers of disk_attach() need to be tested and cut over in due course. ok deraadt@ krw@
2010-09-08Store a struct device pointer within struct disk and populate this whenJoel Sing
disk_attach() is called by the device driver. We will be building on this shortly. ok deraadt@ krw@
2010-09-08let things request the detach of everything on the whole bus, rather thanDavid Gwynne
just a target/lun.
2010-09-08activate hooks should return a value.David Gwynne
all from deraadt@ tested by me with hotplugged disks on mpi(4)
2010-09-07remove the powerhook code. All architectures now use the ca_activate treeTheo de Raadt
traversal code to suspend/resume ok oga kettenis blambert
2010-09-07rely on SCSI_AUTOCONF for cd_resume instead of wrapping it in a workqTheo de Raadt
(which creates a potential race against cd detach) discussed with krw and dlg seperately
2010-09-02the page_length field in the vpd page header is 2 bytes, not 1.David Gwynne
ok krw@ marco@ matthew@
2010-09-01Don't give xs->resid an invalid value (xs->datalen * st->blksize)Kenneth R Westerback
inside st_interpret_sense() and then exit without making sure it's set back to <= xs->datalen. Fixes 'done < 0; strategy broken' panics when un-tar'ing /cvs from my ahci DAT tape drive. ok dlg@ more-or-less-ok matthew@