Implement kern.do_async_attach. default disabled. To enable add
authorMatthew Dillon <dillon@dragonflybsd.org>
Tue, 1 May 2007 00:05:18 +0000 (00:05 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Tue, 1 May 2007 00:05:18 +0000 (00:05 +0000)
commitdbcd0c9b8a52c489e134c81386c900b1338da9e4
tree58e9d2aa4de5ca6b5b218eadfdf05437f2d41f5c
parent18170ab783a22f5071c8cb45f6f46c0f60b8918a
Implement kern.do_async_attach. default disabled.  To enable add
kern.do_async_attach="1" to your /boot/loader.conf.  This feature allows
conforming drivers to attach in their own thread, allowing multiple
drivers to attach in parallel.

Implement a new device state, DS_INPROGRESS.  Seems to work properly.
Implement device_set_async_attach(), which allows a device's probe
function to indicate that it is ok for its attach function to be run in
its own thread.

Split tsleep's enable out from the 'cold' variable. tsleep works earlier
then when cold is cleared.  Add a 'tsleep_now_works' variable to take
over the functionality.

Implement DRIVERSLEEP()... similar to DELAY(), this function works in
any context and will call lwkt_switch() in its spin loop.  It isn't perfect
yet.

ATA/NATA:
    * Uses the new async attach feature
    * Uses DRIVERSLEEP
    * No longer uses a configuration interrupt hook.  Interrupts are now
      available during device config.

    NOTE: atapicam does not seem to be scanning the 'bus' (from cam's point
    of view), so 'cd0' is not found until CAM scans the bus itself in the
    interrupt config hook code.

USB:
    * Uses the new async attach feature
    * Uses tsleep instead of DELAY

MISC:
    * IF_EM, IF_NFE also use the async attach feature as a test, but it
      doesn't seem to have a huge effect.
30 files changed:
sys/bus/cam/scsi/scsi_low.c
sys/bus/isa/isahint.c
sys/bus/isa/pnp.c
sys/bus/pci/i386/pcibus.c
sys/bus/usb/ehci_pci.c
sys/bus/usb/ohci_pci.c
sys/bus/usb/usb.c
sys/bus/usb/usb_subr.c
sys/dev/disk/ata/ata-all.c
sys/dev/disk/ata/ata-pci.c
sys/dev/disk/ata/atapi-cam.c
sys/dev/disk/nata/ata-all.c
sys/dev/disk/nata/atapi-cam.c
sys/dev/disk/sbp/sbp.c
sys/dev/misc/psm/psm.c
sys/dev/netif/em/if_em.c
sys/dev/netif/nfe/if_nfe.c
sys/kern/init_main.c
sys/kern/kern_synch.c
sys/kern/lwkt_thread.c
sys/kern/subr_bus.c
sys/platform/pc32/i386/autoconf.c
sys/platform/pc32/icu/icu_abi.c
sys/platform/pc32/isa/clock.c
sys/platform/vkernel/i386/autoconf.c
sys/platform/vkernel/platform/systimer.c
sys/sys/bus.h
sys/sys/bus_private.h
sys/sys/kernel.h
sys/sys/systm.h