The NetBSD Project

CVS log for src/sys/dev/scsipi/scsipi_base.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / dev / scsipi

Request diff between arbitrary revisions


Default branch: MAIN
Current tag: MAIN


Revision 1.159 / (download) - annotate - [select for diffs], Fri Apr 20 20:23:21 2012 UTC (13 months, 4 weeks ago) by bouyer
Branch: MAIN
CVS Tags: yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, tls-maxphys-nbase, tls-maxphys-base, tls-maxphys, khorben-n900, jmcneill-usbmp-base9, jmcneill-usbmp-base10, agc-symver-base, agc-symver, HEAD
Changes since 1.158: +6 -129 lines
Diff to previous 1.158 (colored)

Add a bustype_async_event_xfer_mode() callback to scsipi_bustype (which can
be NULL), so that transport-specific details of transfer mode setting/printing
can be handled more easily.
Move scsipi_async_event_xfer_mode() and scsipi_print_xfer_mode() to
scsi_base.c and split in parallel scsi and FC/SAS parts.
size of struct scsipi_bustype has changed, welcome to 6.99.5

Revision 1.158 / (download) - annotate - [select for diffs], Thu Apr 19 17:45:20 2012 UTC (13 months, 4 weeks ago) by bouyer
Branch: MAIN
Changes since 1.157: +53 -32 lines
Diff to previous 1.157 (colored)

Expand struct scsipi_bustype {} in a ABI-backward-compatible way to
pass more informations about the bus:
- bustype_type has 2 different bytes, one holding the existing
  SCSIPI_BUSTYPE_* (scsi, atapi, ata), and one for a per-SCSIPI_BUSTYPE_*
  subtype. Introduce macros to build or extract bustype_type.
- for SCSIPI_BUSTYPE_SCSI, define subtypes for parallel SCSI, Fibre Channel,
  SAS and USB, to specify the transport method. SCSIPI_BUSTYPE_SCSI_PSCSI
  is 0 so that bustype_type value doesn't change for existing code
- for non-SCSIPI_BUSTYPE_SCSI busses there's no defined subtype yet,
  so the bustype_type value doesn't change.
- provide scsi_fc_bustype, scsi_sas_bustype and scsi_usb_bustype
  along with scsi_bustype to be used by bus driver where appropriate
- scsipi_print_xfer_mode(): more existing code under a
  (SCSIPI_BUSTYPE_SCSI, SCSIPI_BUSTYPE_SCSI_PSCSI) case, as
  sync/wide parameters only make sense for parallel SCSI.
  For (SCSIPI_BUSTYPE_SCSI, SCSIPI_BUSTYPE_SCSI_FC) and
  (SCSIPI_BUSTYPE_SCSI, SCSIPI_BUSTYPE_SCSI_SAS), only print
  tagged queing status if enabled. Just be silent for other
  bustypes.

This change is prompted by this problem:
right now, FC (e.g. isp(4)) and SAS (e.g. mfi(4)) don't
  do anything for ADAPTER_REQ_SET_XFER_MODE, and especially never
  call scsipi_async_event(ASYNC_EVENT_XFER_MODE), so sd(4) always
  runs untagged. Doing a scsipi_async_event(ASYNC_EVENT_XFER_MODE) with
  appropriate parameters is enough to enable tagged queuing,
  but then scsipi will print:
  sd0: async, 8-bit transfers, tagged queueing
  which is harmless (async, 8-bit transfers doens't make sense on SAS anyway)
  but will confuse users. With this change scsipi will only print:
  sd0: tagged queueing
  which is correct.

In the long run, knowning the underlying transport in scsipi will
allow better handling of device which are not parallel SCSI.

Another change adding an extra callback to struct scsipi_bustype {}
will come (so that scsipi_print_xfer_mode(), which is SCSI-specific,
can be moved out of scsipi_base, and split into per-subtype callback),
but this will break kernel ABI and so is not suitable for
netbsd-6, so will be commmited later. The above is enough to get
tagged queuing on FC and SAS in netbsd-6.

Revision 1.157 / (download) - annotate - [select for diffs], Wed Apr 18 20:37:49 2012 UTC (14 months ago) by bouyer
Branch: MAIN
Changes since 1.156: +4 -4 lines
Diff to previous 1.156 (colored)

Fix KASSERT(): autoconf doesn't run under the KERNEL_LOCK

Revision 1.156 / (download) - annotate - [select for diffs], Mon Feb 20 20:09:08 2012 UTC (15 months, 4 weeks ago) by mrg
Branch: MAIN
CVS Tags: yamt-pagecache-base4, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3
Changes since 1.155: +7 -2 lines
Diff to previous 1.155 (colored)

assert kernel lock is held in a few places in inside scsipi.
lock the kernel when calling into scsipi from umass and usscanner.

with these two in place on usbmp branch, umass appears stable.

Revision 1.155 / (download) - annotate - [select for diffs], Sat Nov 13 13:52:11 2010 UTC (2 years, 7 months ago) by uebayasi
Branch: MAIN
CVS Tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, rmind-uvmplock-nbase, rmind-uvmplock-base, netbsd-6-base, matt-mips64-premerge-20101231, jruoho-x86intr-base, jruoho-x86intr, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base2, jmcneill-usbmp-base, jmcneill-audiomp3-base, jmcneill-audiomp3, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Branch point for: yamt-pagecache, netbsd-6, jmcneill-usbmp
Changes since 1.154: +2 -4 lines
Diff to previous 1.154 (colored)

Don't pull in the whole uvm(9) API to access only PAGE_SIZE and
some other constants.  These are provided by sys/param.h now.

Revision 1.154 / (download) - annotate - [select for diffs], Mon Aug 23 20:01:16 2010 UTC (2 years, 9 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-nfs-mp-base11, uebayasi-xip-base4, uebayasi-xip-base3
Changes since 1.153: +4 -3 lines
Diff to previous 1.153 (colored)

Convert one second(!!) delay to kpause.  It was originally done
from a callout, so delay was the only option (in those days).  Then
the caller was converted to a thread, but left as a delay.  It
still may block the scsipi completion thread processing (so I
seriously doubt this code path is executed very often on a live
system).

Revision 1.153 / (download) - annotate - [select for diffs], Mon Jun 7 01:41:39 2010 UTC (3 years ago) by pgoyette
Branch: MAIN
CVS Tags: yamt-nfs-mp-base10, uebayasi-xip-base2
Changes since 1.152: +2 -24 lines
Diff to previous 1.152 (colored)

Update scsiverbose module to use module_autoload() rather than module_load().
Load the module right before each attempt to use its features, and let the
module subsystem handle unloading.

Revision 1.152 / (download) - annotate - [select for diffs], Sun May 30 04:38:04 2010 UTC (3 years ago) by pgoyette
Branch: MAIN
Changes since 1.151: +61 -45 lines
Diff to previous 1.151 (colored)

Extract SCSIVERBOSE into a kernel module.  The module can be builtin
by defining 'options SCSIVERBOSE' in the kernel config file (no change
from current behavior), or it can be loaded at boot time on those
architectures that support the boot loader's "load" command.

The module is built for all architectures, whether or not SCSI or
atapi support exists.

Revision 1.151 / (download) - annotate - [select for diffs], Fri Feb 12 11:39:33 2010 UTC (3 years, 4 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-nfs-mp-base9, uebayasi-xip-base1
Branch point for: rmind-uvmplock
Changes since 1.150: +4 -2 lines
Diff to previous 1.150 (colored)

delay() is used here, so need to include machine/param.h.

Revision 1.150 / (download) - annotate - [select for diffs], Wed Oct 21 21:12:05 2009 UTC (3 years, 7 months ago) by rmind
Branch: MAIN
CVS Tags: uebayasi-xip-base, matt-premerge-20091211, jym-xensuspend-nbase
Branch point for: uebayasi-xip
Changes since 1.149: +2 -18 lines
Diff to previous 1.149 (colored)

Remove uarea swap-out functionality:

- Addresses the issue described in PR/38828.
- Some simplification in threading and sleepq subsystems.
- Eliminates pmap_collect() and, as a side note, allows pmap optimisations.
- Eliminates XS_CTL_DATA_ONSTACK in scsipi code.
- Avoids few scans on LWP list and thus potentially long holds of proc_lock.
- Cuts ~1.5k lines of code.  Reduces amd64 kernel size by ~4k.
- Removes __SWAP_BROKEN cases.

Tested on x86, mips, acorn32 (thanks <mpumford>) and partly tested on
acorn26 (thanks to <bjh21>).

Discussed on <tech-kern>, reviewed by <ad>.

Revision 1.149 / (download) - annotate - [select for diffs], Tue Apr 7 18:10:45 2009 UTC (4 years, 2 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-nfs-mp-base8, yamt-nfs-mp-base7, yamt-nfs-mp-base6, yamt-nfs-mp-base5, yamt-nfs-mp-base4, yamt-nfs-mp-base3, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base, jymxensuspend-base, jym-xensuspend-base
Changes since 1.148: +3 -2 lines
Diff to previous 1.148 (colored)

Destroy a scsipi_xfer's callout before putting it back into the pool.

Revision 1.148 / (download) - annotate - [select for diffs], Sun May 11 05:17:23 2008 UTC (5 years, 1 month ago) by mlelstv
Branch: MAIN
CVS Tags: yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, yamt-nfs-mp-base2, wrstuden-revivesa-base-4, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, simonb-wapbl-nbase, simonb-wapbl-base, simonb-wapbl, nick-hppapmap-base2, netbsd-5-base, netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, netbsd-5, mjf-devfs2-base, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-base2, hpcarm-cleanup-nbase, haad-nbase2, haad-dm-base2, haad-dm-base1, haad-dm-base, haad-dm, ad-audiomp2-base, ad-audiomp2
Branch point for: nick-hppapmap, jym-xensuspend
Changes since 1.147: +5 -2 lines
Diff to previous 1.147 (colored)

Reintroduce the NODOORLOCK quirk. Helps with PR kern/23875.

Revision 1.147 / (download) - annotate - [select for diffs], Mon Apr 28 20:23:57 2008 UTC (5 years, 1 month ago) by martin
Branch: MAIN
Branch point for: wrstuden-revivesa
Changes since 1.146: +2 -9 lines
Diff to previous 1.146 (colored)

Remove clause 3 and 4 from TNF licenses

Revision 1.146 / (download) - annotate - [select for diffs], Sat Apr 5 15:47:01 2008 UTC (5 years, 2 months ago) by cegger
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base, yamt-nfs-mp-base
Branch point for: yamt-pf42, yamt-nfs-mp
Changes since 1.145: +5 -6 lines
Diff to previous 1.145 (colored)

use aprint_*_dev and device_xname

Revision 1.145 / (download) - annotate - [select for diffs], Mon Jul 9 21:01:21 2007 UTC (5 years, 11 months ago) by ad
Branch: MAIN
CVS Tags: yamt-x86pmap-base4, yamt-x86pmap-base3, yamt-x86pmap-base2, yamt-x86pmap-base, yamt-x86pmap, yamt-lazymbuf-base15, yamt-lazymbuf-base14, yamt-kmem-base3, yamt-kmem-base2, yamt-kmem-base, yamt-kmem, vmlocking2-base3, vmlocking2-base2, vmlocking2-base1, vmlocking2, vmlocking-nbase, vmlocking-base, reinoud-bufcleanup-nbase, reinoud-bufcleanup-base, nick-net80211-sync-base, nick-net80211-sync, nick-csl-alignment-base5, nick-csl-alignment-base, nick-csl-alignment, mjf-ufs-trans-base, mjf-devfs-base, mjf-devfs, matt-mips64-base, matt-mips64, matt-armv6-prevmlocking, matt-armv6-nbase, matt-armv6-base, matt-armv6, keiichi-mipv6-nbase, keiichi-mipv6-base, keiichi-mipv6, jmcneill-pm-base, jmcneill-pm, jmcneill-base, hpcarm-cleanup-base, hpcarm-cleanup, cube-autoconf-base, cube-autoconf, bouyer-xeni386-nbase, bouyer-xeni386-merge1, bouyer-xeni386-base, bouyer-xeni386, bouyer-xenamd64-base2, bouyer-xenamd64-base, bouyer-xenamd64, ad-socklock-base1
Branch point for: mjf-devfs2
Changes since 1.144: +14 -27 lines
Diff to previous 1.144 (colored)

Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements

Revision 1.144 / (download) - annotate - [select for diffs], Mon Mar 12 18:18:31 2007 UTC (6 years, 3 months ago) by ad
Branch: MAIN
CVS Tags: yamt-idlelwp-base8, thorpej-atomic-base, thorpej-atomic, reinoud-bufcleanup
Branch point for: mjf-ufs-trans
Changes since 1.143: +3 -3 lines
Diff to previous 1.143 (colored)

Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.

Revision 1.143 / (download) - annotate - [select for diffs], Fri Feb 9 21:55:29 2007 UTC (6 years, 4 months ago) by ad
Branch: MAIN
CVS Tags: post-newlock2-merge, ad-audiomp-base, ad-audiomp
Branch point for: yamt-idlelwp, vmlocking
Changes since 1.142: +4 -5 lines
Diff to previous 1.142 (colored)

Merge newlock2 to head.

Revision 1.142 / (download) - annotate - [select for diffs], Sun Nov 26 05:01:09 2006 UTC (6 years, 6 months ago) by itohy
Branch: MAIN
CVS Tags: yamt-splraiseipl-base5, yamt-splraiseipl-base4, yamt-splraiseipl-base3, wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, newlock2-nbase, newlock2-base, netbsd-4-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, netbsd-4, matt-nb4-arm-base, matt-nb4-arm
Changes since 1.141: +2 -96 lines
Diff to previous 1.141 (colored)

If the block size reported by Read Capacity looks valid, just use it.
Use Request Sense only if Read Capacity succeeded and did not return
valid block size.
Discussed on tech-kern.
Fix the easier part of NetBSD PR kern/26537.
(The harder part is the device hangs on large (>= 8KB) transfer.
Possibly umass BBB problem?)

Remove scsipi_size() and scsipi_validate_secsize() from scsipi_base.c
and add their functions to sd.c since they are used only by sd.c.

Use SCSI term `block' instead of `sector' where applicable.

Revision 1.141 / (download) - annotate - [select for diffs], Thu Nov 16 01:33:26 2006 UTC (6 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.140: +3 -3 lines
Diff to previous 1.140 (colored)

__unused removal on arguments; approved by core.

Revision 1.140 / (download) - annotate - [select for diffs], Fri Oct 20 07:11:50 2006 UTC (6 years, 8 months ago) by scw
Branch: MAIN
CVS Tags: yamt-splraiseipl-base2
Changes since 1.139: +45 -7 lines
Diff to previous 1.139 (colored)

Validate the sector size returned by READ CAPACITY. If it looks bogus
print a warning and fallback to a suitable default.

Fixes a problem on hp700 reported by skrll@

Revision 1.139 / (download) - annotate - [select for diffs], Thu Oct 12 01:31:57 2006 UTC (6 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.138: +4 -3 lines
Diff to previous 1.138 (colored)

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386

Revision 1.138 / (download) - annotate - [select for diffs], Mon Oct 9 21:29:14 2006 UTC (6 years, 8 months ago) by scw
Branch: MAIN
Changes since 1.137: +9 -4 lines
Diff to previous 1.137 (colored)

Some removable umass(4) devices don't respond to mode sense page 6, or
simply return zero for logical block size. In either case, use the sector
length reported by READ_CAPACITY instead of defaulting to 512 bytes.

This partially addresses the problems reported in PR port-i386/34707 and
PR kern/34737. Namely the incorrectly reported drive geometry and the
'hanging' issue.

However, since the device in question reports 2048-byte physical sectors
it will remain unusable until DEV_BSIZE is banished.

Revision 1.137 / (download) - annotate - [select for diffs], Mon Sep 11 19:43:55 2006 UTC (6 years, 9 months ago) by reinoud
Branch: MAIN
CVS Tags: yamt-splraiseipl-base, yamt-pdpolicy-base9
Branch point for: yamt-splraiseipl
Changes since 1.136: +2 -2 lines
Diff to previous 1.136 (colored)

Aparently i've misread, backing out change.

Revision 1.136 / (download) - annotate - [select for diffs], Mon Sep 11 17:57:07 2006 UTC (6 years, 9 months ago) by reinoud
Branch: MAIN
Changes since 1.135: +4 -4 lines
Diff to previous 1.135 (colored)

Don't add one to the capacity returned of READ CAPACITY! it results in
reporting a sd* disc that is one sector too big (!) Normally not much a
problem in FFS since its clustered but other filingsystems *do* care.

Revision 1.135 / (download) - annotate - [select for diffs], Mon Apr 17 14:30:40 2006 UTC (7 years, 2 months ago) by nathanw
Branch: MAIN
CVS Tags: yamt-pdpolicy-base8, yamt-pdpolicy-base7, yamt-pdpolicy-base6, yamt-pdpolicy-base5, simonb-timecounters-base, rpaulo-netinet-merge-pcb-base, gdamore-uart-base, gdamore-uart, elad-kernelauth-base, chap-midi-nbase, chap-midi-base, chap-midi, abandoned-netbsd-4-base, abandoned-netbsd-4
Branch point for: newlock2
Changes since 1.134: +16 -2 lines
Diff to previous 1.134 (colored)

In scsipi_done(), bail out early if the scsipi_xfer has already been
marked as done. Works around one problem with detaching in-use sd
devices, as described on tech-kern:

http://mail-index.netbsd.org/tech-kern/2005/09/22/0002.html

Revision 1.134 / (download) - annotate - [select for diffs], Mon Feb 20 16:50:37 2006 UTC (7 years, 3 months ago) by thorpej
Branch: MAIN
CVS Tags: yamt-uio_vmspace-base5, yamt-pdpolicy-base4, yamt-pdpolicy-base3, yamt-pdpolicy-base2, yamt-pdpolicy-base, peter-altq-base
Branch point for: yamt-pdpolicy, peter-altq, elad-kernelauth
Changes since 1.133: +3 -3 lines
Diff to previous 1.133 (colored)

Use device_is_active() rather than testing dv_flags for DVF_ACTIVE
directly.

Revision 1.133 / (download) - annotate - [select for diffs], Sat Dec 24 20:27:52 2005 UTC (7 years, 5 months ago) by perry
Branch: MAIN
Branch point for: yamt-uio_vmspace, simonb-timecounters, rpaulo-netinet-merge-pcb
Changes since 1.132: +3 -3 lines
Diff to previous 1.132 (colored)

Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.

Revision 1.132 / (download) - annotate - [select for diffs], Sun Dec 11 12:23:50 2005 UTC (7 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.131: +2 -2 lines
Diff to previous 1.131 (colored)

merge ktrace-lwp.

Revision 1.131 / (download) - annotate - [select for diffs], Tue May 31 02:56:54 2005 UTC (8 years ago) by xtraeme
Branch: MAIN
CVS Tags: yamt-vop-base3, yamt-vop-base2, yamt-vop-base, yamt-vop, yamt-readahead-pervnode, yamt-readahead-perfile, yamt-readahead-base3, yamt-readahead-base2, yamt-readahead-base, yamt-readahead, thorpej-vnode-attr-base, thorpej-vnode-attr, ktrace-lwp-base
Branch point for: yamt-lazymbuf
Changes since 1.130: +3 -3 lines
Diff to previous 1.130 (colored)

Add missing const.

Revision 1.130 / (download) - annotate - [select for diffs], Sun May 29 22:00:50 2005 UTC (8 years ago) by christos
Branch: MAIN
Changes since 1.129: +3 -3 lines
Diff to previous 1.129 (colored)

- Sprinkle const
- Avoid variable shadowing.
- Eliminate some caddr_t abuse.

Revision 1.129 / (download) - annotate - [select for diffs], Mon Apr 4 11:26:50 2005 UTC (8 years, 2 months ago) by yamt
Branch: MAIN
CVS Tags: kent-audio2-base
Changes since 1.128: +5 -2 lines
Diff to previous 1.128 (colored)

scsipi_completion_thread:
if we seemt to need more resources after doing ADAPTER_REQ_GROW_RESOURCES,
yield cpu rather than busy-looping.  PR/25164.

Revision 1.128 / (download) - annotate - [select for diffs], Sun Feb 27 00:27:48 2005 UTC (8 years, 3 months ago) by perry
Branch: MAIN
CVS Tags: yamt-km-base4, yamt-km-base3, netbsd-3-base, netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0, netbsd-3
Changes since 1.127: +10 -10 lines
Diff to previous 1.127 (colored)

nuke trailing whitespace

Revision 1.127 / (download) - annotate - [select for diffs], Mon Feb 21 00:29:07 2005 UTC (8 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.126: +48 -47 lines
Diff to previous 1.126 (colored)

Part 1 of a cleanup pass over the SCSI subsystem.  The aim is to name
everything "scsi_*", since we really are talking about the SCSI command
set, ATAPI transport not withstanding.  Improve the names of many structures,
and prepend "SCSI_" onto all SCSI command opcodes.  Place items described
by the SCSI Primary Commands document into scsi_spc.h.

Revision 1.126 / (download) - annotate - [select for diffs], Tue Feb 1 00:19:34 2005 UTC (8 years, 4 months ago) by reinoud
Branch: MAIN
CVS Tags: yamt-km-base2, matt-timespec
Changes since 1.125: +9 -9 lines
Diff to previous 1.125 (colored)

Backing out changes to clean up scsipi. I was pointed out there were
problems i hadn't seen. To prevent lossage i'd decided to back off all
changes and let them be reviewed on tech-kern.

Revision 1.125 / (download) - annotate - [select for diffs], Mon Jan 31 23:06:41 2005 UTC (8 years, 4 months ago) by reinoud
Branch: MAIN
Changes since 1.124: +7 -7 lines
Diff to previous 1.124 (colored)

Part of the cleanup of sys/scsipi's use of types; rename all u_int* to
uint* and change the u_long's to uint32_t's where possible. Note that the
iocl definitions/hooks have to be ulong (or u_long) or they'll bomb out.

Revision 1.124 / (download) - annotate - [select for diffs], Mon Jan 31 21:13:16 2005 UTC (8 years, 4 months ago) by reinoud
Branch: MAIN
Changes since 1.123: +4 -4 lines
Diff to previous 1.123 (colored)

As part of cleaning up sys/scsipi, replace all u_char by uint8_t and
replace all `short' with int16_t.

Revision 1.123 / (download) - annotate - [select for diffs], Tue Dec 7 23:14:03 2004 UTC (8 years, 6 months ago) by thorpej
Branch: MAIN
CVS Tags: yamt-km-base, kent-audio1-beforemerge
Branch point for: yamt-km, kent-audio2
Changes since 1.122: +5 -5 lines
Diff to previous 1.122 (colored)

READ_CAPACITY -> READ_CAPACITY_10

Revision 1.122 / (download) - annotate - [select for diffs], Fri Dec 3 20:20:32 2004 UTC (8 years, 6 months ago) by thorpej
Branch: MAIN
CVS Tags: kent-audio1-base, kent-audio1
Changes since 1.121: +33 -8 lines
Diff to previous 1.121 (colored)

And thus spake SBC-3:

If the number of logical blocks exceeds the maximum value that is able to be
specified in the RETURNED  LOGICAL BLOCK ADDRESS field, the device server
shall set the RETURNED LOGICAL BLOCK ADDRESS field to  FFFFFFFFh. The
application client should then issue a READ CAPACITY (16) command (see 5.11)
to  retrieve the READ CAPACITY (16) parameter data.

Implement this in scsipi_size().

First issue in kern/28514.

Revision 1.121 / (download) - annotate - [select for diffs], Fri Oct 1 03:39:11 2004 UTC (8 years, 8 months ago) by enami
Branch: MAIN
Changes since 1.120: +5 -4 lines
Diff to previous 1.120 (colored)

Don't touch free'ed object.  Fixes l_holdcnt leak reported by Andreas Wrede
on current-users.

Revision 1.120 / (download) - annotate - [select for diffs], Sat Sep 18 18:49:50 2004 UTC (8 years, 9 months ago) by mycroft
Branch: MAIN
Changes since 1.119: +4 -13 lines
Diff to previous 1.119 (colored)

If our enqueue failed -- because we're polling and there is already something
in the queue -- do not attempt to requeue it.  We only poll in two cases:

1) We have a non-interrupting controller.  In this case, execution of the
   previous command should have left the queue empty.  (Perhaps there should be
   a KASSERT() to this effect.)

2) We're in the shutdown path, either doing a cache sync or a dump.  In these
   cases, the retry behavior is useless, because we will no longer get
   interrupts to notify us that the earlier commands completed.  Instead we
   just spin for a few seconds and fail anyway.  (XXX We should probably clear
   the queue explicitly so that the shutdown/dump will succeed.)

Revision 1.119 / (download) - annotate - [select for diffs], Sat Sep 18 18:29:00 2004 UTC (8 years, 9 months ago) by mycroft
Branch: MAIN
Changes since 1.118: +5 -7 lines
Diff to previous 1.118 (colored)

Since we always defer probing SCSI and ATAPI devices now, we can never be
"cold" -- so change the check for this to a KASSERT().

Revision 1.118 / (download) - annotate - [select for diffs], Sat Sep 18 18:00:05 2004 UTC (8 years, 9 months ago) by mycroft
Branch: MAIN
Changes since 1.117: +4 -4 lines
Diff to previous 1.117 (colored)

Oops; eliminate the EJUSTRETURN return value from scsipi_execute_xs().  Don't
know how this worked when I tested it.

Revision 1.117 / (download) - annotate - [select for diffs], Sat Sep 18 00:21:03 2004 UTC (8 years, 9 months ago) by mycroft
Branch: MAIN
Changes since 1.116: +32 -42 lines
Diff to previous 1.116 (colored)

Minor rearrangement.  Whitespace and #include cleanup.

Revision 1.116 / (download) - annotate - [select for diffs], Sat Sep 18 00:08:16 2004 UTC (8 years, 9 months ago) by mycroft
Branch: MAIN
Changes since 1.115: +77 -89 lines
Diff to previous 1.115 (colored)

Standardize some variable names and the calling pattern for scsipi_command().
Use void pointer casts.

Revision 1.115 / (download) - annotate - [select for diffs], Fri Sep 17 23:43:17 2004 UTC (8 years, 9 months ago) by mycroft
Branch: MAIN
Changes since 1.114: +13 -13 lines
Diff to previous 1.114 (colored)

Remove the "xfer" argument to scsipi_command().

Revision 1.114 / (download) - annotate - [select for diffs], Fri Sep 17 23:30:22 2004 UTC (8 years, 9 months ago) by mycroft
Branch: MAIN
Changes since 1.113: +19 -2 lines
Diff to previous 1.113 (colored)

Change the way bustype_cmd is used.  Rather than having it be responsible for
calling scsipi_make_xs() and scsipi_execute_xs(), instead push these into
scsipi_command.  Make bustype_cmd and PHOLD/PRELE be called from
scsipi_execute_xs().  This allows us to create a xfer structure -- possibly on
the stack -- and call scsipi_execute_xs() directly.

Revision 1.113 / (download) - annotate - [select for diffs], Fri Sep 17 23:10:50 2004 UTC (8 years, 9 months ago) by mycroft
Branch: MAIN
Changes since 1.112: +4 -23 lines
Diff to previous 1.112 (colored)

Do not manipulate xs->bp in "generic" code -- do it only in the psw_done
routine.  As part of this, pass down our pre-parsed error code -- though this
interface will probably change later to accomodate better error handling.

Revision 1.112 / (download) - annotate - [select for diffs], Thu Sep 9 19:35:31 2004 UTC (8 years, 9 months ago) by bouyer
Branch: MAIN
Changes since 1.111: +21 -17 lines
Diff to previous 1.111 (colored)

Make the xxstart() functions reentrant again, as some drivers HBA can call
scsipi_done() from their scsipi_request().
For this, add a struct scsipi_xfer * argument to scsipi_command().
If not NULL scsipi_command() will use this to enqueue this xfer, otherwise
it'll try to allocate a new one. This scsipi_xfer has to be allocated
and initialised by scsipi_make_xs() or equivalent.
In xxstart(), allocate a scsipi_xfer using scsipi_make_xs(), and if not NULL,
dequeue the buffer before calling scsipi_command(). This makes sure that
scsipi_command() will not fail, and also makes sure that xxstart() won't
be called again between the BUFQ_PEEK() and BUFQ_GET().

Fix "dequeued wrong buf" panics reported by Juergen Hannken-Illjes in
private mail and Andreas Wrede on current-users@.
Thanks to Jason Thorpe and Chuck Silver for review, and Andreas Wrede for
testing the patch.

Revision 1.111 / (download) - annotate - [select for diffs], Thu Sep 2 12:39:56 2004 UTC (8 years, 9 months ago) by chs
Branch: MAIN
Changes since 1.110: +5 -4 lines
Diff to previous 1.110 (colored)

make this compile on platforms where PAGE_SIZE is not a compile-time constant.

Revision 1.110 / (download) - annotate - [select for diffs], Fri Aug 27 20:37:28 2004 UTC (8 years, 9 months ago) by bouyer
Branch: MAIN
Changes since 1.109: +7 -2 lines
Diff to previous 1.109 (colored)

Improve handling of memory shortage, to fix problems like:
sd3(mpt0:0:1:0): unable to allocate scsipi_xfer
sd3: not queued, error 12
Havard Eidnes's analysis of this problem is that the scsipi_xfer pool is
competing for resources with other pools, including the the inode and vnode
pools which can grow quite large.

*_scsipi_cmd(): don't biodone the buffer if scsipi_make_xs() fails, let the
   caller deal with the problem
start function of block devices drivers: dequeue the buffer after the
   scsipi_command() call. If scsipi_command() fails with ENOMEM don't dequeue
   the buffer, and schedule a callout to call the start function after
   some delay.
scsipi_init(): prime the scsipi_xfer_pool with one page. This ensure that
   there is always some scsipi_xfer to play with. If scsipi_command() fails
   because of pool_get(), we're sure there will be resources available later,
   when the pending commands have completed.

Reviewed by Jason Thorpe and Havard Eidnes.
Todo: remove the "unable to allocate scsipi_xfer" and "not queued, error %d"
printfs, but I choose to keep them for now, to help make sure the code does
what it should.

Revision 1.109 / (download) - annotate - [select for diffs], Mon Aug 23 20:01:10 2004 UTC (8 years, 9 months ago) by bouyer
Branch: MAIN
Changes since 1.108: +3 -3 lines
Diff to previous 1.108 (colored)

Fix typo pointed out by Patrick Welche on current-users@

Revision 1.108 / (download) - annotate - [select for diffs], Sat Aug 21 21:29:39 2004 UTC (8 years, 9 months ago) by thorpej
Branch: MAIN
Changes since 1.107: +106 -180 lines
Diff to previous 1.107 (colored)

Use ANSI function decls and make use of static.

Revision 1.107 / (download) - annotate - [select for diffs], Wed Aug 18 11:50:59 2004 UTC (8 years, 10 months ago) by drochner
Branch: MAIN
Changes since 1.106: +2 -4 lines
Diff to previous 1.106 (colored)

Use the new autoconf functions to rescan busses and detach devices
on user request.
This duplicates the functionality provided by a private ioctl
interface (accessible through scsictl(8)), but in a more generic way.

Revision 1.106 / (download) - annotate - [select for diffs], Wed Aug 4 22:25:45 2004 UTC (8 years, 10 months ago) by bouyer
Branch: MAIN
Changes since 1.105: +4 -7 lines
Diff to previous 1.105 (colored)

Fix some problems in the scsipi detach code:
- only call periph_switch->psw_start() if the device is active; if it is not
  psw_start() may try to access invalid data.
- remove the TAILQ_FIRST(&periph->periph_xferq) != NULL diagnostic in
  scsipi_kill_pending(). This can't be true at this point (unless the device
  was idle at the time of the detach), because the scsipi channel kernel
  thread has to run for the queue to be flushed.
There are still other problems to be fixed here ...

Revision 1.105 / (download) - annotate - [select for diffs], Tue Apr 27 18:15:37 2004 UTC (9 years, 1 month ago) by bouyer
Branch: MAIN
Changes since 1.104: +3 -8 lines
Diff to previous 1.104 (colored)

Revert part of 1.102:
Don't decrease/check xs_retries when the device report "Power On, Reset, or
Bus Device Reset" sense condition, just retry the command. The initial bus
reset would cause the first TEST_UNIT_READY to report this condition,
and as xs_retries is set to 0 when XS_CTL_DISCOVERY is set, it would report an
error instead of being retried, causing the disk probe to report "drive
offline" instead of the geometry and capacity. Checking/decreasing
xs_retries on the bus reset reported by the adapter is enouth to avoid the
problem reported by rev 1.102.

Problem analysed by Paul Kranenburg, fix confirmed by Anders Hjalmars,
and explaination as to why the INQUIRY wasn't affected by this provided by
Bill Studenmund.

Revision 1.104 / (download) - annotate - [select for diffs], Tue Mar 16 19:10:43 2004 UTC (9 years, 3 months ago) by bouyer
Branch: MAIN
CVS Tags: netbsd-2-0-base
Branch point for: netbsd-2-0
Changes since 1.103: +5 -5 lines
Diff to previous 1.103 (colored)

cbd -> cdb
Command Block Descriptor -> Command Descriptor Block
Pointed out by Allen Briggs.

Revision 1.103 / (download) - annotate - [select for diffs], Mon Mar 15 22:43:43 2004 UTC (9 years, 3 months ago) by bouyer
Branch: MAIN
Changes since 1.102: +49 -2 lines
Diff to previous 1.102 (colored)

Extract the code printing the CBD from scsipi_print_sense(), so that it's
usable in other context.
Use the new scsipi_print_cbd() to dump the command in case of timeout
in siop/esiop.

Revision 1.102 / (download) - annotate - [select for diffs], Wed Mar 10 21:57:31 2004 UTC (9 years, 3 months ago) by bouyer
Branch: MAIN
Changes since 1.101: +13 -4 lines
Diff to previous 1.101 (colored)

Decrease xs_retries before retrying aborted commands, and report EIO if it
reaches 0. Avoids looping on aborded command in some special cases.

Revision 1.101 / (download) - annotate - [select for diffs], Sat Jan 3 01:48:38 2004 UTC (9 years, 5 months ago) by thorpej
Branch: MAIN
Changes since 1.100: +3 -3 lines
Diff to previous 1.100 (colored)

callout_init() after memset().

Revision 1.100 / (download) - annotate - [select for diffs], Tue Nov 18 21:39:12 2003 UTC (9 years, 7 months ago) by briggs
Branch: MAIN
Changes since 1.99: +13 -13 lines
Diff to previous 1.99 (colored)

Use aprint_normal instead of printf in scsipi_print_xfer_mode().

Revision 1.99 / (download) - annotate - [select for diffs], Tue Oct 28 09:52:32 2003 UTC (9 years, 7 months ago) by simonb
Branch: MAIN
Changes since 1.98: +3 -2 lines
Diff to previous 1.98 (colored)

Fix bogus uninitialised warning.

Revision 1.98 / (download) - annotate - [select for diffs], Fri Oct 17 16:44:48 2003 UTC (9 years, 8 months ago) by mycroft
Branch: MAIN
Changes since 1.97: +13 -2 lines
Diff to previous 1.97 (colored)

Add a comment explaining the INQUIRE behavior.

Revision 1.97 / (download) - annotate - [select for diffs], Thu Oct 16 22:46:07 2003 UTC (9 years, 8 months ago) by mycroft
Branch: MAIN
Changes since 1.96: +6 -4 lines
Diff to previous 1.96 (colored)

Whoops, set cmd_length correctly for the 36-byte INQUIRE.

Revision 1.96 / (download) - annotate - [select for diffs], Thu Oct 16 17:34:43 2003 UTC (9 years, 8 months ago) by mycroft
Branch: MAIN
Changes since 1.95: +12 -13 lines
Diff to previous 1.95 (colored)

Do a 36-byte SCSI 2 inquiry first, and iff that returns an additional length
>32 do a 74-byte inquiry.  Fixes problems with devices that barf on longer
inquiries.  (Linux uses 36 bytes almost everywhere, as a data point.)

Revision 1.95 / (download) - annotate - [select for diffs], Sun Oct 12 03:21:56 2003 UTC (9 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.94: +1 -12 lines
Diff to previous 1.94 (colored)

Revert previous change.

Revision 1.94 / (download) - annotate - [select for diffs], Fri Oct 10 05:58:56 2003 UTC (9 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.93: +14 -3 lines
Diff to previous 1.93 (colored)

Warn if a sync period requiring DT was negotiated on a peripheral not
capable of DT.

Revision 1.93 / (download) - annotate - [select for diffs], Tue Sep 9 02:37:55 2003 UTC (9 years, 9 months ago) by mycroft
Branch: MAIN
Changes since 1.92: +2 -5 lines
Diff to previous 1.92 (colored)

Exorcise PQUIRK_NODOORLOCK.

Revision 1.92 / (download) - annotate - [select for diffs], Mon Sep 8 18:51:36 2003 UTC (9 years, 9 months ago) by mycroft
Branch: MAIN
Changes since 1.91: +2 -5 lines
Diff to previous 1.91 (colored)

Do a START UNIT only if the TEST UNIT READY reports that the device is not
ready.  This avoids gratuitously starting the motor on floppy and CD-ROM
drives, and eliminates the need for the audio playing test in cdopen().

Therefore, also remove PQUIRK_NOSTARTUNIT.

Revision 1.91 / (download) - annotate - [select for diffs], Mon Sep 8 03:50:27 2003 UTC (9 years, 9 months ago) by mycroft
Branch: MAIN
Changes since 1.90: +3 -11 lines
Diff to previous 1.90 (colored)

On further investigation... don't panic if we try to do a 6-byte mode
sense/select on ATAPI.  Some tape drives require it.  And who knows?  Some
fool might wire a RBC device to ATAPI.

Revision 1.90 / (download) - annotate - [select for diffs], Mon Sep 8 03:33:32 2003 UTC (9 years, 9 months ago) by mycroft
Branch: MAIN
Changes since 1.89: +7 -6 lines
Diff to previous 1.89 (colored)

Perform the exorcism on scsipi_mode_select() too.

Revision 1.89 / (download) - annotate - [select for diffs], Mon Sep 8 03:24:12 2003 UTC (9 years, 9 months ago) by mycroft
Branch: MAIN
Changes since 1.88: +7 -6 lines
Diff to previous 1.88 (colored)

Exorcise something evil and wrong in scsipi_mode_sense().

Revision 1.88 / (download) - annotate - [select for diffs], Sat Apr 19 19:12:59 2003 UTC (10 years, 2 months ago) by fvdl
Branch: MAIN
Branch point for: ktrace-lwp
Changes since 1.87: +16 -4 lines
Diff to previous 1.87 (colored)

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

Revision 1.87 / (download) - annotate - [select for diffs], Wed Apr 16 21:08:06 2003 UTC (10 years, 2 months ago) by nathanw
Branch: MAIN
Changes since 1.86: +3 -3 lines
Diff to previous 1.86 (colored)

Remove extra right paren.

Revision 1.86 / (download) - annotate - [select for diffs], Wed Apr 16 20:25:59 2003 UTC (10 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.85: +14 -13 lines
Diff to previous 1.85 (colored)

* 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.

Revision 1.85 / (download) - annotate - [select for diffs], Thu Apr 3 22:18:25 2003 UTC (10 years, 2 months ago) by fvdl
Branch: MAIN
Changes since 1.84: +3 -3 lines
Diff to previous 1.84 (colored)

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.

Revision 1.84 / (download) - annotate - [select for diffs], Mon Feb 3 23:51:00 2003 UTC (10 years, 4 months ago) by thorpej
Branch: MAIN
Changes since 1.83: +3 -3 lines
Diff to previous 1.83 (colored)

Test callout_pending(), not callout_active(), and eliminate now-unnecessary
callout_deactivate() calls.

Revision 1.83 / (download) - annotate - [select for diffs], Mon Jan 20 04:08:44 2003 UTC (10 years, 5 months ago) by simonb
Branch: MAIN
Changes since 1.82: +5 -3 lines
Diff to previous 1.82 (colored)

Only declare and set the "info" variable #ifndef SCSIVERBOSE.

Revision 1.82 / (download) - annotate - [select for diffs], Sun Nov 24 11:52:13 2002 UTC (10 years, 6 months ago) by scw
Branch: MAIN
CVS Tags: nathanw_sa_before_merge, nathanw_sa_base, gmcgarry_ucred_base, gmcgarry_ucred, gmcgarry_ctxsw_base, gmcgarry_ctxsw, fvdl_fs64_base
Changes since 1.81: +3 -3 lines
Diff to previous 1.81 (colored)

Quell an uninitialised variable warning.

Revision 1.81 / (download) - annotate - [select for diffs], Sat Nov 9 19:02:27 2002 UTC (10 years, 7 months ago) by thorpej
Branch: MAIN
Changes since 1.80: +4 -3 lines
Diff to previous 1.80 (colored)

Fix signed/unsigned comparison warnings.

Revision 1.80 / (download) - annotate - [select for diffs], Fri Oct 4 03:41:50 2002 UTC (10 years, 8 months ago) by soren
Branch: MAIN
CVS Tags: kqueue-beforemerge, kqueue-aftermerge
Changes since 1.79: +3 -6 lines
Diff to previous 1.79 (colored)

Leave error printing to the callers of scsipi_size().

Revision 1.79 / (download) - annotate - [select for diffs], Thu Sep 19 08:31:08 2002 UTC (10 years, 9 months ago) by jmc
Branch: MAIN
CVS Tags: kqueue-base
Changes since 1.78: +5 -2 lines
Diff to previous 1.78 (colored)

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).

Revision 1.78 / (download) - annotate - [select for diffs], Fri Jul 26 14:11:34 2002 UTC (10 years, 10 months ago) by wiz
Branch: MAIN
CVS Tags: gehenna-devsw-base
Changes since 1.77: +3 -3 lines
Diff to previous 1.77 (colored)

Spell '[Rr]ight' correctly. From Jim Bernard.

Revision 1.77 / (download) - annotate - [select for diffs], Wed Jun 5 00:15:33 2002 UTC (11 years ago) by mjacob
Branch: MAIN
Changes since 1.76: +12 -8 lines
Diff to previous 1.76 (colored)

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.

Revision 1.76 / (download) - annotate - [select for diffs], Mon Jun 3 16:17:57 2002 UTC (11 years ago) by bouyer
Branch: MAIN
Changes since 1.75: +3 -3 lines
Diff to previous 1.75 (colored)

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.

Revision 1.75 / (download) - annotate - [select for diffs], Fri May 17 18:56:05 2002 UTC (11 years, 1 month ago) by mjacob
Branch: MAIN
CVS Tags: netbsd-1-6-base
Branch point for: netbsd-1-6
Changes since 1.74: +7 -2 lines
Diff to previous 1.74 (colored)

Give XS_DRIVER_STUFFUP a case all by itself.

Revision 1.74 / (download) - annotate - [select for diffs], Thu May 16 02:54:20 2002 UTC (11 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.73: +33 -25 lines
Diff to previous 1.73 (colored)

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.

Revision 1.73 / (download) - annotate - [select for diffs], Wed May 15 11:19:38 2002 UTC (11 years, 1 month ago) by bouyer
Branch: MAIN
Branch point for: gehenna-devsw
Changes since 1.72: +7 -6 lines
Diff to previous 1.72 (colored)

scsipi_print_xfer_mode(): PERIPH_CAP_DT is an equivalent of
(PERIPH_CAP_SYNC | PERIPH_CAP_WIDE16) here.

Revision 1.72 / (download) - annotate - [select for diffs], Sun May 5 15:16:32 2002 UTC (11 years, 1 month ago) by bouyer
Branch: MAIN
Changes since 1.71: +3 -3 lines
Diff to previous 1.71 (colored)

If periph->periph_callout is already active, don't freeze the periph again:
scispi_periph_timed_thaw() will be called only one time anyway.

Revision 1.71 / (download) - annotate - [select for diffs], Mon Apr 1 20:37:42 2002 UTC (11 years, 2 months ago) by bouyer
Branch: MAIN
Changes since 1.70: +3 -4 lines
Diff to previous 1.70 (colored)

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).

Revision 1.70 / (download) - annotate - [select for diffs], Thu Mar 28 22:01:22 2002 UTC (11 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.69: +12 -6 lines
Diff to previous 1.69 (colored)

PR/16110: Chris Jepeway: scsipi_complete() calls (*psw_done)() b/4
setting buffer fields

Revision 1.69 / (download) - annotate - [select for diffs], Sat Mar 16 17:21:19 2002 UTC (11 years, 3 months ago) by bouyer
Branch: MAIN
CVS Tags: eeh-devprop-base, eeh-devprop
Changes since 1.68: +11 -4 lines
Diff to previous 1.68 (colored)

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.

Revision 1.68 / (download) - annotate - [select for diffs], Fri Mar 8 20:48:39 2002 UTC (11 years, 3 months ago) by thorpej
Branch: MAIN
CVS Tags: newlock-base, newlock
Changes since 1.67: +3 -3 lines
Diff to previous 1.67 (colored)

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.

Revision 1.67 / (download) - annotate - [select for diffs], Thu Feb 21 05:30:30 2002 UTC (11 years, 3 months ago) by enami
Branch: MAIN
CVS Tags: ifpoll-base, ifpoll
Changes since 1.66: +3 -3 lines
Diff to previous 1.66 (colored)

Fix broken indentation.

Revision 1.66 / (download) - annotate - [select for diffs], Sat Jan 12 16:37:55 2002 UTC (11 years, 5 months ago) by tsutsui
Branch: MAIN
Changes since 1.65: +4 -4 lines
Diff to previous 1.65 (colored)

Call malloc(9) with M_ZERO flag instead of memset() after malloc().

Revision 1.65 / (download) - annotate - [select for diffs], Wed Nov 28 01:04:49 2001 UTC (11 years, 6 months ago) by fredette
Branch: MAIN
Changes since 1.64: +4 -4 lines
Diff to previous 1.64 (colored)

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.

Revision 1.64 / (download) - annotate - [select for diffs], Mon Nov 26 20:39:29 2001 UTC (11 years, 6 months ago) by fredette
Branch: MAIN
Changes since 1.63: +77 -5 lines
Diff to previous 1.63 (colored)

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.

Revision 1.63 / (download) - annotate - [select for diffs], Thu Nov 15 09:48:17 2001 UTC (11 years, 7 months ago) by lukem
Branch: MAIN
Changes since 1.62: +2 -3 lines
Diff to previous 1.62 (colored)

don't need <sys/types.h> when including <sys/param.h>

Revision 1.62 / (download) - annotate - [select for diffs], Tue Nov 13 06:56:40 2001 UTC (11 years, 7 months ago) by lukem
Branch: MAIN
Changes since 1.61: +4 -1 lines
Diff to previous 1.61 (colored)

add RCSIDs

Revision 1.61 / (download) - annotate - [select for diffs], Sun Oct 14 21:17:41 2001 UTC (11 years, 8 months ago) by bouyer
Branch: MAIN
CVS Tags: thorpej-mips-cache-base, thorpej-mips-cache
Changes since 1.60: +6 -1 lines
Diff to previous 1.60 (colored)

Refuse to register a callback if the completion thread isn't started yet.

Revision 1.60 / (download) - annotate - [select for diffs], Sun Oct 14 20:31:24 2001 UTC (11 years, 8 months ago) by bouyer
Branch: MAIN
Changes since 1.59: +25 -7 lines
Diff to previous 1.59 (colored)

Call ADAPTER_REQ_GROW_RESOURCES from the completion thread, if possible.
This allows HBA drivers to call bus_dmamem_map() safely.

Revision 1.59 / (download) - annotate - [select for diffs], Sun Oct 14 19:03:43 2001 UTC (11 years, 8 months ago) by bouyer
Branch: MAIN
Changes since 1.58: +13 -13 lines
Diff to previous 1.58 (colored)

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.

Revision 1.58 / (download) - annotate - [select for diffs], Thu Sep 27 18:11:06 2001 UTC (11 years, 8 months ago) by mjacob
Branch: MAIN
CVS Tags: thorpej-devvp-base3, thorpej-devvp-base2
Changes since 1.57: +44 -14 lines
Diff to previous 1.57 (colored)

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

Revision 1.57 / (download) - annotate - [select for diffs], Fri Sep 21 13:54:47 2001 UTC (11 years, 9 months ago) by fvdl
Branch: MAIN
Changes since 1.56: +9 -31 lines
Diff to previous 1.56 (colored)

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.

Revision 1.56 / (download) - annotate - [select for diffs], Tue Sep 18 20:20:26 2001 UTC (11 years, 9 months ago) by mjacob
Branch: MAIN
Changes since 1.55: +32 -10 lines
Diff to previous 1.55 (colored)

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.

Revision 1.55 / (download) - annotate - [select for diffs], Sat Sep 1 00:54:38 2001 UTC (11 years, 9 months ago) by mjacob
Branch: MAIN
CVS Tags: thorpej-devvp-base, pre-chs-ubcperf, post-chs-ubcperf
Branch point for: thorpej-devvp
Changes since 1.54: +2 -1 lines
Diff to previous 1.54 (colored)

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

Revision 1.54 / (download) - annotate - [select for diffs], Mon Aug 20 11:20:51 2001 UTC (11 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.53: +2 -2 lines
Diff to previous 1.53 (colored)

Cosmetic change.

Revision 1.53 / (download) - annotate - [select for diffs], Mon Aug 20 07:47:01 2001 UTC (11 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.52: +2 -3 lines
Diff to previous 1.52 (colored)

Medium Not Present has number of defined ASCQs. Pointed out by Sergey
Svishchev <svs@ropnet.ru> in PR 8326.

Revision 1.52 / (download) - annotate - [select for diffs], Sun Aug 19 14:05:13 2001 UTC (11 years, 10 months ago) by yamt
Branch: MAIN
Changes since 1.51: +2 -2 lines
Diff to previous 1.51 (colored)

fix scsipi_target_detach with wildcard target.

Revision 1.51 / (download) - annotate - [select for diffs], Wed Jul 18 20:19:24 2001 UTC (11 years, 11 months ago) by bouyer
Branch: MAIN
Changes since 1.50: +108 -13 lines
Diff to previous 1.50 (colored)

Adn scsipi_target_detach() and scsipi_thread_call_callback() as discussed
on tech-kern. scsipi_target_detach() accept wildcard target/lun as requested.

Revision 1.50 / (download) - annotate - [select for diffs], Wed Jul 18 18:21:05 2001 UTC (11 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.49: +11 -11 lines
Diff to previous 1.49 (colored)

bzero -> memset

Revision 1.49 / (download) - annotate - [select for diffs], Fri Jul 13 20:00:23 2001 UTC (11 years, 11 months ago) by bouyer
Branch: MAIN
Changes since 1.48: +19 -20 lines
Diff to previous 1.48 (colored)

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.

Revision 1.48 / (download) - annotate - [select for diffs], Wed Jun 27 23:14:26 2001 UTC (11 years, 11 months ago) by ross
Branch: MAIN
Branch point for: kqueue
Changes since 1.47: +3 -1 lines
Diff to previous 1.47 (colored)

compile tweak for non-SCSIVERBOSE

Revision 1.47 / (download) - annotate - [select for diffs], Wed Jun 27 13:21:30 2001 UTC (11 years, 11 months ago) by bouyer
Branch: MAIN
Changes since 1.46: +7 -1 lines
Diff to previous 1.46 (colored)

Better diagnostic when a REQUEST SENSE is terminated with CHECK CONDITION.

Revision 1.46 / (download) - annotate - [select for diffs], Tue Jun 26 15:32:02 2001 UTC (11 years, 11 months ago) by bouyer
Branch: MAIN
Changes since 1.45: +5 -3 lines
Diff to previous 1.45 (colored)

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).

Revision 1.45 / (download) - annotate - [select for diffs], Wed Jun 13 18:17:42 2001 UTC (12 years ago) by bjh21
Branch: MAIN
Changes since 1.44: +5 -1 lines
Diff to previous 1.44 (colored)

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.

Revision 1.44 / (download) - annotate - [select for diffs], Wed May 23 15:50:32 2001 UTC (12 years ago) by bouyer
Branch: MAIN
Changes since 1.43: +10 -9 lines
Diff to previous 1.43 (colored)

In scsipi_channel_thaw(), if the count drops to 0, call scsipi_run_queue().

Revision 1.43 / (download) - annotate - [select for diffs], Fri May 18 16:25:07 2001 UTC (12 years, 1 month ago) by enami
Branch: MAIN
Changes since 1.42: +3 -3 lines
Diff to previous 1.42 (colored)

Don't capitalize the word sync or async.  It's inconsistient with other
messages.

Revision 1.42 / (download) - annotate - [select for diffs], Fri May 18 12:56:28 2001 UTC (12 years, 1 month ago) by bouyer
Branch: MAIN
Changes since 1.41: +5 -2 lines
Diff to previous 1.41 (colored)

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.

Revision 1.41 / (download) - annotate - [select for diffs], Mon May 14 20:35:28 2001 UTC (12 years, 1 month ago) by bouyer
Branch: MAIN
Changes since 1.40: +98 -1 lines
Diff to previous 1.40 (colored)

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.

Revision 1.40 / (download) - annotate - [select for diffs], Fri Apr 27 21:36:58 2001 UTC (12 years, 1 month ago) by bouyer
Branch: MAIN
Changes since 1.39: +4 -1 lines
Diff to previous 1.39 (colored)

Don't forget to call psw_done() !

Revision 1.39 / (download) - annotate - [select for diffs], Wed Apr 25 17:53:40 2001 UTC (12 years, 1 month ago) by bouyer
Branch: MAIN
Changes since 1.38: +1716 -333 lines
Diff to previous 1.38 (colored)

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

Revision 1.38 / (download) - annotate - [select for diffs], Fri Jun 9 08:54:24 2000 UTC (13 years ago) by enami
Branch: MAIN
CVS Tags: thorpej_scsipi_nbase, thorpej_scsipi_beforemerge, thorpej_scsipi_base, netbsd-1-5-base, netbsd-1-5-RELEASE, netbsd-1-5-PATCH003, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2, netbsd-1-5
Branch point for: nathanw_sa
Changes since 1.37: +3 -2 lines
Diff to previous 1.37 (colored)

Prevent a process being swapped out during I/O if the data buffer is
allocated on stack.  This potential problem is noticed by Noriyuki Soda
and the idea and sample code to fix is given by Jason R. Thorpe.

Revision 1.37 / (download) - annotate - [select for diffs], Wed May 31 11:14:25 2000 UTC (13 years ago) by fvdl
Branch: MAIN
Changes since 1.36: +2 -1 lines
Diff to previous 1.36 (colored)

Initialize xs_status to 0 after allocating a scsipi_xfer struct. Makes life
easier for driver debugging.

Revision 1.36 / (download) - annotate - [select for diffs], Sat May 27 23:59:58 2000 UTC (13 years ago) by fvdl
Branch: MAIN
Changes since 1.35: +3 -4 lines
Diff to previous 1.35 (colored)

At least try to do something useful in the XS_BUSY case; don't cause
a panic by sleeping in an interrupt context.

Revision 1.35 / (download) - annotate - [select for diffs], Tue May 23 10:16:43 2000 UTC (13 years ago) by bouyer
Branch: MAIN
CVS Tags: minoura-xpg4dl-base
Branch point for: minoura-xpg4dl
Changes since 1.34: +3 -2 lines
Diff to previous 1.34 (colored)

scsipi_get_xs(): if we have XS_CTL_URGENT, return an xfer even if
active >= openings. An XS_CTL_URGENT command could otherwise fail, especially
if openings == 1.

Revision 1.34 / (download) - annotate - [select for diffs], Mon Apr 3 03:37:34 2000 UTC (13 years, 2 months ago) by enami
Branch: MAIN
Changes since 1.33: +2 -5 lines
Diff to previous 1.33 (colored)

When killing pending xfers on device detach, we can't expect scsipi_done
to remove all xfers from the pending queue.  It removes only xfers for
asynchronous transactions.  So, simply loop over all pending xfers
with calling scsipi_done and wait xfers to drain.  Addresses PR#9703.

Revision 1.33 / (download) - annotate - [select for diffs], Mon Apr 3 01:40:51 2000 UTC (13 years, 2 months ago) by enami
Branch: MAIN
Changes since 1.32: +3 -2 lines
Diff to previous 1.32 (colored)

Fold long line.

Revision 1.32 / (download) - annotate - [select for diffs], Sun Apr 2 17:58:17 2000 UTC (13 years, 2 months ago) by augustss
Branch: MAIN
Changes since 1.31: +2 -2 lines
Diff to previous 1.31 (colored)

With SCSIVERBOSE, only print sense data if there actually is a problem.

Revision 1.31 / (download) - annotate - [select for diffs], Sun Apr 2 03:05:55 2000 UTC (13 years, 2 months ago) by enami
Branch: MAIN
Changes since 1.30: +7 -4 lines
Diff to previous 1.30 (colored)

Add missing protect from disk interrupt while calling scsipi_free_xs.

Revision 1.30 / (download) - annotate - [select for diffs], Thu Mar 23 07:01:44 2000 UTC (13 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.29: +2 -1 lines
Diff to previous 1.29 (colored)

New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
  resource allocation.
- Insertion and removal of callouts is constant time, important as
  this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.

Revision 1.29 / (download) - annotate - [select for diffs], Mon Jan 17 17:59:48 2000 UTC (13 years, 5 months ago) by bouyer
Branch: MAIN
CVS Tags: chs-ubc2-newbase
Changes since 1.28: +7 -6 lines
Diff to previous 1.28 (colored)

Use SCSIPIRETRIES instead of hard-coded value '2' for number of retries in
common routines. Define SCSIPIRETRIES as 4, so that the command will finally
succeed after several consecutive downgrades from UDMA2 to PIO4.

Revision 1.28 / (download) - annotate - [select for diffs], Fri Jan 14 02:40:45 2000 UTC (13 years, 5 months ago) by mjacob
Branch: MAIN
Changes since 1.27: +19 -1 lines
Diff to previous 1.27 (colored)

Print out the contents of an otherwise unreported undecodable
sense data buffer. This helps catch adapter breakage mostly.

Revision 1.27 / (download) - annotate - [select for diffs], Wed Oct 20 15:22:28 1999 UTC (13 years, 8 months ago) by enami
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221, fvdl-softdep-base, comdex-fall-1999-base, comdex-fall-1999
Changes since 1.26: +7 -8 lines
Diff to previous 1.26 (colored)

Cancel active transfers on aic/wdc detach.
Also makes LS-120 drive works for me again.

Revision 1.26 / (download) - annotate - [select for diffs], Sun Oct 17 06:13:01 1999 UTC (13 years, 8 months ago) by enami
Branch: MAIN
Branch point for: thorpej_scsipi, fvdl-softdep
Changes since 1.25: +2 -2 lines
Diff to previous 1.25 (colored)

ENODEV is not a value supposed to be assigned to xs->error.  Use
XS_DRIVER_STUFFUP instead.

Revision 1.25 / (download) - annotate - [select for diffs], Wed Oct 6 05:01:05 1999 UTC (13 years, 8 months ago) by mjacob
Branch: MAIN
Changes since 1.24: +2 -2 lines
Diff to previous 1.24 (colored)

If we're discovering, don't tsleep on lbolt if we had a busy status.

Revision 1.24 / (download) - annotate - [select for diffs], Thu Sep 30 22:57:54 1999 UTC (13 years, 8 months ago) by thorpej
Branch: MAIN
Branch point for: wrstuden-devbsize
Changes since 1.23: +52 -36 lines
Diff to previous 1.23 (colored)

Cleanup the scsipi_xfer flags:
- `flags' is now gone, replaced with `xs_control' and `xs_status'.
- Massive cleanup of the control flags.  Now we explicitly say that
  a job is to complete asynchronously, rather than relying on side-effects,
  and use a new flag to now that device discovery is being performed.
- Do SCSI device discovery interrupt-driven.

Revision 1.23 / (download) - annotate - [select for diffs], Sat Sep 11 21:39:53 1999 UTC (13 years, 9 months ago) by thorpej
Branch: MAIN
Changes since 1.22: +19 -1 lines
Diff to previous 1.22 (colored)

Implement a function to kill off all commands pending for a given
scsipi_link.

Revision 1.22 / (download) - annotate - [select for diffs], Wed Jun 16 07:35:31 1999 UTC (14 years ago) by pk
Branch: MAIN
CVS Tags: chs-ubc2-base
Changes since 1.21: +5 -2 lines
Diff to previous 1.21 (colored)

In scsipi_done(), call scsipi_free_xs() at splbio().

Revision 1.21 / (download) - annotate - [select for diffs], Wed Apr 7 12:47:27 1999 UTC (14 years, 2 months ago) by bouyer
Branch: MAIN
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored)

Now that we do real use of CDIOCCLOSE, we can have SSS_START|SSS_LOEJ
in scsipi_start(). Adjust test so that timeout will let enouth time to
the drive to spin up.

Revision 1.20 / (download) - annotate - [select for diffs], Tue Feb 2 13:01:36 1999 UTC (14 years, 4 months ago) by bouyer
Branch: MAIN
CVS Tags: netbsd-1-4-base
Branch point for: netbsd-1-4
Changes since 1.19: +6 -2 lines
Diff to previous 1.19 (colored)

If sense_key == UNIT_ATTENTION and ASC/ASQ == "Power On, Reset, or Bus Device
Reset", retry the command instead of returning an error. XS_RESET is useless
without this, as the retryed command will die with this unit attention.

Revision 1.19 / (download) - annotate - [select for diffs], Fri Jan 29 11:17:59 1999 UTC (14 years, 4 months ago) by bouyer
Branch: MAIN
Changes since 1.18: +7 -3 lines
Diff to previous 1.18 (colored)

Return ENODEV instead of EIO when we are trying to open a device without media
in the drive. restrict "opening of empty drive" to character devices only
(reading a block device returns a short read instead of ENODEV, which can lead
to confusion).

Revision 1.18 / (download) - annotate - [select for diffs], Tue Jan 19 10:57:11 1999 UTC (14 years, 5 months ago) by bouyer
Branch: MAIN
Changes since 1.17: +4 -1 lines
Diff to previous 1.17 (colored)

Move test for SDEV_NOSTARTUNIT quirk from sd.c to scsipi_start().
Add a SDEV_NOSTARTUNIT quirk entry for BCD-16X 1997-04-25", "", "VER 2.2"
CD-rom (from Michael Santos).

Revision 1.17 / (download) - annotate - [select for diffs], Sun Jan 10 06:26:23 1999 UTC (14 years, 5 months ago) by mjacob
Branch: MAIN
Changes since 1.16: +3 -2 lines
Diff to previous 1.16 (colored)

Make the error condition of neither 0x70 or 0x71 error codes a tad
more informative than the lower case 'error code %d'.

Revision 1.16 / (download) - annotate - [select for diffs], Tue Dec 8 00:26:22 1998 UTC (14 years, 6 months ago) by thorpej
Branch: MAIN
CVS Tags: kenh-if-detach-base, kenh-if-detach
Changes since 1.15: +5 -11 lines
Diff to previous 1.15 (colored)

Actually, restructure scsipi_wait_drain() slightly.

Revision 1.15 / (download) - annotate - [select for diffs], Tue Dec 8 00:17:21 1998 UTC (14 years, 6 months ago) by thorpej
Branch: MAIN
Changes since 1.14: +31 -1 lines
Diff to previous 1.14 (colored)

- When allocating a scsipi_xfer, add it to the specified device's
  pending_xfers queue.
- When freeing a scsipi_xfer, remove it from the device's pending_xfers
  queue.  If the queue is empty, and SDEV_WAITDRAIN is set, wakeup
  those waiting for the queue to drain.
- Implement scsipi_wait_drain(), which waits for a device's pending_xfers
  queue to drain.

Revision 1.14 / (download) - annotate - [select for diffs], Thu Nov 19 20:08:52 1998 UTC (14 years, 7 months ago) by thorpej
Branch: MAIN
Changes since 1.13: +41 -2 lines
Diff to previous 1.13 (colored)

Add support for reference counting and enabling/disabling SCSI and
ATAPI controllers.  This will eventually be used for power management
of e.g. PCMCIA SCSI and IDE controller cards.

Revision 1.13 / (download) - annotate - [select for diffs], Tue Nov 17 14:38:42 1998 UTC (14 years, 7 months ago) by bouyer
Branch: MAIN
Changes since 1.12: +200 -2 lines
Diff to previous 1.12 (colored)

Rename scsi_interpret_sense() to scsipi_interpret_sense() and move it from
scsi_base.c to scsipi_base.c. Rename the functions from scsi_verbose.c
too, and rename the file itself. Cleaup includes too (scsi_*.h should not
be #included in scsipi_*.h files, which are supposed to be
common to atapi and scsi).

Revision 1.12 / (download) - annotate - [select for diffs], Sat Oct 10 03:42:53 1998 UTC (14 years, 8 months ago) by thorpej
Branch: MAIN
CVS Tags: chs-ubc-base, chs-ubc
Changes since 1.11: +12 -2 lines
Diff to previous 1.11 (colored)

If the adapter returned XS_RESET and the xfer specifies a retry count,
attempt to reissue the command (which was destroyed by the bus reset).

Slightly modified from PR #6090, from Matt Jacob.

Revision 1.11 / (download) - annotate - [select for diffs], Fri Sep 18 05:53:07 1998 UTC (14 years, 9 months ago) by scottr
Branch: MAIN
Changes since 1.10: +10 -23 lines
Diff to previous 1.10 (colored)

SCSI_ASYNCREQ turns out to be redundant; we can simply free the scsipi_xfer
in scsipi_done() if the transfer is asynchronous.  This reduces the size
of the critical section in scsipi_execute_xs() somewhat (in fact,
back to its original size).

Revision 1.10 / (download) - annotate - [select for diffs], Wed Sep 16 05:35:50 1998 UTC (14 years, 9 months ago) by scottr
Branch: MAIN
Changes since 1.9: +13 -2 lines
Diff to previous 1.9 (colored)

Found a race in scsipi_execute_xs():  if an asynchronous transfer completes
(probably due to an interrupt) between the time it is scheduled and the
time we get around to setting the SCSI_ASYNCREQ flag, we can lose the xs.

Fix this by checking to see if the transfer has already completed after
the scsi_cmd function returns SUCCESSFULLY_QUEUED, and just return to the
caller if so.

Revision 1.9 / (download) - annotate - [select for diffs], Mon Sep 14 05:49:21 1998 UTC (14 years, 9 months ago) by scottr
Branch: MAIN
Changes since 1.8: +24 -6 lines
Diff to previous 1.8 (colored)

Fix a problem uncovered when we started to use the pool allocator to manage
scsipi_xfer structures.

When scsipi_execute_xs() calls the driver's scsi_cmd function, it assumes
that it can still dereference a pointer to the scsipi_xfer struct.  Since
scsipi_done() has already been called, which in turn has called
scsipi_free_xs(), the struct has already been returned to the pool!  In
other words, xs->flags has been compromised, but we are still testing it.

These changes resolve the problem by doing the following:

- In scsipi_execute_xs(), if the lower-level driver's scsi_cmd function
  returns SUCCESSFULLY_QUEUED and SCSI_NOSLEEP is set in xs->flags, set a
  new flag (SCSI_ASYNCREQ).  This indicates that scsipi_done() should free
  the scsipi_xfer struct.

  If the lower-level driver's scsi_cmd function returns SUCCESSFULLY_QUEUED
  but SCSI_NOSLEEP is not set, we wait (via tsleep()) for the request to
  complete, then fall through to the COMPLETE case.

  If the lower-level driver's scsi_cmd function returns COMPLETE, we now
  simply return any actual errors, or 0 if none occurred.  (Previously,
  we may have returned EJUSTRETURN, of which the sole effect was to
  avoid freeing the scsipi_xfer struct in our caller.  No code seems
  to depend on this behavior, however.)

- In scsipi_done(), only free the scsipi_xfer struct for async requests.
  The contents of the struct will otherwise remain valid until the
  function that initiated the transfer frees it.

With this change, responsibility for freeing the struct now lies in two
places, depending on the type of the request:

- For synchronous requests, the routine calling scsipi_execute_xs()
  must clean up.

- For asynchronous requests, scsipi_done() cleans up (as it always has).

[Note:  this change also corrects a problem with sddump():  scsipi_done()
was attempting to return a static scsipi_xfer struct to the pool!  Since
dumps are performed synchronously, we now handle this correctly.]

This solution was provided by Jason Thorpe, after I got him to look at
some related (but insufficient) attempts of my own.

Revision 1.8 / (download) - annotate - [select for diffs], Sat Aug 15 10:10:57 1998 UTC (14 years, 10 months ago) by mycroft
Branch: MAIN
Changes since 1.7: +23 -20 lines
Diff to previous 1.7 (colored)

Assign my copyrights to TNF.

Revision 1.7 / (download) - annotate - [select for diffs], Tue Aug 11 05:47:43 1998 UTC (14 years, 10 months ago) by scottr
Branch: MAIN
Changes since 1.6: +6 -4 lines
Diff to previous 1.6 (colored)

Eliminate a potential (but not common) NULL dereference.

Revision 1.6 / (download) - annotate - [select for diffs], Fri Jul 31 03:00:51 1998 UTC (14 years, 10 months ago) by thorpej
Branch: MAIN
Changes since 1.5: +35 -17 lines
Diff to previous 1.5 (colored)

Use the pool allocator for scsipi_xfer structures.

Revision 1.5 / (download) - annotate - [select for diffs], Tue Feb 10 19:48:51 1998 UTC (15 years, 4 months ago) by thorpej
Branch: MAIN
CVS Tags: eeh-paddr_t-base
Branch point for: eeh-paddr_t
Changes since 1.4: +2 -1 lines
Diff to previous 1.4 (colored)

Clear the scsipi_xfer's status byte before executing the command.  This
fixes a condition where stale data can be left in the status byte, causing
user programs that interpret it to fail.

Fixes kern/4964 from Chris Jones <cjones@honors.montana.edu>.

Revision 1.4 / (download) - annotate - [select for diffs], Sat Oct 18 19:51:02 1997 UTC (15 years, 8 months ago) by thorpej
Branch: MAIN
CVS Tags: netbsd-1-3-base, netbsd-1-3-RELEASE, netbsd-1-3-PATCH003-CANDIDATE2, netbsd-1-3-PATCH003-CANDIDATE1, netbsd-1-3-PATCH003-CANDIDATE0, netbsd-1-3-PATCH003, netbsd-1-3-PATCH002, netbsd-1-3-PATCH001, netbsd-1-3-BETA, netbsd-1-3
Changes since 1.3: +8 -8 lines
Diff to previous 1.3 (colored)

Implement two macros, scsipi_command() and scsipi_command_direct(), and
use them to hide the structure of the function pointers we jump through
to issue a command.

Revision 1.3 / (download) - annotate - [select for diffs], Wed Oct 1 01:19:07 1997 UTC (15 years, 8 months ago) by enami
Branch: MAIN
CVS Tags: marc-pcmcia-base
Changes since 1.2: +65 -56 lines
Diff to previous 1.2 (colored)

Cosmetic changes to keep coding style consistency in this directory;

- Indent with tab of width 8.
- Use four column to indent continuation line.
- Fold long line if possible.
- Use return (xx) instead of return xx.
- Compare pointer against NULL instead of testing like boolean.
- Delete whitespace at the end of line.
- Delete whitespace in front of function call operator.
- Delete whitespace after cast.
- Dereference a pointer to function explicitly.
- Add an empty line after local variable declaration.
- Use NULL instead of (char *)0.
- Dont use block for single statement.

Revision 1.2 / (download) - annotate - [select for diffs], Wed Aug 27 11:26:50 1997 UTC (15 years, 9 months ago) by bouyer
Branch: MAIN
CVS Tags: thorpej-signal-base, thorpej-signal
Branch point for: marc-pcmcia
Changes since 1.1: +540 -0 lines
Diff to previous 1.1 (colored)

Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.

Revision 1.1, Tue Jul 1 16:52:33 1997 UTC (15 years, 11 months ago) by bouyer
Branch: MAIN
Branch point for: bouyer-scsipi
FILE REMOVED

file scsipi_base.c was initially added on branch bouyer-scsipi.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>