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


Revision 1.189 / (download) - annotate - [select for diffs], Sat Apr 9 23:38:32 2022 UTC (9 months, 3 weeks ago) by riastradh
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10, bouyer-sunxi-drm-base, bouyer-sunxi-drm, HEAD
Changes since 1.188: +4 -4 lines
Diff to previous 1.188 (colored)

sys: Use membar_release/acquire around reference drop.

This just goes through my recent reference count membar audit and
changes membar_exit to membar_release and membar_enter to
membar_acquire -- this should make everything cheaper on most CPUs
without hurting correctness, because membar_acquire is generally
cheaper than membar_enter.

Revision 1.188 / (download) - annotate - [select for diffs], Sat Mar 12 15:32:32 2022 UTC (10 months, 3 weeks ago) by riastradh
Branch: MAIN
Changes since 1.187: +4 -2 lines
Diff to previous 1.187 (colored)

sys: Membar audit around reference count releases.

If two threads are using an object that is freed when the reference
count goes to zero, we need to ensure that all memory operations
related to the object happen before freeing the object.

Using an atomic_dec_uint_nv(&refcnt) == 0 ensures that only one
thread takes responsibility for freeing, but it's not enough to
ensure that the other thread's memory operations happen before the
freeing.

Consider:

	  Thread A			  Thread B
	obj->foo = 42;			obj->baz = 73;
	mumble(&obj->bar);		grumble(&obj->quux);
	/* membar_exit(); */		/* membar_exit(); */
	atomic_dec -- not last		atomic_dec -- last
					/* membar_enter(); */
					KASSERT(invariant(obj->foo,
					    obj->bar));
					free_stuff(obj);

The memory barriers ensure that

	obj->foo = 42;
	mumble(&obj->bar);

in thread A happens before

	KASSERT(invariant(obj->foo, obj->bar));
	free_stuff(obj);

in thread B.  Without them, this ordering is not guaranteed.

So in general it is necessary to do

	membar_exit();
	if (atomic_dec_uint_nv(&obj->refcnt) != 0)
		return;
	membar_enter();

to release a reference, for the `last one out hit the lights' style
of reference counting.  (This is in contrast to the style where one
thread blocks new references and then waits under a lock for existing
ones to drain with a condvar -- no membar needed thanks to mutex(9).)

I searched for atomic_dec to find all these.  Obviously we ought to
have a better abstraction for this because there's so much copypasta.
This is a stop-gap measure to fix actual bugs until we have that.  It
would be nice if an abstraction could gracefully handle the different
styles of reference counting in use -- some years ago I drafted an
API for this, but making it cover everything got a little out of hand
(particularly with struct vnode::v_usecount) and I ended up setting
it aside to work on psref/localcount instead for better scalability.

I got bored of adding #ifdef __HAVE_ATOMIC_AS_MEMBAR everywhere, so I
only put it on things that look performance-critical on 5sec review.
We should really adopt membar_enter_preatomic/membar_exit_postatomic
or something (except they are applicable only to atomic r/m/w, not to
atomic_load/store_*, making the naming annoying) and get rid of all
the ifdefs.

Revision 1.187 / (download) - annotate - [select for diffs], Thu Sep 17 01:19:41 2020 UTC (2 years, 4 months ago) by jakllsch
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-futex-base, thorpej-futex, thorpej-cfargs2-base, thorpej-cfargs2, thorpej-cfargs-base, thorpej-cfargs, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Changes since 1.186: +11 -11 lines
Diff to previous 1.186 (colored)

Some misspelling-in-comments fixes for scsipi

Revision 1.178.6.4 / (download) - annotate - [select for diffs], Tue Apr 21 18:42:38 2020 UTC (2 years, 9 months ago) by martin
Branch: phil-wifi
Changes since 1.178.6.3: +1 -4 lines
Diff to previous 1.178.6.3 (colored) to branchpoint 1.178 (colored) next main 1.179 (colored)

Sync with HEAD

Revision 1.185.4.1 / (download) - annotate - [select for diffs], Mon Apr 20 11:29:07 2020 UTC (2 years, 9 months ago) by bouyer
Branch: bouyer-xenpvh
Changes since 1.185: +3 -6 lines
Diff to previous 1.185 (colored) next main 1.186 (colored)

Sync with HEAD

Revision 1.178.6.3 / (download) - annotate - [select for diffs], Mon Apr 13 08:04:48 2020 UTC (2 years, 9 months ago) by martin
Branch: phil-wifi
Changes since 1.178.6.2: +5 -13 lines
Diff to previous 1.178.6.2 (colored) to branchpoint 1.178 (colored)

Mostly merge changes from HEAD upto 20200411

Revision 1.186 / (download) - annotate - [select for diffs], Mon Apr 13 00:27:17 2020 UTC (2 years, 9 months ago) by chs
Branch: MAIN
CVS Tags: phil-wifi-20200421, bouyer-xenpvh-base2, bouyer-xenpvh-base1
Changes since 1.185: +3 -6 lines
Diff to previous 1.185 (colored)

slightly change and fix the semantics of pool_set*wat(), pool_sethardlimit()
and pool_prime() (and their pool_cache_* counterparts):

 - the pool_set*wat() APIs are supposed to specify thresholds for the count of
   free items in the pool before pool pages are automatically allocated or freed
   during pool_get() / pool_put(), whereas pool_sethardlimit() and pool_prime()
   are supposed to specify minimum and maximum numbers of total items
   in the pool (both free and allocated).  these were somewhat conflated
   in the existing code, so separate them as they were intended.

 - change pool_prime() to take an absolute number of items to preallocate
   rather than an increment over whatever was done before, and wait for
   any memory allocations to succeed.  since pool_prime() can no longer fail
   after this, change its return value to void and adjust all callers.

 - pool_setlowat() is documented as not immediately attempting to allocate
   any memory, but it was changed some time ago to immediately try to allocate
   up to the lowat level, so just fix the manpage to describe the current
   behaviour.

 - add a pool_cache_prime() to complete the API set.

Revision 1.178.6.2 / (download) - annotate - [select for diffs], Wed Apr 8 14:08:12 2020 UTC (2 years, 9 months ago) by martin
Branch: phil-wifi
Changes since 1.178.6.1: +57 -8 lines
Diff to previous 1.178.6.1 (colored) to branchpoint 1.178 (colored)

Merge changes from current as of 20200406

Revision 1.184.2.1 / (download) - annotate - [select for diffs], Sat Feb 29 20:19:16 2020 UTC (2 years, 11 months ago) by ad
Branch: ad-namecache
Changes since 1.184: +57 -8 lines
Diff to previous 1.184 (colored) next main 1.185 (colored)

Sync with head.

Revision 1.185 / (download) - annotate - [select for diffs], Wed Feb 19 16:05:41 2020 UTC (2 years, 11 months ago) by riastradh
Branch: MAIN
CVS Tags: phil-wifi-20200411, phil-wifi-20200406, is-mlppp-base, is-mlppp, bouyer-xenpvh-base, ad-namecache-base3
Branch point for: bouyer-xenpvh
Changes since 1.184: +57 -8 lines
Diff to previous 1.184 (colored)

Sprinkle some dtrace probes into scsi(4).

Revision 1.182.4.1 / (download) - annotate - [select for diffs], Fri Jan 31 11:17:32 2020 UTC (3 years ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2
Changes since 1.182: +4 -4 lines
Diff to previous 1.182 (colored) next main 1.183 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #672):

	sys/dev/ic/tulip.c: revision 1.198
	sys/dev/pci/if_jme.c: revision 1.45
	sys/dev/pci/agp.c: revision 1.86
	sys/dev/pci/if_lii.c: revision 1.27
	sys/dev/acpi/thinkpad_acpi.c: revision 1.47
	sys/dev/scsipi/scsipi_base.c: revision 1.183
	sys/dev/ic/aic6915reg.h: revision 1.6

 Fix undefined behavior in thinkpad_mask_init(). Found by kUBSan.

 Use unsigned when initialize the transmit completion ring to avoid undefined
behavior. Found by kUBSan.

Avoid undefined behavior when setting multicast address. found by kUBSan.

 Use unsigned to avoid undefined behavior in agpattach(). Found by kUBSan.

 Avoid undefined behavior in jme_mii_write(). Found by kUBSan.

 Use unsigned to avoid undefined behavior in lii_setmulti().

 Use unsigned to avoid undefined behavior in scsipi_{get,put}_tag().

Found by kUBSan.

Revision 1.184 / (download) - annotate - [select for diffs], Sun Nov 10 21:16:37 2019 UTC (3 years, 2 months ago) by chs
Branch: MAIN
CVS Tags: phil-wifi-20191119, ad-namecache-base2, ad-namecache-base1, ad-namecache-base
Branch point for: ad-namecache
Changes since 1.183: +5 -13 lines
Diff to previous 1.183 (colored)

in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.

Revision 1.183 / (download) - annotate - [select for diffs], Thu Sep 19 03:37:31 2019 UTC (3 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.182: +4 -4 lines
Diff to previous 1.182 (colored)

 Use unsigned to avoid undefined behavior in scsipi_{get,put}_tag().
Found by kUBSan.

Revision 1.178.6.1 / (download) - annotate - [select for diffs], Mon Jun 10 22:07:32 2019 UTC (3 years, 7 months ago) by christos
Branch: phil-wifi
Changes since 1.178: +212 -6 lines
Diff to previous 1.178 (colored)

Sync with HEAD

Revision 1.182 / (download) - annotate - [select for diffs], Thu Mar 28 10:44:29 2019 UTC (3 years, 10 months ago) by kardel
Branch: MAIN
CVS Tags: phil-wifi-20190609, netbsd-9-base, netbsd-9-0-RC1, isaki-audio2-base, isaki-audio2
Branch point for: netbsd-9
Changes since 1.181: +201 -5 lines
Diff to previous 1.181 (colored)

Add reading of supported opcodes and their timeouts
at attachment time. Though this information is optional,
it allows to override our fixed timeouts with device
provided timeouts. These timeouts will override the
hardcoded values if the device provided timeouts
exceed the hardcoded values and are less than a day.

Using the device provided timeouts avoids premature
device resets and unreliable operation due to
inadequate timeouts.

Due to the limited implementations of USB
umass devices this feature is disabled for all
umass attached devices.

Revision 1.181 / (download) - annotate - [select for diffs], Tue Feb 5 11:11:32 2019 UTC (3 years, 11 months ago) by mrg
Branch: MAIN
Changes since 1.180: +4 -2 lines
Diff to previous 1.180 (colored)

avoid a fallthru checker complaint and make one case like the rest.  NFCI.

Revision 1.178.4.2 / (download) - annotate - [select for diffs], Mon Nov 26 01:52:47 2018 UTC (4 years, 2 months ago) by pgoyette
Branch: pgoyette-compat
CVS Tags: pgoyette-compat-merge-20190127
Changes since 1.178.4.1: +10 -2 lines
Diff to previous 1.178.4.1 (colored) to branchpoint 1.178 (colored) next main 1.179 (colored)

Sync with HEAD, resolve a couple of conflicts

Revision 1.180 / (download) - annotate - [select for diffs], Sat Nov 24 18:15:23 2018 UTC (4 years, 2 months ago) by bouyer
Branch: MAIN
CVS Tags: pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126
Changes since 1.179: +10 -2 lines
Diff to previous 1.179 (colored)

Add more KASSERTS about locking.

Revision 1.175.8.2 / (download) - annotate - [select for diffs], Fri Sep 7 12:21:13 2018 UTC (4 years, 4 months ago) by martin
Branch: netbsd-8
CVS Tags: netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1
Changes since 1.175.8.1: +7 -4 lines
Diff to previous 1.175.8.1 (colored) to branchpoint 1.175 (colored) next main 1.176 (colored)

Pull up following revision(s) (requested by mrg in ticket #1010):

	sys/dev/scsipi/scsipi_base.c: revision 1.178

Async event can be called before the adapter is running (pmax tc asc)

Revision 1.178.4.1 / (download) - annotate - [select for diffs], Thu Sep 6 06:56:04 2018 UTC (4 years, 4 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.178: +3 -3 lines
Diff to previous 1.178 (colored)

Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)

Revision 1.179 / (download) - annotate - [select for diffs], Mon Sep 3 16:29:33 2018 UTC (4 years, 4 months ago) by riastradh
Branch: MAIN
CVS Tags: pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906
Changes since 1.178: +3 -3 lines
Diff to previous 1.178 (colored)

Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int.  The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER!  Some subsystems have

	#define min(a, b)	((a) < (b) ? (a) : (b))
	#define max(a, b)	((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX.  Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate.  But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all.  (Who knows, maybe in some cases integer
truncation is actually intended!)

Revision 1.159.2.2 / (download) - annotate - [select for diffs], Sun Dec 3 11:37:32 2017 UTC (5 years, 1 month ago) by jdolecek
Branch: tls-maxphys
Changes since 1.159.2.1: +392 -219 lines
Diff to previous 1.159.2.1 (colored) to branchpoint 1.159 (colored) next main 1.160 (colored)

update from HEAD

Revision 1.164.2.5 / (download) - annotate - [select for diffs], Mon Aug 28 17:52:27 2017 UTC (5 years, 5 months ago) by skrll
Branch: nick-nhusb
Changes since 1.164.2.4: +26 -9 lines
Diff to previous 1.164.2.4 (colored) to branchpoint 1.164 (colored) next main 1.165 (colored)

Sync with HEAD

Revision 1.178.2.2 / (download) - annotate - [select for diffs], Fri Jul 14 17:50:12 2017 UTC (5 years, 6 months ago) by christos
Branch: perseant-stdc-iso10646
Changes since 1.178.2.1: +2678 -0 lines
Diff to previous 1.178.2.1 (colored) to branchpoint 1.178 (colored) next main 1.179 (colored)

2975092

Revision 1.178.2.1, Fri Jul 14 17:50:11 2017 UTC (5 years, 6 months ago) by christos
Branch: perseant-stdc-iso10646
Changes since 1.178: +0 -2678 lines
FILE REMOVED

file scsipi_base.c was added on branch perseant-stdc-iso10646 on 2017-07-14 17:50:12 +0000

Revision 1.178 / (download) - annotate - [select for diffs], Fri Jul 14 17:50:11 2017 UTC (5 years, 6 months ago) by christos
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202, phil-wifi-base, pgoyette-compat-base, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, perseant-stdc-iso10646-base, nick-nhusb-base-20170825, jdolecek-ncqfixes-base, jdolecek-ncqfixes
Branch point for: phil-wifi, pgoyette-compat, perseant-stdc-iso10646
Changes since 1.177: +7 -4 lines
Diff to previous 1.177 (colored)

Async event can be called before the adapter is running (pmax tc asc)

Revision 1.175.8.1 / (download) - annotate - [select for diffs], Wed Jun 21 18:18:55 2017 UTC (5 years, 7 months ago) by snj
Branch: netbsd-8
CVS Tags: netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, matt-nb8-mediatek-base, matt-nb8-mediatek
Changes since 1.175: +21 -7 lines
Diff to previous 1.175 (colored)

Pull up following revision(s) (requested by mlelstv in ticket #53):
	sys/dev/scsipi/atapiconf.c: revision 1.91
	sys/dev/scsipi/cd.c: revision 1.341
	sys/dev/scsipi/scsi_base.c: revision 1.92
	sys/dev/scsipi/scsiconf.c: revision 1.280
	sys/dev/scsipi/scsipi_base.c: revisions 1.176, 1.177
	sys/dev/scsipi/sd.c: revision 1.325
	sys/dev/scsipi/ss.c: revision 1.89
	sys/dev/scsipi/st.c: revision 1.231
The atapibus detach path did hold the channel mutex while calling into autoconf,
which would trigger a panic when unplugging a USB ATAPI CDROM.
Align detach code for scsibus and atapibus to fix this.
Also avoid races when detaching devices by replacing callout_stop with
callout_halt.
--
pass config_detach error to caller.

Revision 1.177 / (download) - annotate - [select for diffs], Mon Jun 19 20:52:20 2017 UTC (5 years, 7 months ago) by mlelstv
Branch: MAIN
Changes since 1.176: +4 -4 lines
Diff to previous 1.176 (colored)

pass config_detach error to caller.

Revision 1.176 / (download) - annotate - [select for diffs], Sat Jun 17 22:35:50 2017 UTC (5 years, 7 months ago) by mlelstv
Branch: MAIN
Changes since 1.175: +19 -5 lines
Diff to previous 1.175 (colored)

The atapibus detach path did hold the channel mutex while calling into autoconf,
which would trigger a panic when unplugging a USB ATAPI CDROM.

Align detach code for scsibus and atapibus to fix this.

Also avoid races when detaching devices by replacing callout_stop with
callout_halt.

Revision 1.164.2.4 / (download) - annotate - [select for diffs], Sun Feb 5 13:40:46 2017 UTC (5 years, 11 months ago) by skrll
Branch: nick-nhusb
Changes since 1.164.2.3: +81 -75 lines
Diff to previous 1.164.2.3 (colored) to branchpoint 1.164 (colored)

Sync with HEAD

Revision 1.165.2.2 / (download) - annotate - [select for diffs], Sat Jan 7 08:56:41 2017 UTC (6 years ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.165.2.1: +343 -213 lines
Diff to previous 1.165.2.1 (colored) to branchpoint 1.165 (colored) next main 1.166 (colored)

Sync with HEAD.  (Note that most of these changes are simply $NetBSD$
tag issues.)

Revision 1.175 / (download) - annotate - [select for diffs], Thu Dec 22 11:19:21 2016 UTC (6 years, 1 month ago) by mlelstv
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, nick-nhusb-base-20170204, netbsd-8-base, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Branch point for: netbsd-8
Changes since 1.174: +3 -3 lines
Diff to previous 1.174 (colored)

fix comment. request_sense is called unlocked.

Revision 1.174 / (download) - annotate - [select for diffs], Sun Dec 18 15:32:36 2016 UTC (6 years, 1 month ago) by skrll
Branch: MAIN
Changes since 1.173: +63 -63 lines
Diff to previous 1.173 (colored)

KNF

No functional change.

Revision 1.173 / (download) - annotate - [select for diffs], Sun Dec 18 15:27:34 2016 UTC (6 years, 1 month ago) by skrll
Branch: MAIN
Changes since 1.172: +3 -3 lines
Diff to previous 1.172 (colored)

Whitespace

Revision 1.172 / (download) - annotate - [select for diffs], Sun Dec 18 15:18:40 2016 UTC (6 years, 1 month ago) by skrll
Branch: MAIN
Changes since 1.171: +3 -2 lines
Diff to previous 1.171 (colored)

mlelstv accidentaly dropped a mutex_enter

Revision 1.171 / (download) - annotate - [select for diffs], Sun Dec 18 13:59:14 2016 UTC (6 years, 1 month ago) by mlelstv
Branch: MAIN
Changes since 1.170: +6 -10 lines
Diff to previous 1.170 (colored)

The mutex passed to cv_wait must also be held when calling cv_broadcast.
Also optimizing mutex handling in completion thread.

From nick@.

Revision 1.170 / (download) - annotate - [select for diffs], Fri Dec 16 15:00:52 2016 UTC (6 years, 1 month ago) by mlelstv
Branch: MAIN
Changes since 1.169: +13 -4 lines
Diff to previous 1.169 (colored)

Add locking for periph_active and flags. The operations aren't atomic.

Revision 1.164.2.3 / (download) - annotate - [select for diffs], Mon Dec 5 10:55:17 2016 UTC (6 years, 1 month ago) by skrll
Branch: nick-nhusb
Changes since 1.164.2.2: +274 -150 lines
Diff to previous 1.164.2.2 (colored) to branchpoint 1.164 (colored)

Sync with HEAD

Revision 1.169 / (download) - annotate - [select for diffs], Tue Nov 29 03:23:00 2016 UTC (6 years, 2 months ago) by mlelstv
Branch: MAIN
CVS Tags: nick-nhusb-base-20161204
Changes since 1.168: +4 -4 lines
Diff to previous 1.168 (colored)

reference count adapter mutex possibly shared by multiple channels.

fix error in atapibusdetach, when a child device cannot be detached,
keep atapibus instance alive.

Revision 1.168 / (download) - annotate - [select for diffs], Mon Nov 21 21:03:22 2016 UTC (6 years, 2 months ago) by mlelstv
Branch: MAIN
Changes since 1.167: +4 -4 lines
Diff to previous 1.167 (colored)

Lock is already taken when handling async events, don't lock again
in scsipi_lookup_periph.

Fixes PR kern/51641.

Revision 1.167 / (download) - annotate - [select for diffs], Sun Nov 20 15:37:19 2016 UTC (6 years, 2 months ago) by mlelstv
Branch: MAIN
Changes since 1.166: +272 -148 lines
Diff to previous 1.166 (colored)

Make scsipi framework MPSAFE.

Data structures are now protected by a per-adapter mutex at IPL_BIO
that is created by the scsibus or atapibus instance when the adapter
is configured.
The enable reference counter and the channel freeze counter which are
currently used by HBA code before the adapter is configured, are made
atomic.
The target drivers are now all tagged as D_MPSAFE.

Almost all HBA drivers still require the kernel lock to present,
so all callbacks into HBA code are still protected by kernel lock
unless the driver is tagged as SCSIPI_ADAPT_MPSAFE.

TODO: refactor sd and cd to use dksubr.

Revision 1.165.2.1 / (download) - annotate - [select for diffs], Fri Nov 4 14:49:15 2016 UTC (6 years, 2 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.165: +4 -4 lines
Diff to previous 1.165 (colored)

Sync with HEAD

Revision 1.164.2.2 / (download) - annotate - [select for diffs], Wed Oct 5 20:55:56 2016 UTC (6 years, 3 months ago) by skrll
Branch: nick-nhusb
Changes since 1.164.2.1: +4 -4 lines
Diff to previous 1.164.2.1 (colored) to branchpoint 1.164 (colored)

Sync with HEAD

Revision 1.166 / (download) - annotate - [select for diffs], Sun Oct 2 19:40:35 2016 UTC (6 years, 4 months ago) by jdolecek
Branch: MAIN
CVS Tags: pgoyette-localcount-20161104, nick-nhusb-base-20161004
Changes since 1.165: +4 -4 lines
Diff to previous 1.165 (colored)

change scsipi_execute_xs() to default to simple tags for !XS_CTL_URGENT
if not specified by caller; this is mostly for documentation purposes
only, as sd(4) and cd(4) explicitly use simple tags already

Revision 1.164.2.1 / (download) - annotate - [select for diffs], Tue Sep 22 12:06:00 2015 UTC (7 years, 4 months ago) by skrll
Branch: nick-nhusb
Changes since 1.164: +4 -2 lines
Diff to previous 1.164 (colored)

Sync with HEAD

Revision 1.165 / (download) - annotate - [select for diffs], Mon Aug 24 23:13:15 2015 UTC (7 years, 5 months ago) by pooka
Branch: MAIN
CVS Tags: pgoyette-localcount-base, pgoyette-localcount-20160806, pgoyette-localcount-20160726, nick-nhusb-base-20160907, nick-nhusb-base-20160529, nick-nhusb-base-20160422, nick-nhusb-base-20160319, nick-nhusb-base-20151226, nick-nhusb-base-20150921, localcount-20160914
Branch point for: pgoyette-localcount
Changes since 1.164: +4 -2 lines
Diff to previous 1.164 (colored)

would you like some freshly ground _KERNEL_OPT with that?
yes?  excellent choice, sir/madam.

Revision 1.160.2.1 / (download) - annotate - [select for diffs], Thu Mar 26 16:09:52 2015 UTC (7 years, 10 months ago) by martin
Branch: netbsd-7
CVS Tags: netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0
Changes since 1.160: +29 -5 lines
Diff to previous 1.160 (colored) next main 1.161 (colored)

Pull up the following revisions, requested by christos in #644:

	sys/dev/scsipi/scsipi_base.c	1.161 - 1.164

Use size for the size argument of memcmp, not the result of a compare.

PR/49054: Add a quirk for the ES-6600 RAID controller which does not do
INQUIRY3 properly. Unfortunately looking at the length does not solve
the problem since other devices send greater lengths too.

src is too big these days to tolerate superfluous apostrophes.  It's
"its", people!

PR/49054: Uwe Toenjes: Some RAID controllers return more bytes in the
scsi 3 inquiry command than expected by the size of the scsi 3 inquiry
packet. This can be detected by looking at the additional_length field
returned by the scsi 2 inquiry. If that's the case, avoid doing the
scsi 3 inquiry because we can't handle the extra bytes later.

Revision 1.164 / (download) - annotate - [select for diffs], Tue Nov 18 17:03:41 2014 UTC (8 years, 2 months ago) by joerg
Branch: MAIN
CVS Tags: nick-nhusb-base-20150606, nick-nhusb-base-20150406, nick-nhusb-base
Branch point for: nick-nhusb
Changes since 1.163: +3 -3 lines
Diff to previous 1.163 (colored)

Use size for the size argument of memcmp, not the result of a compare.

Revision 1.163 / (download) - annotate - [select for diffs], Mon Nov 17 18:43:48 2014 UTC (8 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.162: +25 -7 lines
Diff to previous 1.162 (colored)

PR/49054: Add a quirk for the ES-6600 RAID controller which does not do
INQUIRY3 properly. Unfortunately looking at the length does not solve
the problem since other devices send greater lengths too.

Revision 1.162 / (download) - annotate - [select for diffs], Sat Oct 18 08:33:28 2014 UTC (8 years, 3 months ago) by snj
Branch: MAIN
Changes since 1.161: +4 -4 lines
Diff to previous 1.161 (colored)

src is too big these days to tolerate superfluous apostrophes.  It's
"its", people!

Revision 1.161 / (download) - annotate - [select for diffs], Mon Oct 6 14:42:08 2014 UTC (8 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.160: +9 -3 lines
Diff to previous 1.160 (colored)

PR/49054: Uwe Toenjes: Some RAID controllers return more bytes in the
scsi 3 inquiry command than expected by the size of the scsi 3 inquiry
packet. This can be detected by looking at the additional_length field
returned by the scsi 2 inquiry. If that's the case, avoid doing the
scsi 3 inquiry because we can't handle the extra bytes later.
XXX: Pullup -7

Revision 1.159.2.1 / (download) - annotate - [select for diffs], Wed Aug 20 00:03:50 2014 UTC (8 years, 5 months ago) by tls
Branch: tls-maxphys
Changes since 1.159: +5 -5 lines
Diff to previous 1.159 (colored)

Rebase to HEAD as of a few days ago.

Revision 1.159.12.1 / (download) - annotate - [select for diffs], Sun Aug 10 06:54:58 2014 UTC (8 years, 5 months ago) by tls
Branch: tls-earlyentropy
Changes since 1.159: +5 -5 lines
Diff to previous 1.159 (colored) next main 1.160 (colored)

Rebase.

Revision 1.160 / (download) - annotate - [select for diffs], Sun Jul 13 17:12:23 2014 UTC (8 years, 6 months ago) by dholland
Branch: MAIN
CVS Tags: tls-maxphys-base, tls-earlyentropy-base, netbsd-7-base
Branch point for: netbsd-7
Changes since 1.159: +5 -5 lines
Diff to previous 1.159 (colored)

"peripheral", not "peripherial".

Revision 1.155.8.2 / (download) - annotate - [select for diffs], Wed May 23 10:08:05 2012 UTC (10 years, 8 months ago) by yamt
Branch: yamt-pagecache
CVS Tags: yamt-pagecache-tag8
Changes since 1.155.8.1: +8 -110 lines
Diff to previous 1.155.8.1 (colored) to branchpoint 1.155 (colored) next main 1.156 (colored)

sync with head.

Revision 1.155.12.2 / (download) - annotate - [select for diffs], Sun Apr 29 23:05:00 2012 UTC (10 years, 9 months ago) by mrg
Branch: jmcneill-usbmp
Changes since 1.155.12.1: +8 -110 lines
Diff to previous 1.155.12.1 (colored) to branchpoint 1.155 (colored) next main 1.156 (colored)

sync to latest -current.

Revision 1.155.14.1 / (download) - annotate - [select for diffs], Mon Apr 23 16:28:30 2012 UTC (10 years, 9 months ago) by riz
Branch: netbsd-6
CVS Tags: netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus
Changes since 1.155: +51 -30 lines
Diff to previous 1.155 (colored) next main 1.156 (colored)

Pull up following revision(s) (requested by bouyer in ticket #192):
	sys/dev/scsipi/cd.c: revision 1.307
	sys/dev/scsipi/scsiconf.c: revision 1.266
	sys/dev/scsipi/sd.c: revision 1.298
	sys/dev/scsipi/st_scsi.c: revision 1.35
	sys/dev/scsipi/atapiconf.c: revision 1.85
	sys/dev/scsipi/scsipiconf.h: revision 1.120
	sys/dev/usb/umass_scsipi.c: revision 1.44
	sys/dev/scsipi/scsiconf.h: revision 1.57
	sys/dev/scsipi/st_atapi.c: revision 1.29
	sys/dev/scsipi/scsipi_base.c: revision 1.158
	sys/dev/scsipi/st.c: revision 1.221
	sys/dev/scsipi/scsipi_ioctl.c: revision 1.67
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.159 / (download) - annotate - [select for diffs], Fri Apr 20 20:23:21 2012 UTC (10 years, 9 months ago) by bouyer
Branch: MAIN
CVS Tags: yamt-pagecache-base9, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, rmind-smpnet-nbase, rmind-smpnet-base, rmind-smpnet, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, khorben-n900, jmcneill-usbmp-base9, jmcneill-usbmp-base10, agc-symver-base, agc-symver
Branch point for: tls-maxphys, tls-earlyentropy
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 (10 years, 9 months 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 (10 years, 9 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.155.8.1 / (download) - annotate - [select for diffs], Tue Apr 17 00:08:02 2012 UTC (10 years, 9 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.155: +7 -2 lines
Diff to previous 1.155 (colored)

sync with head

Revision 1.155.12.1 / (download) - annotate - [select for diffs], Mon Feb 20 20:35:40 2012 UTC (10 years, 11 months ago) by mrg
Branch: jmcneill-usbmp
Changes since 1.155: +7 -2 lines
Diff to previous 1.155 (colored)

pullup from -current:
>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.156 / (download) - annotate - [select for diffs], Mon Feb 20 20:09:08 2012 UTC (10 years, 11 months 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.151.2.2 / (download) - annotate - [select for diffs], Sat Mar 5 20:54:05 2011 UTC (11 years, 11 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.151.2.1: +4 -5 lines
Diff to previous 1.151.2.1 (colored) to branchpoint 1.151 (colored) next main 1.152 (colored)

sync with head

Revision 1.155 / (download) - annotate - [select for diffs], Sat Nov 13 13:52:11 2010 UTC (12 years, 2 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.150.2.3 / (download) - annotate - [select for diffs], Fri Oct 22 07:22:14 2010 UTC (12 years, 3 months ago) by uebayasi
Branch: uebayasi-xip
Changes since 1.150.2.2: +2 -1 lines
Diff to previous 1.150.2.2 (colored) to branchpoint 1.150 (colored) next main 1.151 (colored)

Sync with HEAD (-D20101022).

Revision 1.146.4.5 / (download) - annotate - [select for diffs], Sat Oct 9 03:32:24 2010 UTC (12 years, 3 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.146.4.4: +4 -3 lines
Diff to previous 1.146.4.4 (colored) to branchpoint 1.146 (colored) next main 1.147 (colored)

sync with head

Revision 1.154 / (download) - annotate - [select for diffs], Mon Aug 23 20:01:16 2010 UTC (12 years, 5 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.150.2.2 / (download) - annotate - [select for diffs], Tue Aug 17 06:46:38 2010 UTC (12 years, 5 months ago) by uebayasi
Branch: uebayasi-xip
Changes since 1.150.2.1: +37 -43 lines
Diff to previous 1.150.2.1 (colored) to branchpoint 1.150 (colored)

Sync with HEAD.

Revision 1.146.4.4 / (download) - annotate - [select for diffs], Wed Aug 11 22:54:10 2010 UTC (12 years, 5 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.146.4.3: +39 -45 lines
Diff to previous 1.146.4.3 (colored) to branchpoint 1.146 (colored)

sync with head.

Revision 1.151.2.1 / (download) - annotate - [select for diffs], Sat Jul 3 01:19:40 2010 UTC (12 years, 7 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.151: +39 -45 lines
Diff to previous 1.151 (colored)

sync with head

Revision 1.153 / (download) - annotate - [select for diffs], Mon Jun 7 01:41:39 2010 UTC (12 years, 7 months 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 (12 years, 8 months 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.150.2.1 / (download) - annotate - [select for diffs], Fri Apr 30 14:43:49 2010 UTC (12 years, 9 months ago) by uebayasi
Branch: uebayasi-xip
Changes since 1.150: +4 -2 lines
Diff to previous 1.150 (colored)

Sync with HEAD.

Revision 1.146.4.3 / (download) - annotate - [select for diffs], Thu Mar 11 15:04:03 2010 UTC (12 years, 10 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.146.4.2: +4 -18 lines
Diff to previous 1.146.4.2 (colored) to branchpoint 1.146 (colored)

sync with head

Revision 1.151 / (download) - annotate - [select for diffs], Fri Feb 12 11:39:33 2010 UTC (12 years, 11 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 (13 years, 3 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.148.12.1 / (download) - annotate - [select for diffs], Wed May 13 17:21:23 2009 UTC (13 years, 8 months ago) by jym
Branch: jym-xensuspend
Changes since 1.148: +3 -2 lines
Diff to previous 1.148 (colored) next main 1.149 (colored)

Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.

Revision 1.146.4.2 / (download) - annotate - [select for diffs], Mon May 4 08:13:18 2009 UTC (13 years, 9 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.146.4.1: +3 -2 lines
Diff to previous 1.146.4.1 (colored) to branchpoint 1.146 (colored)

sync with head.

Revision 1.148.6.1 / (download) - annotate - [select for diffs], Tue Apr 28 07:36:33 2009 UTC (13 years, 9 months ago) by skrll
Branch: nick-hppapmap
Changes since 1.148: +3 -2 lines
Diff to previous 1.148 (colored) next main 1.149 (colored)

Sync with HEAD.

Revision 1.149 / (download) - annotate - [select for diffs], Tue Apr 7 18:10:45 2009 UTC (13 years, 9 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.147.2.1 / (download) - annotate - [select for diffs], Mon Jun 23 04:31:29 2008 UTC (14 years, 7 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.147: +5 -2 lines
Diff to previous 1.147 (colored) next main 1.148 (colored)

Sync w/ -current. 34 merge conflicts to follow.

Revision 1.145.28.1 / (download) - annotate - [select for diffs], Mon Jun 2 13:23:51 2008 UTC (14 years, 8 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.145: +8 -13 lines
Diff to previous 1.145 (colored) next main 1.146 (colored)

Sync with HEAD.

Revision 1.146.2.1 / (download) - annotate - [select for diffs], Sun May 18 12:34:45 2008 UTC (14 years, 8 months ago) by yamt
Branch: yamt-pf42
Changes since 1.146: +5 -9 lines
Diff to previous 1.146 (colored) next main 1.147 (colored)

sync with head.

Revision 1.146.4.1 / (download) - annotate - [select for diffs], Fri May 16 02:25:06 2008 UTC (14 years, 8 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.146: +5 -9 lines
Diff to previous 1.146 (colored)

sync with head.

Revision 1.148 / (download) - annotate - [select for diffs], Sun May 11 05:17:23 2008 UTC (14 years, 8 months 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-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, 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-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, 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 (14 years, 9 months 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 (14 years, 10 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.131.2.4 / (download) - annotate - [select for diffs], Mon Sep 3 14:38:39 2007 UTC (15 years, 5 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.131.2.3: +15 -28 lines
Diff to previous 1.131.2.3 (colored) to branchpoint 1.131 (colored) next main 1.132 (colored)

sync with head.

Revision 1.144.2.1 / (download) - annotate - [select for diffs], Wed Jul 11 20:08:17 2007 UTC (15 years, 6 months ago) by mjf
Branch: mjf-ufs-trans
Changes since 1.144: +14 -27 lines
Diff to previous 1.144 (colored) next main 1.145 (colored)

Sync with head.

Revision 1.145 / (download) - annotate - [select for diffs], Mon Jul 9 21:01:21 2007 UTC (15 years, 6 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.143.6.6 / (download) - annotate - [select for diffs], Sun Jul 1 21:48:58 2007 UTC (15 years, 7 months ago) by ad
Branch: vmlocking
Changes since 1.143.6.5: +3 -3 lines
Diff to previous 1.143.6.5 (colored) to branchpoint 1.143 (colored) next main 1.144 (colored)

Adapt to callout API change.

Revision 1.143.6.5 / (download) - annotate - [select for diffs], Sun May 13 17:36:28 2007 UTC (15 years, 8 months ago) by ad
Branch: vmlocking
Changes since 1.143.6.4: +3 -3 lines
Diff to previous 1.143.6.4 (colored) to branchpoint 1.143 (colored)

- Pass the error number and residual count to biodone(), and let it handle
  setting error indicators. Prepare to eliminate B_ERROR.
- Add a flag argument to brelse() to be set into the buf's flags, instead
  of doing it directly. Typically used to set B_INVAL.
- Add a "struct cpu_info *" argument to kthread_create(), to be used to
  create bound threads. Change "bool mpsafe" to "int flags".
- Allow exit of LWPs in the IDL state when (l != curlwp).
- More locking fixes & conversion to the new API.

Revision 1.143.6.4 / (download) - annotate - [select for diffs], Tue Apr 10 12:07:11 2007 UTC (15 years, 9 months ago) by ad
Branch: vmlocking
Changes since 1.143.6.3: +11 -24 lines
Diff to previous 1.143.6.3 (colored) to branchpoint 1.143 (colored)

Nuke the deferred kthread creation stuff, as it's no longer needed.
Pointed out by thorpej@.

Revision 1.143.6.3 / (download) - annotate - [select for diffs], Mon Apr 9 22:10:00 2007 UTC (15 years, 9 months ago) by ad
Branch: vmlocking
Changes since 1.143.6.2: +3 -3 lines
Diff to previous 1.143.6.2 (colored) to branchpoint 1.143 (colored)

- Add two new arguments to kthread_create1: pri_t pri, bool mpsafe.
- Fork kthreads off proc0 as new LWPs, not new processes.

Revision 1.143.6.2 / (download) - annotate - [select for diffs], Thu Apr 5 21:57:47 2007 UTC (15 years, 10 months ago) by ad
Branch: vmlocking
Changes since 1.143.6.1: +4 -4 lines
Diff to previous 1.143.6.1 (colored) to branchpoint 1.143 (colored)

Compile fixes.

Revision 1.143.2.1 / (download) - annotate - [select for diffs], Sat Mar 24 14:55:47 2007 UTC (15 years, 10 months ago) by yamt
Branch: yamt-idlelwp
Changes since 1.143: +3 -3 lines
Diff to previous 1.143 (colored) next main 1.144 (colored)

sync with head.

Revision 1.143.6.1 / (download) - annotate - [select for diffs], Tue Mar 13 16:50:31 2007 UTC (15 years, 10 months ago) by ad
Branch: vmlocking
Changes since 1.143: +3 -3 lines
Diff to previous 1.143 (colored)

Sync with head.

Revision 1.144 / (download) - annotate - [select for diffs], Mon Mar 12 18:18:31 2007 UTC (15 years, 10 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.131.2.3 / (download) - annotate - [select for diffs], Mon Feb 26 09:10:41 2007 UTC (15 years, 11 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.131.2.2: +4 -5 lines
Diff to previous 1.131.2.2 (colored) to branchpoint 1.131 (colored)

sync with head.

Revision 1.143 / (download) - annotate - [select for diffs], Fri Feb 9 21:55:29 2007 UTC (15 years, 11 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.135.8.6 / (download) - annotate - [select for diffs], Tue Feb 6 19:14:40 2007 UTC (15 years, 11 months ago) by ad
Branch: newlock2
Changes since 1.135.8.5: +3 -3 lines
Diff to previous 1.135.8.5 (colored) to branchpoint 1.135 (colored) next main 1.136 (colored)

Now that kthreads always run with kernel priority, don't rely on preempt()
to actually yield the CPU.

Revision 1.135.8.5 / (download) - annotate - [select for diffs], Tue Jan 30 13:51:39 2007 UTC (16 years ago) by ad
Branch: newlock2
Changes since 1.135.8.4: +3 -3 lines
Diff to previous 1.135.8.4 (colored) to branchpoint 1.135 (colored)

Remove support for SA. Ok core@.

Revision 1.135.8.4 / (download) - annotate - [select for diffs], Fri Jan 19 10:35:48 2007 UTC (16 years ago) by ad
Branch: newlock2
Changes since 1.135.8.3: +3 -3 lines
Diff to previous 1.135.8.3 (colored) to branchpoint 1.135 (colored)

Put back arg to preempt() for nwo.

Revision 1.135.8.3 / (download) - annotate - [select for diffs], Fri Jan 19 09:39:58 2007 UTC (16 years ago) by ad
Branch: newlock2
Changes since 1.135.8.2: +4 -5 lines
Diff to previous 1.135.8.2 (colored) to branchpoint 1.135 (colored)

Acquire proclist_mutex before sending signals.

Revision 1.135.8.2 / (download) - annotate - [select for diffs], Fri Jan 12 00:57:48 2007 UTC (16 years ago) by ad
Branch: newlock2
Changes since 1.135.8.1: +2 -96 lines
Diff to previous 1.135.8.1 (colored) to branchpoint 1.135 (colored)

Sync with head.

Revision 1.131.2.2 / (download) - annotate - [select for diffs], Sat Dec 30 20:49:34 2006 UTC (16 years, 1 month ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.131.2.1: +4 -54 lines
Diff to previous 1.131.2.1 (colored) to branchpoint 1.131 (colored)

sync with head.

Revision 1.137.2.2 / (download) - annotate - [select for diffs], Sun Dec 10 07:18:15 2006 UTC (16 years, 1 month ago) by yamt
Branch: yamt-splraiseipl
Changes since 1.137.2.1: +3 -97 lines
Diff to previous 1.137.2.1 (colored) to branchpoint 1.137 (colored) next main 1.138 (colored)

sync with head.

Revision 1.142 / (download) - annotate - [select for diffs], Sun Nov 26 05:01:09 2006 UTC (16 years, 2 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.135.8.1 / (download) - annotate - [select for diffs], Sat Nov 18 21:34:49 2006 UTC (16 years, 2 months ago) by ad
Branch: newlock2
Changes since 1.135: +49 -5 lines
Diff to previous 1.135 (colored)

Sync with head.

Revision 1.141 / (download) - annotate - [select for diffs], Thu Nov 16 01:33:26 2006 UTC (16 years, 2 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.137.2.1 / (download) - annotate - [select for diffs], Sun Oct 22 06:06:47 2006 UTC (16 years, 3 months ago) by yamt
Branch: yamt-splraiseipl
Changes since 1.137: +49 -5 lines
Diff to previous 1.137 (colored)

sync with head

Revision 1.140 / (download) - annotate - [select for diffs], Fri Oct 20 07:11:50 2006 UTC (16 years, 3 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 (16 years, 3 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 (16 years, 3 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 (16 years, 4 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 (16 years, 4 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.133.4.1 / (download) - annotate - [select for diffs], Sat Sep 9 02:54:25 2006 UTC (16 years, 4 months ago) by rpaulo
Branch: rpaulo-netinet-merge-pcb
Changes since 1.133: +17 -3 lines
Diff to previous 1.133 (colored) next main 1.134 (colored)

sync with head

Revision 1.131.2.1 / (download) - annotate - [select for diffs], Wed Jun 21 15:06:47 2006 UTC (16 years, 7 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.131: +18 -4 lines
Diff to previous 1.131 (colored)

sync with head.

Revision 1.134.6.1 / (download) - annotate - [select for diffs], Wed May 24 15:50:29 2006 UTC (16 years, 8 months ago) by tron
Branch: peter-altq
Changes since 1.134: +16 -2 lines
Diff to previous 1.134 (colored) next main 1.135 (colored)

Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.

Revision 1.134.2.1 / (download) - annotate - [select for diffs], Wed May 24 10:58:24 2006 UTC (16 years, 8 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.134: +16 -2 lines
Diff to previous 1.134 (colored) next main 1.135 (colored)

sync with head.

Revision 1.133.6.1 / (download) - annotate - [select for diffs], Sat Apr 22 11:39:29 2006 UTC (16 years, 9 months ago) by simonb
Branch: simonb-timecounters
CVS Tags: simonb-timcounters-final
Changes since 1.133: +17 -3 lines
Diff to previous 1.133 (colored) next main 1.134 (colored)

Sync with head.

Revision 1.134.4.1 / (download) - annotate - [select for diffs], Wed Apr 19 03:26:20 2006 UTC (16 years, 9 months ago) by elad
Branch: elad-kernelauth
Changes since 1.134: +16 -2 lines
Diff to previous 1.134 (colored) next main 1.135 (colored)

sync with head.

Revision 1.135 / (download) - annotate - [select for diffs], Mon Apr 17 14:30:40 2006 UTC (16 years, 9 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.133.2.1 / (download) - annotate - [select for diffs], Wed Mar 1 09:28:28 2006 UTC (16 years, 11 months ago) by yamt
Branch: yamt-uio_vmspace
Changes since 1.133: +3 -3 lines
Diff to previous 1.133 (colored) next main 1.134 (colored)

sync with head.

Revision 1.134 / (download) - annotate - [select for diffs], Mon Feb 20 16:50:37 2006 UTC (16 years, 11 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 (17 years, 1 month 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 (17 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.131: +2 -2 lines
Diff to previous 1.131 (colored)

merge ktrace-lwp.

Revision 1.88.2.11 / (download) - annotate - [select for diffs], Thu Nov 10 14:07:47 2005 UTC (17 years, 2 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.88.2.10: +7 -4 lines
Diff to previous 1.88.2.10 (colored) next main 1.89 (colored)

Sync with HEAD. Here we go again...

Revision 1.131 / (download) - annotate - [select for diffs], Tue May 31 02:56:54 2005 UTC (17 years, 8 months 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 (17 years, 8 months 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.123.2.1 / (download) - annotate - [select for diffs], Fri Apr 29 11:29:16 2005 UTC (17 years, 9 months ago) by kent
Branch: kent-audio2
Changes since 1.123: +59 -55 lines
Diff to previous 1.123 (colored) next main 1.124 (colored)

sync with -current

Revision 1.129 / (download) - annotate - [select for diffs], Mon Apr 4 11:26:50 2005 UTC (17 years, 10 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.123.4.1 / (download) - annotate - [select for diffs], Sat Mar 19 08:35:47 2005 UTC (17 years, 10 months ago) by yamt
Branch: yamt-km
Changes since 1.123: +56 -55 lines
Diff to previous 1.123 (colored) next main 1.124 (colored)

sync with head.  xen and whitespace.  xen part is not finished.

Revision 1.88.2.10 / (download) - annotate - [select for diffs], Fri Mar 4 16:50:33 2005 UTC (17 years, 11 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.88.2.9: +56 -55 lines
Diff to previous 1.88.2.9 (colored)

Sync with HEAD.

Hi Perry!

Revision 1.128 / (download) - annotate - [select for diffs], Sun Feb 27 00:27:48 2005 UTC (17 years, 11 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 (17 years, 11 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 (18 years ago) by reinoud
Branch: MAIN
CVS Tags: yamt-km-base2
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 (18 years 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 (18 years 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.88.2.9 / (download) - annotate - [select for diffs], Sat Dec 18 09:32:21 2004 UTC (18 years, 1 month ago) by skrll
Branch: ktrace-lwp
Changes since 1.88.2.8: +33 -8 lines
Diff to previous 1.88.2.8 (colored)

Sync with HEAD.

Revision 1.123 / (download) - annotate - [select for diffs], Tue Dec 7 23:14:03 2004 UTC (18 years, 1 month 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 (18 years, 2 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.88.2.8 / (download) - annotate - [select for diffs], Tue Oct 19 15:57:28 2004 UTC (18 years, 3 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.88.2.7: +5 -4 lines
Diff to previous 1.88.2.7 (colored)

Sync with HEAD

Revision 1.121 / (download) - annotate - [select for diffs], Fri Oct 1 03:39:11 2004 UTC (18 years, 4 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.88.2.7 / (download) - annotate - [select for diffs], Fri Sep 24 10:53:42 2004 UTC (18 years, 4 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.88.2.6: +9 -20 lines
Diff to previous 1.88.2.6 (colored)

Sync with HEAD.

Revision 1.88.2.6 / (download) - annotate - [select for diffs], Tue Sep 21 13:33:23 2004 UTC (18 years, 4 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.88.2.5: +2 -2 lines
Diff to previous 1.88.2.5 (colored)

Fix the sync with head I botched.

Revision 1.120 / (download) - annotate - [select for diffs], Sat Sep 18 18:49:50 2004 UTC (18 years, 4 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 (18 years, 4 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 (18 years, 4 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.88.2.5 / (download) - annotate - [select for diffs], Sat Sep 18 14:51:24 2004 UTC (18 years, 4 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.88.2.4: +110 -130 lines
Diff to previous 1.88.2.4 (colored)

Sync with HEAD.

Revision 1.117 / (download) - annotate - [select for diffs], Sat Sep 18 00:21:03 2004 UTC (18 years, 4 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 (18 years, 4 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 (18 years, 4 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 (18 years, 4 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 (18 years, 4 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.104.2.2 / (download) - annotate - [select for diffs], Sat Sep 11 12:53:16 2004 UTC (18 years, 4 months ago) by he
Branch: netbsd-2-0
CVS Tags: netbsd-2-base, netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE, netbsd-2
Changes since 1.104.2.1: +27 -17 lines
Diff to previous 1.104.2.1 (colored) to branchpoint 1.104 (colored) next main 1.105 (colored)

Pull up revisions 1.110-1.112 (via patch, requested by bouyer in ticket #837):
  Improve handling of memory shortage, to fix problems like:
    sd3(mpt0:0:1:0): unable to allocate scsipi_xfer
    sd3: not queued, error 12
  The theory is that other consumers of pool memory is causing
  this memory shortage in certain somewhat hard to reproduce
  situations.
  This is done by giving scsipi_command an extra argument to
  optionally pass a preallocated scsipi_xfer, and allocating a
  scsipi_xfer before dequeueing a buffer in the various *start()
  functions.  If the allocation of a scsipi_xfer fails, schedule
  a callout for delayed invocation of the start function.  Also
  reserve one page for scsipi_xfer structs, to ensure that we will
  eventually have some available once pending commands complete.
  Should fix PR#25670.

Revision 1.112 / (download) - annotate - [select for diffs], Thu Sep 9 19:35:31 2004 UTC (18 years, 4 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.88.2.4 / (download) - annotate - [select for diffs], Fri Sep 3 12:45:39 2004 UTC (18 years, 5 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.88.2.3: +8 -2 lines
Diff to previous 1.88.2.3 (colored)

Sync with HEAD

Revision 1.111 / (download) - annotate - [select for diffs], Thu Sep 2 12:39:56 2004 UTC (18 years, 5 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 (18 years, 5 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.88.2.3 / (download) - annotate - [select for diffs], Wed Aug 25 06:58:43 2004 UTC (18 years, 5 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.88.2.2: +106 -182 lines
Diff to previous 1.88.2.2 (colored)

Sync with HEAD.

Revision 1.109 / (download) - annotate - [select for diffs], Mon Aug 23 20:01:10 2004 UTC (18 years, 5 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 (18 years, 5 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 (18 years, 5 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.88.2.2 / (download) - annotate - [select for diffs], Thu Aug 12 11:42:05 2004 UTC (18 years, 5 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.88.2.1: +4 -7 lines
Diff to previous 1.88.2.1 (colored)

Sync with HEAD.

Revision 1.106 / (download) - annotate - [select for diffs], Wed Aug 4 22:25:45 2004 UTC (18 years, 6 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.88.2.1 / (download) - annotate - [select for diffs], Tue Aug 3 10:51:15 2004 UTC (18 years, 6 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.88: +94 -42 lines
Diff to previous 1.88 (colored)

Sync with HEAD

Revision 1.104.2.1 / (download) - annotate - [select for diffs], Thu Apr 29 04:24:41 2004 UTC (18 years, 9 months ago) by jmc
Branch: netbsd-2-0
Changes since 1.104: +3 -8 lines
Diff to previous 1.104 (colored)

Pullup rev 1.105 (requested by bouyer in ticket #214)

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.

Revision 1.105 / (download) - annotate - [select for diffs], Tue Apr 27 18:15:37 2004 UTC (18 years, 9 months 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 (18 years, 10 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 (18 years, 10 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 (18 years, 10 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 (19 years, 1 month 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 (19 years, 2 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 (19 years, 3 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 (19 years, 3 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 (19 years, 3 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 (19 years, 3 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 (19 years, 3 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 (19 years, 3 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 (19 years, 4 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 (19 years, 4 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 (19 years, 4 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 (19 years, 4 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 (19 years, 4 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 (19 years, 9 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 (19 years, 9 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 (19 years, 9 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 (19 years, 10 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 (20 years 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 (20 years 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.38.4.15 / (download) - annotate - [select for diffs], Wed Dec 11 06:38:47 2002 UTC (20 years, 1 month ago) by thorpej
Branch: nathanw_sa
CVS Tags: nathanw_sa_end
Changes since 1.38.4.14: +1 -1 lines
Diff to previous 1.38.4.14 (colored) to branchpoint 1.38 (colored) next main 1.39 (colored)

Sync with HEAD.

Revision 1.82 / (download) - annotate - [select for diffs], Sun Nov 24 11:52:13 2002 UTC (20 years, 2 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.38.4.14 / (download) - annotate - [select for diffs], Mon Nov 11 22:12:18 2002 UTC (20 years, 2 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.38.4.13: +2 -1 lines
Diff to previous 1.38.4.13 (colored) to branchpoint 1.38 (colored)

Catch up to -current

Revision 1.81 / (download) - annotate - [select for diffs], Sat Nov 9 19:02:27 2002 UTC (20 years, 2 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.38.4.13 / (download) - annotate - [select for diffs], Fri Oct 18 02:44:17 2002 UTC (20 years, 3 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.38.4.12: +4 -4 lines
Diff to previous 1.38.4.12 (colored) to branchpoint 1.38 (colored)

Catch up to -current.

Revision 1.48.2.9 / (download) - annotate - [select for diffs], Thu Oct 10 18:42:15 2002 UTC (20 years, 3 months ago) by jdolecek
Branch: kqueue
Changes since 1.48.2.8: +5 -2 lines
Diff to previous 1.48.2.8 (colored) next main 1.49 (colored)

sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work

Revision 1.80 / (download) - annotate - [select for diffs], Fri Oct 4 03:41:50 2002 UTC (20 years, 4 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 (20 years, 4 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.48.2.8 / (download) - annotate - [select for diffs], Fri Sep 6 08:46:24 2002 UTC (20 years, 5 months ago) by jdolecek
Branch: kqueue
Changes since 1.48.2.7: +3 -3 lines
Diff to previous 1.48.2.7 (colored)

sync kqueue branch with HEAD

Revision 1.73.2.3 / (download) - annotate - [select for diffs], Thu Aug 29 05:22:54 2002 UTC (20 years, 5 months ago) by gehenna
Branch: gehenna-devsw
Changes since 1.73.2.2: +3 -3 lines
Diff to previous 1.73.2.2 (colored) next main 1.74 (colored)

catch up with -current.

Revision 1.38.4.12 / (download) - annotate - [select for diffs], Thu Aug 1 02:45:44 2002 UTC (20 years, 6 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.38.4.11: +3 -3 lines
Diff to previous 1.38.4.11 (colored) to branchpoint 1.38 (colored)

Catch up to -current.

Revision 1.78 / (download) - annotate - [select for diffs], Fri Jul 26 14:11:34 2002 UTC (20 years, 6 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.48.2.7 / (download) - annotate - [select for diffs], Sun Jun 23 17:48:47 2002 UTC (20 years, 7 months ago) by jdolecek
Branch: kqueue
Changes since 1.48.2.6: +74 -44 lines
Diff to previous 1.48.2.6 (colored)

catch up with -current on kqueue branch

Revision 1.73.2.2 / (download) - annotate - [select for diffs], Thu Jun 20 16:34:07 2002 UTC (20 years, 7 months ago) by gehenna
Branch: gehenna-devsw
Changes since 1.73.2.1: +13 -9 lines
Diff to previous 1.73.2.1 (colored)

catch up with -current.

Revision 1.38.4.11 / (download) - annotate - [select for diffs], Thu Jun 20 03:46:38 2002 UTC (20 years, 7 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.38.4.10: +54 -36 lines
Diff to previous 1.38.4.10 (colored) to branchpoint 1.38 (colored)

Catch up to -current.

Revision 1.77 / (download) - annotate - [select for diffs], Wed Jun 5 00:15:33 2002 UTC (20 years, 8 months 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.75.2.1 / (download) - annotate - [select for diffs], Tue Jun 4 11:38:35 2002 UTC (20 years, 8 months ago) by lukem
Branch: netbsd-1-6
CVS Tags: netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1, netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001
Changes since 1.75: +3 -3 lines
Diff to previous 1.75 (colored) next main 1.76 (colored)

Pull up revision 1.76 (requested by bouyer in ticket #149):
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.76 / (download) - annotate - [select for diffs], Mon Jun 3 16:17:57 2002 UTC (20 years, 8 months 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.73.2.1 / (download) - annotate - [select for diffs], Thu May 30 14:47:19 2002 UTC (20 years, 8 months ago) by gehenna
Branch: gehenna-devsw
Changes since 1.73: +38 -25 lines
Diff to previous 1.73 (colored)

Catch up with -current.

Revision 1.75 / (download) - annotate - [select for diffs], Fri May 17 18:56:05 2002 UTC (20 years, 8 months 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 (20 years, 8 months 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 (20 years, 8 months 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 (20 years, 9 months 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.38.4.10 / (download) - annotate - [select for diffs], Wed Apr 17 00:06:12 2002 UTC (20 years, 9 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.38.4.9: +11 -6 lines
Diff to previous 1.38.4.9 (colored) to branchpoint 1.38 (colored)

Catch up to -current.

Revision 1.71 / (download) - annotate - [select for diffs], Mon Apr 1 20:37:42 2002 UTC (20 years, 10 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.38.4.9 / (download) - annotate - [select for diffs], Mon Apr 1 07:47:19 2002 UTC (20 years, 10 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.38.4.8: +12 -5 lines
Diff to previous 1.38.4.8 (colored) to branchpoint 1.38 (colored)

Catch up to -current.
(CVS: It's not just a program. It's an adventure!)

Revision 1.70 / (download) - annotate - [select for diffs], Thu Mar 28 22:01:22 2002 UTC (20 years, 10 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 (20 years, 10 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.48.2.6 / (download) - annotate - [select for diffs], Sat Mar 16 16:01:31 2002 UTC (20 years, 10 months ago) by jdolecek
Branch: kqueue
Changes since 1.48.2.5: +4 -4 lines
Diff to previous 1.48.2.5 (colored)

Catch up with -current.

Revision 1.68 / (download) - annotate - [select for diffs], Fri Mar 8 20:48:39 2002 UTC (20 years, 10 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.38.4.8 / (download) - annotate - [select for diffs], Thu Feb 28 04:14:22 2002 UTC (20 years, 11 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.38.4.7: +5 -5 lines
Diff to previous 1.38.4.7 (colored) to branchpoint 1.38 (colored)

Catch up to -current.

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

Fix broken indentation.

Revision 1.48.2.5 / (download) - annotate - [select for diffs], Mon Feb 11 20:10:12 2002 UTC (20 years, 11 months ago) by jdolecek
Branch: kqueue
Changes since 1.48.2.4: +4 -4 lines
Diff to previous 1.48.2.4 (colored)

Sync w/ -current.

Revision 1.66 / (download) - annotate - [select for diffs], Sat Jan 12 16:37:55 2002 UTC (21 years 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.48.2.4 / (download) - annotate - [select for diffs], Thu Jan 10 19:58:22 2002 UTC (21 years ago) by thorpej
Branch: kqueue
Changes since 1.48.2.3: +155 -28 lines
Diff to previous 1.48.2.3 (colored)

Sync kqueue branch with -current.

Revision 1.38.4.7 / (download) - annotate - [select for diffs], Tue Jan 8 00:31:50 2002 UTC (21 years ago) by nathanw
Branch: nathanw_sa
Changes since 1.38.4.6: +77 -6 lines
Diff to previous 1.38.4.6 (colored) to branchpoint 1.38 (colored)

Catch up to -current.

Revision 1.65 / (download) - annotate - [select for diffs], Wed Nov 28 01:04:49 2001 UTC (21 years, 2 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 (21 years, 2 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 (21 years, 2 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.38.4.6 / (download) - annotate - [select for diffs], Wed Nov 14 19:16:03 2001 UTC (21 years, 2 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.38.4.5: +4 -1 lines
Diff to previous 1.38.4.5 (colored) to branchpoint 1.38 (colored)

Catch up to -current.

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

add RCSIDs

Revision 1.38.4.5 / (download) - annotate - [select for diffs], Mon Oct 22 20:41:42 2001 UTC (21 years, 3 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.38.4.4: +39 -16 lines
Diff to previous 1.38.4.4 (colored) to branchpoint 1.38 (colored)

Catch up to -current.

Revision 1.61 / (download) - annotate - [select for diffs], Sun Oct 14 21:17:41 2001 UTC (21 years, 3 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 (21 years, 3 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 (21 years, 3 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.38.4.4 / (download) - annotate - [select for diffs], Mon Oct 8 20:11:28 2001 UTC (21 years, 3 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.38.4.3: +44 -14 lines
Diff to previous 1.38.4.3 (colored) to branchpoint 1.38 (colored)

Catch up to -current.

Revision 1.55.2.1 / (download) - annotate - [select for diffs], Mon Oct 1 12:46:21 2001 UTC (21 years, 4 months ago) by fvdl
Branch: thorpej-devvp
Changes since 1.55: +44 -14 lines
Diff to previous 1.55 (colored) next main 1.56 (colored)

Catch up with -current.

Revision 1.58 / (download) - annotate - [select for diffs], Thu Sep 27 18:11:06 2001 UTC (21 years, 4 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.38.4.3 / (download) - annotate - [select for diffs], Fri Sep 21 22:36:14 2001 UTC (21 years, 4 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.38.4.2: +2 -1 lines
Diff to previous 1.38.4.2 (colored) to branchpoint 1.38 (colored)

Catch up to -current.

Revision 1.57 / (download) - annotate - [select for diffs], Fri Sep 21 13:54:47 2001 UTC (21 years, 4 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 (21 years, 4 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.48.2.3 / (download) - annotate - [select for diffs], Thu Sep 13 01:16:11 2001 UTC (21 years, 4 months ago) by thorpej
Branch: kqueue
Changes since 1.48.2.2: +2 -1 lines
Diff to previous 1.48.2.2 (colored)

Update the kqueue branch to HEAD.

Revision 1.55 / (download) - annotate - [select for diffs], Sat Sep 1 00:54:38 2001 UTC (21 years, 5 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.48.2.2 / (download) - annotate - [select for diffs], Sat Aug 25 06:16:33 2001 UTC (21 years, 5 months ago) by thorpej
Branch: kqueue
Changes since 1.48.2.1: +5 -6 lines
Diff to previous 1.48.2.1 (colored)

Merge Aug 24 -current into the kqueue branch.

Revision 1.38.4.2 / (download) - annotate - [select for diffs], Fri Aug 24 00:10:48 2001 UTC (21 years, 5 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.38.4.1: +149 -46 lines
Diff to previous 1.38.4.1 (colored) to branchpoint 1.38 (colored)

Catch up with -current.

Revision 1.54 / (download) - annotate - [select for diffs], Mon Aug 20 11:20:51 2001 UTC (21 years, 5 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 (21 years, 5 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 (21 years, 5 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.48.2.1 / (download) - annotate - [select for diffs], Fri Aug 3 04:13:31 2001 UTC (21 years, 6 months ago) by lukem
Branch: kqueue
Changes since 1.48: +136 -42 lines
Diff to previous 1.48 (colored)

update to -current

Revision 1.51 / (download) - annotate - [select for diffs], Wed Jul 18 20:19:24 2001 UTC (21 years, 6 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 (21 years, 6 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 (21 years, 6 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 (21 years, 7 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 (21 years, 7 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 (21 years, 7 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.38.4.1 / (download) - annotate - [select for diffs], Thu Jun 21 20:05:54 2001 UTC (21 years, 7 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.38: +1848 -357 lines
Diff to previous 1.38 (colored)

Catch up to -current.

Revision 1.45 / (download) - annotate - [select for diffs], Wed Jun 13 18:17:42 2001 UTC (21 years, 7 months 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 (21 years, 8 months 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 (21 years, 8 months 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 (21 years, 8 months 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 (21 years, 8 months 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 (21 years, 9 months 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 (21 years, 9 months 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.26.2.17 / (download) - annotate - [select for diffs], Mon Apr 23 12:33:34 2001 UTC (21 years, 9 months ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.26.2.16: +2 -2 lines
Diff to previous 1.26.2.16 (colored) next main 1.27 (colored)

In channel completion thread, tsleep() at splbio, to avoid race condition
where scsipi_done would put something in the queue and wakeup between
splx(s) and tsleep().

Revision 1.26.2.16 / (download) - annotate - [select for diffs], Mon Apr 23 01:03:34 2001 UTC (21 years, 9 months ago) by mjacob
Branch: thorpej_scsipi
Changes since 1.26.2.15: +18 -1 lines
Diff to previous 1.26.2.15 (colored)

Don't let the chan_qfreeze count go negative.

It's possible that the adapters shouldn't do this. But if you think about
it, this is a function that could be called from anywhere. In any case,
the specific reason here was that there is *sometimes* one more Loop UP
message from QLogic FC cards than then Loop Down, so making the chan_qfreeze
go negative blocked the queue needlessly.

Add a splbio/splx around the test against XS_STS_DONE in scsipi_execute_xs
for the non-async case so we don't do the classic sleep after test crock.

Revision 1.26.2.15 / (download) - annotate - [select for diffs], Sun Apr 22 16:40:29 2001 UTC (21 years, 9 months ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.26.2.14: +12 -3 lines
Diff to previous 1.26.2.14 (colored)

Keep track of the number of commands per periph really sent to the adapter.
In scsipi_run_queue(), compare this to periph_openings instead of periph_active
When a drive reject all queued commands with QUEUE FULL (my IBM DDRS34560D
does this on large writes) we end up with all commands in the queue, and
periph_active > periph_openings.
While doing this I found a bug in scsipi_async_event_channel_reset(): calling
scsipi_done() would corrupt accounting.

Revision 1.26.2.14 / (download) - annotate - [select for diffs], Wed Apr 11 01:16:05 2001 UTC (21 years, 9 months ago) by mjacob
Branch: thorpej_scsipi
Changes since 1.26.2.13: +14 -4 lines
Diff to previous 1.26.2.13 (colored)

Make scsipi_channel_init a function returning an int- non-zero means
it failed to initialize the channel (this should be acceptable)- in
which case we complain and don't schedule bus probing for later.

We make the internal memory allocations for the periph and the chan_periphs
array M_NOWAIT- this way we have a hope of booting instead of silently hanging
during boot if we've run out of memory.

Revision 1.26.2.13 / (download) - annotate - [select for diffs], Tue Apr 3 15:27:18 2001 UTC (21 years, 10 months ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.26.2.12: +7 -2 lines
Diff to previous 1.26.2.12 (colored)

When we send a untagged command, block the queue until this command is
complete.

Revision 1.26.2.12 / (download) - annotate - [select for diffs], Wed Mar 28 09:39:40 2001 UTC (21 years, 10 months ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.26.2.11: +10 -2 lines
Diff to previous 1.26.2.11 (colored)

Better handling of errors for request sense commands.

Revision 1.26.2.11 / (download) - annotate - [select for diffs], Tue Mar 27 13:03:04 2001 UTC (21 years, 10 months ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.26.2.10: +2 -2 lines
Diff to previous 1.26.2.10 (colored)

Kill scsipi_link from comments.

Revision 1.26.2.10 / (download) - annotate - [select for diffs], Mon Jan 22 17:43:02 2001 UTC (22 years ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.26.2.9: +11 -1 lines
Diff to previous 1.26.2.9 (colored)

Don't forget to remove xfer from the channel's queue in
scsipi_async_event_channel_reset()
thaw the periph when request_sense failed(), and when calling user done,
as we're not going though the usual path.
Implement XS_REQUEUE, for drivers needing to requeue a xfer.

Revision 1.26.2.9 / (download) - annotate - [select for diffs], Mon Jan 15 09:22:12 2001 UTC (22 years ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.26.2.8: +175 -32 lines
Diff to previous 1.26.2.8 (colored)

Handle CHECK CONDITION status in mid-layer:
the REQUEST_SENSE command is generated from scsipi_complete() so it can
tsleep() (we use a regular scsipi_command() call for this). Add a new
periph_flag, PERIPH_SENSE, and a new xs_control, XS_CTL_REQSENSE.
When PERIPH_SENSE is set only xfer with XS_CTL_REQSENSE may be sent
(same logic as PERIPH_RECOVERING but with higther priority). xfer with
XS_CTL_REQSENSE need to have XS_CTL_URGENT urgent too.
XS_CTL_USERCMD xfers are now handled in scsipi_complete().

We need to pay special attention to SCSI resets, as we may have:
- an aborted REQUEST_SENSE. In this case we need to requeue the original
  command, not the request sense.
- sense pending for a command no longer in the queue but for which a
  request sense has not yet been queued. In this case we should not issue
  the request sense but requeue the original command instead.

For this:
- the xfer with the CHECK CONDITION status is stored in the scsipi_periph
  (periph_xscheck); the CHECK CONDITION is tested in scsipi_done, PERIPH_SENSE
  and periph_xscheck is set here.
- XS_CTL_REQSENSE xfers are not allowed to be requeued, and are terminated
  with EINTR in case of reset.
- we have a new async event, "ASYNC_EVENT_RESET", which cleanup the
  xfer in periph_xscheck.
- appropriate splbio/splx to avoid race condition (especially,
  scsipi_request_sense() runs at splbio. Should not be a real problem as it
  doesn't happen often.

While I'm there kill req_sense_length from struct scsipi_xfer, it's always set
to 0 and only checked by a few drivers.

Revision 1.26.2.8 / (download) - annotate - [select for diffs], Mon Nov 20 09:59:26 2000 UTC (22 years, 2 months ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.26.2.7: +34 -8 lines
Diff to previous 1.26.2.7 (colored)

Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

Main changes to the scsipi code itself:
- add a scsipi_channel->type to allow umass to attach to both atapibus and
  scsibus. Will die when IDE is converted from ata_atapi_attach to
  scsipi_channel/scsipi_adapter
- Add a chan_defquirks to scsipi_channel so that adapters can pass a default
  set of quirks to be set for each device attached
- add adapt_getgeom and adapt_accesschk callbacks

Revision 1.35.2.1 / (download) - annotate - [select for diffs], Thu Jun 22 17:08:14 2000 UTC (22 years, 7 months ago) by minoura
Branch: minoura-xpg4dl
Changes since 1.35: +6 -5 lines
Diff to previous 1.35 (colored) next main 1.36 (colored)

Sync w/ netbsd-1-5-base.

Revision 1.38 / (download) - annotate - [select for diffs], Fri Jun 9 08:54:24 2000 UTC (22 years, 7 months 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 (22 years, 8 months 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 (22 years, 8 months 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 (22 years, 8 months 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 (22 years, 10 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 (22 years, 10 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 (22 years, 10 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 (22 years, 10 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 (22 years, 10 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.26.2.7 / (download) - annotate - [select for diffs], Fri Feb 4 23:01:54 2000 UTC (23 years ago) by thorpej
Branch: thorpej_scsipi
Changes since 1.26.2.6: +72 -5 lines
Diff to previous 1.26.2.6 (colored)

Make sure the channel's completion thread exits when the channel
is detached, and completely encapsulate the way periph's are stored
by the channel.

Revision 1.20.2.4 / (download) - annotate - [select for diffs], Sun Jan 23 12:41:20 2000 UTC (23 years ago) by he
Branch: netbsd-1-4
CVS Tags: netbsd-1-4-PATCH003, netbsd-1-4-PATCH002
Changes since 1.20.2.3: +7 -6 lines
Diff to previous 1.20.2.3 (colored) to branchpoint 1.20 (colored) next main 1.21 (colored)

Pull up revision 1.29 (via patch, requested by bouyer):
  Use SCSIPIRETRIES instead of hard-coded value '2' for number of
  retries in common routines, and define it as 4 so that ATAPI
  command will succeed after several downgrade.

Revision 1.29 / (download) - annotate - [select for diffs], Mon Jan 17 17:59:48 2000 UTC (23 years 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.20.2.3 / (download) - annotate - [select for diffs], Sun Jan 16 17:49:42 2000 UTC (23 years ago) by he
Branch: netbsd-1-4
Changes since 1.20.2.2: +9 -1 lines
Diff to previous 1.20.2.2 (colored) to branchpoint 1.20 (colored)

Apply patch (requested by ad):
  When probing a SCSI target, do not report an error if the target
  indicates that LUNs are not supported.

Revision 1.28 / (download) - annotate - [select for diffs], Fri Jan 14 02:40:45 2000 UTC (23 years 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.24.2.1 / (download) - annotate - [select for diffs], Mon Dec 27 18:35:35 1999 UTC (23 years, 1 month ago) by wrstuden
Branch: wrstuden-devbsize
Changes since 1.24: +8 -9 lines
Diff to previous 1.24 (colored) next main 1.25 (colored)

Pull up to last week's -current.

Revision 1.20.2.1.4.1 / (download) - annotate - [select for diffs], Tue Nov 30 13:34:31 1999 UTC (23 years, 2 months ago) by itojun
Branch: kame
CVS Tags: kame_141_19991130
Changes since 1.20.2.1: +5 -2 lines
Diff to previous 1.20.2.1 (colored) next main 1.20.2.2 (colored)

bring in latest KAME (as of 19991130, KAME/NetBSD141) into kame branch
just for reference purposes.
This commit includes 1.4 -> 1.4.1 sync for kame branch.

The branch does not compile at all (due to the lack of ALTQ and some other
source code).  Please do not try to modify the branch, this is just for
referenre purposes.

synchronization to latest KAME will take place on HEAD branch soon.

Revision 1.26.4.1 / (download) - annotate - [select for diffs], Mon Nov 15 00:41:26 1999 UTC (23 years, 2 months ago) by fvdl
Branch: fvdl-softdep
Changes since 1.26: +7 -8 lines
Diff to previous 1.26 (colored) next main 1.27 (colored)

Sync with -current

Revision 1.26.2.6 / (download) - annotate - [select for diffs], Mon Nov 1 22:54:19 1999 UTC (23 years, 3 months ago) by thorpej
Branch: thorpej_scsipi
Changes since 1.26.2.5: +52 -42 lines
Diff to previous 1.26.2.5 (colored)

Fixup the SC_DEBUG() stuff for the new world order.

Revision 1.26.2.5 / (download) - annotate - [select for diffs], Tue Oct 26 23:08:06 1999 UTC (23 years, 3 months ago) by thorpej
Branch: thorpej_scsipi
Changes since 1.26.2.4: +86 -5 lines
Diff to previous 1.26.2.4 (colored)

Deal a little more gracefully with the fact that xfer mode parameters
are for the I_T Nexus, and make all xfer mode updates `async events'.

Revision 1.26.2.4 / (download) - annotate - [select for diffs], Wed Oct 20 22:50:47 1999 UTC (23 years, 3 months ago) by thorpej
Branch: thorpej_scsipi
Changes since 1.26.2.3: +7 -7 lines
Diff to previous 1.26.2.3 (colored)

Sync w/ trunk.

Revision 1.26.2.3 / (download) - annotate - [select for diffs], Wed Oct 20 20:38:14 1999 UTC (23 years, 3 months ago) by thorpej
Branch: thorpej_scsipi
Changes since 1.26.2.2: +72 -4 lines
Diff to previous 1.26.2.2 (colored)

Add channel freeze/thaw, and when a timed thaw occurs on either a
channel or periph, make sure to kick the channel queue.

Revision 1.27 / (download) - annotate - [select for diffs], Wed Oct 20 15:22:28 1999 UTC (23 years, 3 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.2.2 / (download) - annotate - [select for diffs], Tue Oct 19 21:04:27 1999 UTC (23 years, 3 months ago) by thorpej
Branch: thorpej_scsipi
Changes since 1.26.2.1: +32 -1 lines
Diff to previous 1.26.2.1 (colored)

Add an asynchronous event for the adapter to notify the midlayer that
xfer mode parameters have changed for an I_T Nexus.

Revision 1.26.2.1 / (download) - annotate - [select for diffs], Tue Oct 19 17:39:35 1999 UTC (23 years, 3 months ago) by thorpej
Branch: thorpej_scsipi
Changes since 1.26: +1242 -322 lines
Diff to previous 1.26 (colored)

Completely rewritten scsipi_xfer execution engine:
- 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).

There is a lot more work to do, but this correctly functions for the most
part on several file servers I run.

Revision 1.26 / (download) - annotate - [select for diffs], Sun Oct 17 06:13:01 1999 UTC (23 years, 3 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 (23 years, 4 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 (23 years, 4 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 (23 years, 4 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.20.2.2 / (download) - annotate - [select for diffs], Thu Jun 24 16:17:11 1999 UTC (23 years, 7 months ago) by perry
Branch: netbsd-1-4
CVS Tags: netbsd-1-4-PATCH001
Changes since 1.20.2.1: +5 -2 lines
Diff to previous 1.20.2.1 (colored) to branchpoint 1.20 (colored)

pullup 1.21->1.22 (pk): deal with missing "raise interrupt level" code

Revision 1.20.2.1.2.1 / (download) - annotate - [select for diffs], Mon Jun 21 01:19:12 1999 UTC (23 years, 7 months ago) by thorpej
Branch: chs-ubc2
Changes since 1.20.2.1: +5 -2 lines
Diff to previous 1.20.2.1 (colored) next main 1.20.2.2 (colored)

Sync w/ -current.

Revision 1.22 / (download) - annotate - [select for diffs], Wed Jun 16 07:35:31 1999 UTC (23 years, 7 months 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.20.2.1 / (download) - annotate - [select for diffs], Wed Apr 7 15:04:22 1999 UTC (23 years, 10 months ago) by bouyer
Branch: netbsd-1-4
CVS Tags: netbsd-1-4-RELEASE, kame_14_19990705, kame_14_19990628
Branch point for: kame, chs-ubc2
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored)

Pull up rev 1.21: fix timeout for SSS_START|SSS_LOEJ in scsipi_start().

Revision 1.21 / (download) - annotate - [select for diffs], Wed Apr 7 12:47:27 1999 UTC (23 years, 10 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 (24 years 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 (24 years 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 (24 years 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 (24 years 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 (24 years, 2 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 (24 years, 2 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 (24 years, 2 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 (24 years, 2 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 (24 years, 3 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 (24 years, 4 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 (24 years, 4 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 (24 years, 4 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 (24 years, 5 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 (24 years, 5 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.5.2.1 / (download) - annotate - [select for diffs], Sat Aug 8 03:06:51 1998 UTC (24 years, 6 months ago) by eeh
Branch: eeh-paddr_t
Changes since 1.5: +35 -17 lines
Diff to previous 1.5 (colored) next main 1.6 (colored)

Revert cdevsw mmap routines to return int.

Revision 1.6 / (download) - annotate - [select for diffs], Fri Jul 31 03:00:51 1998 UTC (24 years, 6 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 (24 years, 11 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 (25 years, 3 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.2.2.3 / (download) - annotate - [select for diffs], Tue Oct 14 10:25:17 1997 UTC (25 years, 3 months ago) by thorpej
Branch: marc-pcmcia
Changes since 1.2.2.2: +65 -56 lines
Diff to previous 1.2.2.2 (colored) to branchpoint 1.2 (colored) next main 1.3 (colored)

Update marc-pcmcia branch from trunk.

Revision 1.3 / (download) - annotate - [select for diffs], Wed Oct 1 01:19:07 1997 UTC (25 years, 4 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.2.2 / (download) - annotate - [select for diffs], Wed Aug 27 23:33:23 1997 UTC (25 years, 5 months ago) by thorpej
Branch: marc-pcmcia
Changes since 1.2.2.1: +540 -0 lines
Diff to previous 1.2.2.1 (colored) to branchpoint 1.2 (colored)

Update marc-pcmcia branch from trunk.

Revision 1.2.2.1, Wed Aug 27 11:26:50 1997 UTC (25 years, 5 months ago) by thorpej
Branch: marc-pcmcia
Changes since 1.2: +0 -540 lines
FILE REMOVED

file scsipi_base.c was added on branch marc-pcmcia on 1997-08-27 23:33:23 +0000

Revision 1.2 / (download) - annotate - [select for diffs], Wed Aug 27 11:26:50 1997 UTC (25 years, 5 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.2.2 / (download) - annotate - [select for diffs], Thu Aug 14 11:06:23 1997 UTC (25 years, 5 months ago) by bouyer
Branch: bouyer-scsipi
Changes since 1.1.2.1: +2 -2 lines
Diff to previous 1.1.2.1 (colored) next main 1.2 (colored)

Sync with trunk.

Revision 1.1.2.1 / (download) - annotate - [select for diffs], Tue Jul 1 16:52:34 1997 UTC (25 years, 7 months ago) by bouyer
Branch: bouyer-scsipi
Changes since 1.1: +540 -0 lines
Diff to previous 1.1 (colored)

New merged scsi/atapi code. Tested on i386 and sparc. Commiting to a branch
for now, so that it can be tested on other ports too.
The config sheme is as follow:
New merged scsi/atapi code. Tested on i386 and sparc. Commiting to a branch
for now, so that it can be tested on other ports too.
The config sheme is as follow:
scsibus at aha
sd at scsibus
cd at scsibus
atapibus at wdc
cd at atapibus
cd has bus-specific config and function front-end in scsicd.c and atapicd.c
The call to theses functions from cd.c is conditionned to
NSCSICD and NATAPICD (all defined in cd.h by config).

Revision 1.1, Tue Jul 1 16:52:33 1997 UTC (25 years, 7 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>