Commit Graph

87 Commits

Author SHA1 Message Date
fvdl 016a1095a9 A device should always respond to inquiry or test unit ready; disable
retries for these during discovery. From Pascal Renauld at Network
Storage Solutions, Inc
2003-04-19 19:12:59 +00:00
nathanw c4921eb479 Remove extra right paren. 2003-04-16 21:08:06 +00:00
thorpej ce68b169df * Change the APIs that handle the sync period to work with 100ths of ns,
rather than 10ths of ns.  This is necessary in order to represent
  Ultra320 SCSI.
* Add Ultra320 SCSI to the scsipi_syncparams[] table.

We're not going to bother bumping any version numbers with this change; only
the "hba" driver uses scsipi_sync_period_to_factor(), and the uses of
scsipi_sync_factor_to_period() are all internal to the scsipi code.  Most
things just pass the factor around, which is unchanged by this.

Reviewed by Frank van der Linden.
2003-04-16 20:25:59 +00:00
fvdl 8103646465 Check RAW_PART against the media size instead of the disklabel.
Add the media size in 512-byte sectors to the softc, to avoid
some 64 bit computations. Bump the capacity stored in softcs
for disks to 64 bits.
2003-04-03 22:18:23 +00:00
thorpej 882dec6ba3 Test callout_pending(), not callout_active(), and eliminate now-unnecessary
callout_deactivate() calls.
2003-02-03 23:50:59 +00:00
simonb 4a67cf4f79 Only declare and set the "info" variable #ifndef SCSIVERBOSE. 2003-01-20 04:08:44 +00:00
scw 7a4dfd98e4 Quell an uninitialised variable warning. 2002-11-24 11:52:13 +00:00
thorpej 73f78d5e61 Fix signed/unsigned comparison warnings. 2002-11-09 18:52:20 +00:00
soren 25674469e6 Leave error printing to the callers of scsipi_size(). 2002-10-04 03:41:50 +00:00
jmc c7258354f0 Force the initial probes to happen within the newly forked off kthread.
This eliminates problems where the underlying interrupt handler isn't the
specific layer calling scsipi_complete() for a given scsi transaction.
This avoids deadlocks where the kthread that called the autoconf routines
to configure a scsibus shouldn't be the one put to sleep waiting on a
scsipi_complete (only the scsibus's kthread should be doing that).

To avoid jitter this will force the scsibus's to probe in the order they
run through autoconf (so machines with multiple bus's don't move sd* devices
around on every reboot).
2002-09-19 08:31:05 +00:00
wiz 645df36eff Spell '[Rr]ight' correctly. From Jim Bernard. 2002-07-26 14:11:34 +00:00
mjacob 787aeb4081 As per a discussion on tech-kern a while back- honor retries for
XS_SELTIMEOUT and XS_TIMEOUT errors- but only do so if the device exists
already.

Devices that are being probed won't be found via periph_lookup, so we can
use that to find if a device exists for the purposes of honoring retries.
2002-06-05 00:15:33 +00:00
bouyer 622fdb1fe6 Doh, the return of scsipi_lookup_periph() was meant to be assigned to
periph.
periph was used uninitialised, and caused a panic when the scsibus is reset
with siop or esiop, and possibly others HBA drivers.
2002-06-03 16:17:57 +00:00
mjacob 16fa96cfc8 Give XS_DRIVER_STUFFUP a case all by itself. 2002-05-17 18:56:05 +00:00
thorpej f4cc1100b0 Don't use a 2-dimensional array for the channel's periph table. Instead,
hash the target and lun together and use a hash table.  This will be
necessary in order to support very large (64-bit) LUN number spaces.
2002-05-16 02:54:20 +00:00
bouyer 36ce07cc3b scsipi_print_xfer_mode(): PERIPH_CAP_DT is an equivalent of
(PERIPH_CAP_SYNC | PERIPH_CAP_WIDE16) here.
2002-05-15 11:19:38 +00:00
bouyer df3d2c7ac3 If periph->periph_callout is already active, don't freeze the periph again:
scispi_periph_timed_thaw() will be called only one time anyway.
2002-05-05 15:16:30 +00:00
bouyer 4940346b10 Add a chan_name to struct scsipi_channel, holding the channel's name.
Set this to dv_xname for scsibus and atapibus.
Set the name of the kernel thread to chan_name instead of controller's
name:channel number (so that we can use this name for controller-specific
threads).
2002-04-01 20:37:41 +00:00
christos 03b1503c21 PR/16110: Chris Jepeway: scsipi_complete() calls (*psw_done)() b/4
setting buffer fields
2002-03-28 22:01:22 +00:00
bouyer 0b16dfbbae Present the same interface to periph driver for ASYNC scsipi_command() in the
normal case, and in the polling or "no thread yet" cases:
don't return an error from scsipi_complete(), as the error should already have
been handled in scsipi_complete() and eventually periph driver callbacks.
Should fix kern/15190.
2002-03-16 17:21:19 +00:00
thorpej a180cee23b Pool deals fairly well with physical memory shortage, but it doesn't
deal with shortages of the VM maps where the backing pages are mapped
(usually kmem_map).  Try to deal with this:

* Group all information about the backend allocator for a pool in a
  separate structure.  The pool references this structure, rather than
  the individual fields.
* Change the pool_init() API accordingly, and adjust all callers.
* Link all pools using the same backend allocator on a list.
* The backend allocator is responsible for waiting for physical memory
  to become available, but will still fail if it cannot callocate KVA
  space for the pages.  If this happens, carefully drain all pools using
  the same backend allocator, so that some KVA space can be freed.
* Change pool_reclaim() to indicate if it actually succeeded in freeing
  some pages, and use that information to make draining easier and more
  efficient.
* Get rid of PR_URGENT.  There was only one use of it, and it could be
  dealt with by the caller.

From art@openbsd.org.
2002-03-08 20:48:27 +00:00
enami 147331af13 Fix broken indentation. 2002-02-21 05:30:30 +00:00
tsutsui 1267bddc09 Call malloc(9) with M_ZERO flag instead of memset() after malloc(). 2002-01-12 16:29:30 +00:00
fredette 4fd267f75d Added the new defopt SCSI_OLD_NOINQUIRY; this is used instead
of sun2 to wrap code that conjures up INQUIRY responses for
certain specific old devices.
2001-11-28 01:04:49 +00:00
fredette 83c021b2a7 Added quirk entries for Adaptec and Emulex SCSI interposer boards.
Decode a limited set of SASI/SCSI-1 sense codes, and under sun2
only, conjure up INQUIRY responses for these boards.
2001-11-26 20:39:29 +00:00
lukem 2565646230 don't need <sys/types.h> when including <sys/param.h> 2001-11-15 09:47:59 +00:00
lukem 7ba10b3532 add RCSIDs 2001-11-13 06:54:32 +00:00
bouyer 69fff4726e Refuse to register a callback if the completion thread isn't started yet. 2001-10-14 21:17:41 +00:00
bouyer a84535fd3e Call ADAPTER_REQ_GROW_RESOURCES from the completion thread, if possible.
This allows HBA drivers to call bus_dmamem_map() safely.
2001-10-14 20:31:24 +00:00
bouyer ce6aaa187a Split channel flags in chan_flags used for communications between
scsipi and HBA, and chan_tflags used for communications between scsipi
and its kernel thread. No functionnal change.
2001-10-14 19:03:43 +00:00
mjacob 87a8b82ae9 Restore previous functionality- in scsipi_periph_timed_thaw check to
make sure the completion thread is running before you try to schedule
it.

Fixes port-i386/14013
2001-09-27 18:11:06 +00:00
fvdl 000902fbf6 Unfortunately, the previous change seems to make most (all?) configurations
using the ahc driver hang when probing scsi devices. The problem may be in
the ahc driver and not in this change, but back it out until this has been
fixed anyway.
2001-09-21 13:54:47 +00:00
mjacob 849eac52f2 Rather than run a periph's queue from scsipi_periph_timed_thaw which is
called via a callout, kick the completion thread to run it for us (uses
a new flag, SCSIPI_CHAN_KICK).

If we've received BUSY status and we haven't started the completion
thread yet, don't freeze do a callout to scsipi_periph_timed_thaw which
then will try and kick the completion thread- instead treat the command
as if it were a polled command and just call delay for 1 second.

If DIAGNOSTIC is defined, and the periph qfreeze count is less than
zero, panic because some HBA has corrupted the periph structure's
accounting.
2001-09-18 20:20:26 +00:00
mjacob 18e1071fce Add table value for Ultra3, so configuring an Ultra3 disk shows:
sd1: sync (12.5ns offset 14), 16-bit (160.000MB/s) transfers, tagged queueing enabled

instead of:

sd1: sync (36.0ns offset 14), 16-bit (55.554MB/s) transfers, tagged queueing enabled
2001-09-01 00:54:38 +00:00
ad ab54b70cae Cosmetic change. 2001-08-20 11:20:51 +00:00
ad 52449ef3bf Medium Not Present has number of defined ASCQs. Pointed out by Sergey
Svishchev <svs@ropnet.ru> in PR 8326.
2001-08-20 07:47:01 +00:00
yamt 75ed9ccf7f fix scsipi_target_detach with wildcard target. 2001-08-19 14:05:13 +00:00
bouyer f2cacede49 Adn scsipi_target_detach() and scsipi_thread_call_callback() as discussed
on tech-kern. scsipi_target_detach() accept wildcard target/lun as requested.
2001-07-18 20:19:24 +00:00
thorpej 03746a443a bzero -> memset 2001-07-18 18:21:04 +00:00
bouyer c399f05222 scsipi_set_xfer_mode(): issue a ADAPTER_REQ_SET_XFER_MODE request to adapter
only if we succesfully attached at last one device for this I_T.
2001-07-13 20:00:23 +00:00
ross f54fe9f3b1 compile tweak for non-SCSIVERBOSE 2001-06-27 23:14:26 +00:00
bouyer 4fadc33006 Better diagnostic when a REQUEST SENSE is terminated with CHECK CONDITION. 2001-06-27 13:21:30 +00:00
bouyer 90d0e67408 Add a XS_CTL_SILENT_NODEV flag: if the sense info is "not ready, medium
not present" don't print any message but still return ENODEV.
Use this in cd driver to allow open of character raw partition even if
the drive is empty (older drives fails at LOAD_UNLOAD time, newer
ones fail at TEST_UNIT_READY time).
2001-06-26 15:32:02 +00:00
bjh21 4bc5a3b295 Add explicit support for IDE and SCSI adaptors which don't support interrupts.
On such adaptors, all transfers are done in polling mode.

OK'ed by Manuel on tech-kern.
2001-06-13 18:17:38 +00:00
bouyer 72b4ba8aed In scsipi_channel_thaw(), if the count drops to 0, call scsipi_run_queue(). 2001-05-23 15:50:32 +00:00
enami e4334b830d Don't capitalize the word sync or async. It's inconsistient with other
messages.
2001-05-18 16:25:07 +00:00
bouyer 8b5bf22895 Workaround for broken drives (explained to me by Chris G. Demetriou):
some devices can't handle tag number larger than some values and always
reject commands with QUEUE FULL if the tag number is larger than this.
Under some circonstances the scsipi system may not decrease periph_openings
(as a workaround of other odd behavior) and we may end up requeuing the command
with a hight tag value again, and the driver could loop on this.
Workaround: in case of queue full, decrease periph_openings to
min(periph_active - 1, periph_openings - 1) so that, after some iteration,
periph_openings is less than the max tag value acceptable by the device.

Solves the problem with tagged queuing on ncr53c9x for me.
2001-05-18 12:56:28 +00:00
bouyer bc980d7eba Use SCSI/ATAPI common definition for MODE_{SELECT,SENSE}{,_BIG}. Define
functions to send theses commands in scsipi_base.c and use them instead
of ad-hoc commands setups.
2001-05-14 20:35:27 +00:00
bouyer 74b15b27a2 Don't forget to call psw_done() ! 2001-04-27 21:36:58 +00:00
bouyer 937a7a3ed9 Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
  ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
  to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
  peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
  recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
  scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
  (no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
  set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
  the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
  will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
2001-04-25 17:53:04 +00:00