1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-25 11:37:56 +00:00
Mirror of the FreeBSD src repository https://git.FreeBSD.org/src.git .
Go to file
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
bin Honour the spirit rather than the implementation of the previous changes; 1998-10-22 21:42:20 +00:00
contrib "Fixed" a printf format error. Use bogus casts to avoid using %p so that 1998-10-17 16:14:00 +00:00
crypto Remove redundant decl. of time(). Causes problems on alpha 1998-09-01 15:17:28 +00:00
etc Some directories would like to install things into /modules 1998-10-17 01:21:35 +00:00
games Allow building games w/o an existing /usr/games. 1998-10-18 11:14:58 +00:00
gnu Fix paths. This sorts out the remaining p5-* port-creation hassles. 1998-10-17 07:10:43 +00:00
include make talk/talkd work on alpha. 1998-10-20 07:07:07 +00:00
kerberos5
kerberosIV Add -lcrypt. 1998-09-05 00:34:36 +00:00
lib Fix types. 1998-10-21 09:48:35 +00:00
libexec Set the user context correctly so that cd ~ does the right thing. 1998-10-13 20:42:01 +00:00
lkm config.c: 1998-10-21 08:32:32 +00:00
release This is a copyrighted software. I forgot to include the license here. 1998-10-22 11:16:41 +00:00
sbin list.c: 1998-10-21 08:39:57 +00:00
secure Remove useless `BINOWN=root' now that it is the default. 1998-09-19 22:42:14 +00:00
share FIxed a bogus comment. 1998-10-22 16:12:16 +00:00
sys Fix a problem with the way we handled device invalidation when attaching 1998-10-22 22:16:56 +00:00
tools Removed all `vector xxxintr' specifications. Interrupt handlers are now 1998-10-22 15:53:06 +00:00
usr.bin Fixed gratuitous unformatting in rev.1.8. 1998-10-22 18:17:30 +00:00
usr.sbin Removed all `vector xxxintr' specifications. Interrupt handlers are now 1998-10-22 15:53:06 +00:00
COPYRIGHT Add Id keyword 1998-09-13 23:11:13 +00:00
Makefile Restored all lost user targets that are supported by bsd.subdir.mk: 1998-10-17 15:25:26 +00:00
Makefile.inc0 Restored all lost user targets that are supported by bsd.subdir.mk: 1998-10-17 15:25:26 +00:00
Makefile.inc1 Don't add /usr/games to $PATH. Adding it here can only work for the 1998-10-17 11:56:20 +00:00
Makefile.upgrade 3.0-RELEASE and now the post-release 3.0-CURRENT were being declared 1998-10-17 05:40:46 +00:00
README Correct the facts. The kerberosIV/ directory is not export restricted. 1998-09-13 09:38:34 +00:00

This is the top level of the FreeBSD source directory.  This file
was last revised on: $Id: README,v 1.12 1998/06/30 08:08:05 jkh Exp $

For copyright information, please see the file COPYRIGHT in this
directory (additional copyright information also exists for some
sources in this tree - please see the specific source directories for
more information).

The Makefile in this directory supports a number of targets for
building components (or all) of the FreeBSD source tree, the most
commonly used one being ``world'', which rebuilds and installs
everything in the FreeBSD system from the source tree except the
kernel and the contents of /etc.  Please see the top of the Makefile
in this directory for more information on the standard build targets
and compile-time flags.

Building a kernel with config(8) is a somewhat more involved process,
documentation for which can be found at:
   http://www.freebsd.org/handbook/kernelconfig.html
And in the config(8) man page.

The sample kernel configuration files reside in the sys/i386/conf
sub-directory (assuming that you've installed the kernel sources), the
file named GENERIC being the one used to build your initial installation
kernel.  The file LINT contains entries for all possible devices, not
just those commonly used, and is meant more as a general reference
than an actual kernel configuration file (a kernel built from it
wouldn't even run).


Source Roadmap:
---------------
bin		System/User commands.

contrib		Packages contributed by 3rd parties.

crypto		Export controlled stuff (see crypto/README).

etc		Template files for /etc

games		Amusements.

gnu		Various commands and libraries under the GNU Public License.
		Please see gnu/COPYING* for more information.

include		System include files.

kerberosIV	Kerberos package.

lib		System libraries.

libexec		System daemons.

lkm		Loadable Kernel Modules.

release		Release building Makefile & associated tools.

sbin		System commands.

secure		DES and DES-related utilities - NOT FOR EXPORT!

share		Shared resources.

sys		Kernel sources.

tools		Utilities for regression testing and miscellaneous tasks.

usr.bin		User commands.

usr.sbin	System administration commands.


For information on synchronizing your source tree with one or more of
the FreeBSD Project's development branches, please see:

  http://www.freebsd.org/handbook/synching.html