summaryrefslogtreecommitdiff
path: root/sys/scsi
AgeCommit message (Collapse)Author
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@
2010-09-01Restore compilability after bufq changesMiod Vallat
2010-09-01ata information vpd page idDavid Gwynne
2010-09-01make struct bufq a member of the softc for devices that use it,David Gwynne
rather than it being a pointer to something that needs to be allocated at attach. since all these devices need a bufq to operate, it makes sense to have it allocated as part of the softc and get bufq_init to just initialise all its fields. it also gets rid of the possibility that you wont be able to allocate the bufq struct during attach, which is something you dont want to happen. secondly, it consistently implements a split between wrapper functions and the per discipline implementation of the bufq handlers. it consistently does the locking in the wrappers rather than doing half in the wrappers and the other half in the implementations. it also consistently handles the outstanding bufq bq pointer in the wrappers. this hides most of the implementation inside kern_bufq.c. the only stuff left in buf.h is for the bits each implementation needs to put inside struct buf. tested by thib@ krw@ and me ok thib@ matthew@ no objection from krw@
2010-08-31Add DVACT_QUIECE support. This is called before splhigh() and beforeTheo de Raadt
DVACT_SUSPEND, therefore DVACT_QUIECE can do standard sleeping operations to get ready. Discussed quite a while back with kettenis and jakemsr, oga suddenly needed it as well and wrote half of it, so it was time to finish it. proofread by miod.
2010-08-31Change the powerhook into an activation routine. It has to use a workq.Theo de Raadt
There is a bit of concern that this workq can race against a detach happening... any solutions from the peanut gallery?
2010-08-31in the activate function, order the DVACT_ functions in the order theyTheo de Raadt
can expect to be used
2010-08-30Avoid possible aliasing-related compiler issues by always writing toMatthew Dempsky
cmd->opcode through the type casted command pointer rather than through xs->cmd->opcode. Requested by deraadt@; ok krw@.
2010-08-28Garbage collect struct dkdriver.Matthew Dempsky
ok miod@; "please go ahead" jsing@
2010-08-25add scsi_iopool_destroy and scsi_link_shutdown. when a link orDavid Gwynne
device are going away, this will walk the pool and link queues and wake up processes that are sleeping while waiting for an io or xs. they will return NULL to the scsi_{xs,io}_get callers, which should then check if they device is still alive. all other handlers that are registered on the queues should be removed by their owners before the destroy/shutdown funcs are called. lots of help and discussion with matthew@ ok matthew@
2010-08-07No "\n" needed at the end of panic() strings.Kenneth R Westerback
Bogus chunks pointed out by matthew@ and miod@. No cookies for marco@ and jasper@. ok deraadt@ miod@ matthew@ jasper@ macro@
2010-08-03Don't attempt to set the read or write caches on usb disks. ItKenneth R Westerback
breaks at least one previously working device, as discovered by naddy@. dlg@ confirmed other kernels also avoid attempting this operation on usb disks. ok dlg@ deraadt@
2010-08-02Don't refer to xs->cmd, even via a pointer to xs->cmd, after xs hasKenneth R Westerback
been put back in the pool. Fixes Daniel Dickman's ses device. ok matthew@ deraadt@
2010-07-28DVD_INVALIDATE_AGID is a 'no payload' operation, so don't setKenneth R Westerback
xs->datalen and reset xs->data to NULL. This prevents a spurious attempt to setup (dma map, etc) and possibly attempt data tranfser. In line with what Linux and FreeBSD do as far as I can tell. Reduces the delay before my DVD starts playing its movie. Idea to also set xs->data to NULL from matthew@. "No objection" matthew@
2010-07-28No need to bzero() malloc'd memory if we used M_ZERO.Kenneth R Westerback
ok matthew@
2010-07-27Add scsi_cmd_rw_decode() for decoding any SCSI READ or WRITE command,Matthew Dempsky
and update atascsi(4) to make use of it. (Other HBAs will be updated post-release.) Should allow for use of SATA drives with >2^32 LBAs. ok deraadt@, dlg@, krw@
2010-07-27the queue entry and state variables in the xsh and ioh structs are partDavid Gwynne
of a separate struct which the ioh struct includes for no good reason anymore. just put the vars directly in the ioh. this removes this useless abstraction. ok krw@ matthew@
2010-07-25Missing SCSI_DATA_IN flag in dvd_read_copyright() causedKenneth R Westerback
confusion. Fixes at least my usb DVD reader and The Blue Tick.
2010-07-25Restore previous behaviour of always bzero()'ing the buf passed toKenneth R Westerback
scsi_inquire_vpd(). scsi_inquire_vpd() oddness noted by jsg@ after report of macppc problems by kili@.
2010-07-25Let DVD's play again. Logic reversal prevented copyright reading.Kenneth R Westerback
Symptoms noted by oga@. actual bug spotted by dlg@
2010-07-24Get rid of scsi_deinit(), and change scsi_init() back to a one-timeMatthew Dempsky
initialization strategy, rather than pretending to do user reference counting. Previously, we would re-initialize the SCSI pool(9)s, which had the fun consequence of causing sysctl(kern.pool.npools) to infinite loop at IPL_VM. ok krw@
2010-07-22Fix a few more scsi_scsi_cmd() removal regressions, caught byMatthew Dempsky
-Wuninitialized. Silly typo in my first diff noticed by oga@ and krw@; ok krw@
2010-07-22Mark two more DMA accessible malloc(9)s.Matthew Dempsky
2010-07-22In st_space() and st_write_filemarks(), if scsi_xs_get() returns NULL,Matthew Dempsky
set st->media_fileno and st->media_blkno before returning. Not sure if this is needed or even really correct, but it's an unintentional behavior change due to removing scsi_scsi_cmd(). ok dlg@
2010-07-22In scsi_inquire_vpd(), actually just return EJUSTRETURN when dealingMatthew Dempsky
with UMASS devices. Fixes scsi_scsi_cmd() removal regression. ok dlg@
2010-07-22style(9) fix and release rwlock(9) if scsi_xs_get() returns NULL,Matthew Dempsky
which should never happen anyway. Fixes scsi_scsi_cmd() removal regression. ok dlg@