tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: What is the point of DVF_DETACH_SHUTDOWN?



thorpej%me.com@localhost (Jason Thorpe) writes:

>Can someone please explain to me what the point of DVF_DETACH_SHUTDOWN is?  It seems incredibly misguided.

sys/device.h 1.117 explains it.

| During shutdown, detach devices in an orderly fashion.
| 
| Call the detach routine for every device in the device tree, starting
| with the leaves and moving toward the root, expecting that each
| (pseudo-)device driver will use the opportunity to gracefully commit
| outstandings transactions to the underlying (pseudo-)device and to
| relinquish control of the hardware to the system BIOS.
| 
| Detaching devices is not suitable for every shutdown: in an emergency,
| or if the system state is inconsistent, we should resort to a fast,
| simple shutdown that uses only the pmf(9) shutdown hooks and the
| (deprecated) shutdownhooks.  For now, if the flag RB_NOSYNC is set in
| boothowto, opt for the fast, simple shutdown.
| 
| Add a device flag, DVF_DETACH_SHUTDOWN, that indicates by its presence
| that it is safe to detach a device during shutdown. ...

N.B. devices can be detached with drvctl but also reject detachment,
e.g. when busy.

-- 
-- 
                                Michael van Elst
Internet: mlelstv%serpens.de@localhost
                                "A potential Snark may lurk in every tree."


Home | Main Index | Thread Index | Old Index