1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-25 11:37:56 +00:00
freebsd/sys
Kenneth D. Merry ee9c90c75c Fix a problem with the way we handled device invalidation when attaching
to a device failed.

In theory, the same steps that happen when we get an AC_LOST_DEVICE async
notification should have been taken when a driver fails to attach.  In
practice, that wasn't the case.

This only affected the da, cd and ch drivers, but the fix affects all
peripheral drivers.

There were several possible problems:
 - In the da driver, we didn't remove the peripheral's softc from the da
   driver's linked list of softcs.  Once the peripheral and softc got
   removed, we'd get a kernel panic the next time the timeout routine
   called dasendorderedtag().
 - In the da, cd and possibly ch drivers, we didn't remove the
   peripheral's devstat structure from the devstat queue.  Once the
   peripheral and softc were removed, this could cause a panic if anyone
   tried to access device statistics.  (one component of the linked list
   wouldn't exist anymore)
 - In the cd driver, we didn't take the peripheral off the changer run
   queue if it was scheduled to run.  In practice, it's highly unlikely,
   and maybe impossible that the peripheral would have been on the
   changer run queue at that stage of the probe process.

The fix is:
 - Add a new peripheral callback function (the "oninvalidate" function)
   that is called the first time cam_periph_invalidate() is called for a
   peripheral.

 - Create new foooninvalidate() routines for each peripheral driver.  This
   routine is always called at splsoftcam(), and contains all the stuff
   that used to be in the AC_LOST_DEVICE case of the async callback
   handler.

 - Move the devstat cleanup call to the destructor/cleanup routines, since
   some of the drivers do I/O in their close routines.

 - Make sure that when we're flushing the buffer queue, we traverse it at
   splbio().

 - Add a check for the invalid flag in the pt driver's open routine.

Reviewed by:	gibbs
1998-10-22 22:16:56 +00:00
..
alpha Decrement the now unused page table page's wire_count prior to freeing it. 1998-10-21 11:38:14 +00:00
amd64 Quote port names that have a digit in them. IO_TIMER1 was lexed as 1998-10-22 13:49:51 +00:00
boot PnP BIOS enumerator; mostly useful for hunting PnP devices that are supported 1998-10-22 20:25:06 +00:00
cam Fix a problem with the way we handled device invalidation when attaching 1998-10-22 22:16:56 +00:00
coda Fixes for lkm: 1998-09-29 20:19:45 +00:00
compat Fix a couple of out-of-bounds array references in mapping between 1998-10-11 04:54:16 +00:00
compile
conf Quote port names that have a digit in them. IO_TIMER1 was lexed as 1998-10-22 13:49:51 +00:00
contrib/softupdates Fix 'noatime' bug that was unrelated to use of noatime. 1998-10-03 19:17:11 +00:00
ddb Forgot to commit this; the alpha uses the kld symbol interface now. The 1998-10-15 02:01:50 +00:00
dev Initialize isa_devtab entries for interrupt handlers in individual 1998-10-22 05:58:45 +00:00
fs Fixes for lkm: 1998-09-29 20:19:45 +00:00
geom Update system to new device statistics code. 1998-09-15 08:15:30 +00:00
gnu Initialize earlier (ie: before npx) in case it makes any difference. 1998-10-18 07:44:33 +00:00
i386 Removed all `vector xxxintr' specifications. Interrupt handlers are now 1998-10-22 15:39:35 +00:00
isa Initialize isa_devtab entries for interrupt handlers in individual 1998-10-22 05:58:45 +00:00
isofs/cd9660 Remove the SLICE code. 1998-09-14 19:56:42 +00:00
kern Eliminate a superfluous comment. 1998-10-21 16:31:38 +00:00
libkern Converted rcsid to $Id$ again. There shouldn't be any rcsids in the kernel. 1998-08-17 19:26:37 +00:00
miscfs Make devfs update the atime timestamp so that 'w' works when using 1998-09-30 20:33:46 +00:00
modules Missed this file. 1998-10-16 04:31:35 +00:00
msdosfs Remove unused variable. 1998-09-13 15:40:31 +00:00
net Check the timeval passed to BIOCSRTIMEOUT with itimerfix. Use tvtohz() 1998-10-08 00:32:08 +00:00
netatalk Fixed printf format errors. 1998-08-17 01:05:25 +00:00
netatm Two patches from the HARP people: 1998-09-17 09:35:02 +00:00
netinet *gulp*. Jordan specifically OK'ed this.. 1998-10-16 03:55:01 +00:00
netipx Yow! Completely change the way socket options are handled, eliminating 1998-08-23 03:07:17 +00:00
netkey Fixed printf format errors. 1998-08-17 01:05:25 +00:00
netnatm This commit fixes various 64bit portability problems required for 1998-06-07 17:13:14 +00:00
netns
nfs In nfs_link(), check for a cross-device mount *before* looking 1998-09-29 23:39:37 +00:00
nfsclient In nfs_link(), check for a cross-device mount *before* looking 1998-09-29 23:39:37 +00:00
nfsserver The code checks each fragment mark to see if it's valid; if the fragment 1998-09-29 22:33:05 +00:00
pc98 Removed all `vector xxxintr' specifications. Interrupt handlers are now 1998-10-22 16:16:02 +00:00
pccard - Fix a bug where a "power_off_slot' timeout was not cancelled when the 1998-09-24 17:56:31 +00:00
pci Close PR #8409: 1998-10-22 16:46:26 +00:00
posix4 Set PAGE_SIZE for _SC_PAGESIZE sysconf(). 1998-06-01 21:54:43 +00:00
powerpc R_ALPHA_RELATIVE relocations need to add the value to the existing memory 1998-10-18 19:04:13 +00:00
rpc
sys post-tag version bump. We're now back at 3.0-current! 1998-10-16 06:55:07 +00:00
tools VOP_STRATEGY grows an (struct vnode *) argument 1998-07-04 20:45:42 +00:00
ufs Use only the correct raw partition for writing labels. Don't use the 1998-10-17 07:49:04 +00:00
vm Make the VM system handle the case where a terminating object contains 1998-10-22 02:16:53 +00:00
Makefile In src/Makefile.inc1: 1998-10-11 18:39:38 +00:00