Age | Commit message (Collapse) | Author |
|
|
|
to cd.c and call it cd_size(), like sd_size() lives in sd.c.
Tweak some daddr_t variables to u_int64_t on the way, when they are
for disk sector numbers, not 512-byte block numbers.
|
|
the wrappers around handling of pending work, theyre not semaphores.
names from tedu@
ok krw@ guenther@
|
|
other things scsi_sem_enter. the things protected by this do as
much work as they can, so they only need to be told to try again
once.
this isnt a semaphore anymore (and probably never was) so there's
a name change coming too.
|
|
on or off the queues so things calling them can tell if something
is or isnt going to happen.
|
|
other than scsi_base.c can use them.
|
|
test period; i think 3 years ago the last bugs fell out.
ok otto beck others
|
|
devices which advertize themselves as non-SCSI2-aware, since this command
appeared in the SCSI-2 specification.
This makes the Insite Floptical work when connected to a controller which
correctly handles spontaneous deselection (which happens when a non-zero
lun on said floptical device is addressed), such an esp(4) but not wdsc(4).
This is step one of getting Floptical devices working on SGI systems.
feedback and ok krw@
|
|
scsi_init_inquiry(). cut the compiled INQUIRY code over to it.
ok and tweaks from krw@
ok matthew@
|
|
to be in the right address space.
help from matthew and krw
|
|
Prompted by dlg@'s tape library trying to report a failure to thread
a media (0x53, 0x04).
|
|
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
|
|
disks in atascsi.
as reported in pr6470
|
|
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@
|
|
just a target/lun.
|
|
cmd->opcode through the type casted command pointer rather than
through xs->cmd->opcode.
Requested by deraadt@; ok krw@.
|
|
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@
|
|
Bogus chunks pointed out by matthew@ and miod@. No cookies for
marco@ and jasper@.
ok deraadt@ miod@ matthew@ jasper@ macro@
|
|
ok matthew@
|
|
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@
|
|
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@
|
|
scsi_inquire_vpd(). scsi_inquire_vpd() oddness noted by jsg@ after
report of macppc problems by kili@.
|
|
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@
|
|
with UMASS devices. Fixes scsi_scsi_cmd() removal regression.
ok dlg@
|
|
last bastardized sync and buf call through scsi_scsi_cmd(). Flatten
code to call scsi_xs_sync() directly for all commands.
Airplane typos shaken out by various.
ok dlg@ matthew@ deraadt@
|
|
flags which I perpetrated when I paid insufficient attention to
dlg@'s original diff.
Belatedly tested by marco@ and myself. Bad marco@. Bad krw@.
ok marco@
|
|
that get XS_NO_CCB until retry limit exceeded. On to getting rid
of XS_NO_CCB.
ok matthew@ "so be it" dlg@
|
|
the READ CAPACITY(10) values already retrieved. Creates the possibility
to look at other interesting READ CAPACITY(16) data for future
consideration.
ok matthew@ marco@ deraadt@
|
|
matthew@ who won't be home until late.
ok matthew@ & tedu@.
|
|
stack and malloc/free them instead. First stirrings of the tide of
de-stacking to come.
Feedback, fixes and ok matthew@ & tedu@.
|
|
to interpret sense errors. This is initialized to the basic
interpretation routine, and specific scsi drivers (sd/st/cd) can
replace this with their own. While here kill EJUSTRETURN dance and
make more specialized interpretation routines directly call the
basic routine if desired.
Fixes by matthew@ to my first diff. Most original work by dlg@.
ok matthew@ marco@ dlg@
|
|
ok miod@, krw@
|
|
|
|
replaced by BUFQ's.
OK krw@, dlg@
|
|
it, we should clear it before we issue it to the adapter too. retried
commands would have ITSDONE still set otherwise.
|
|
Spotted by Matthew Dempsky. Thanks!
|
|
|
|
runqueue. less is more sometimes.
|
|
an xshandler gets put on a series of lists as it allocates different
resources, and uses the same tailq entry on each of these lists as
its only supposed to be on one of them at a time. however, it was
possible for the xshandler to be added to both at the same time,
therefore corrupting the lists and leading to a panic.
this diff moves from using separate flags for each queue an xshandler
could be on to having a single state variable that shows which one
it is on (or not on). this prevents an xshandler on the io runqueue
from being added to the openings runqueue, which in turn prevents
the list corruption.
some operations have been reordered to avoid races and complexity
in this little state machine.
|
|
other stuff ive been doing in here. everything that needs protection
inside the midlayer and the scsi device drivers (sd, cd, etc) uses
mutexes now.
this pushes splbio out of the midlayer. splbio is only taken before
biodone is called now.
ok beck@ marco@ krw@ deraadt@. theyre all terrified, but they all
say if we're going to do then now is the right stage of the dev
cycle.
|
|
instead of optimistically trying to use a resource by executing an
xs and then failing when there's no room for it, this puts things
that want to use the hardware on a runqueue. as resources become
available on the bus then consumers on the runqueue are popped off
and guaranteed access to the resource.
the resources are generally "ccbs" in adapter drivers, so this
abstracts a way for the midlayer to get access to them into something
called iopools.
it also provides a callback api for consumers of resources to use:
the scsi_ioh api for things that want direct access to the ccbs,
and the scsi_xsh api for things that want to issue a scsi_xfer on
the bus. these apis have been modelled on the timeout api.
scsi_xs_get and therefore scsi_scs_cmd have been cut over to using these
apis internally, so if they are allowed to sleep then can wait on the
runqueue for a resource to become available and therefore guarantee that
when executed on an adapter providing an iopool that they will succeed.
ok krw@ beck@ marco@
tested by many including krw@ beck@ mk@ okan@ todd@
|
|
void. Use XS_NO_CCB error in the scsi command (xs) to report the
NO_CCB condition. Eliminates all SUCCESSFULLY_QUEUED and COMPLETE
confusion and untangles the midlayer from the adapter a bit more.
Eyes and some fixes by miod@
There may be some compile issues on little used (i.e. I don't have
any) drivers but the change is mechanical and thus easy to remedy.
ok dlg@
|
|
Should quieten booting again.
And thus ends n2k10.
|
|
one place for easier debugging and maintenance. No intended functional
changes.
ok dlg@
|
|
data when SCSIDEBUG is set, irrespective of SCSI_SILENT. Tweak
output a bit.
Noticed in output generated by todd@.
|
|
scsi_xs_show.
No functional change.
|
|
initialized. Bring back panics on non-NULL done and cookie fields,
but put inside DIAGNOSTIC.
ok dlg@
|
|
until we figure out why.
|
|
is dying. if so, return ENXIO.
this should make detach of devices during scsi attaches less dangerous.
idea (and the first version of this diff) ok deraadt@
ok krw@
|
|
cannot. panic if theyre set before scsi_xs_sync is called.
question raised by and ok krw@
|