NetBSD-Bugs archive

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

kern/59179: DVF_DETACH_SHUTDOWN: audit drivers for unnecessary use



>Number:         59179
>Category:       kern
>Synopsis:       DVF_DETACH_SHUTDOWN: audit drivers for unnecessary use
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Mar 15 20:35:00 +0000 2025
>Originator:     Taylor R Campbell
>Release:        current
>Organization:
The NotBeingShutDown Foundation
>Environment:
>Description:
Various drivers like ohci@pci have DVF_DETACH_SHUTDOWN set for no apparent reason.

The only reason to set it is if some kind of persistent storage must be synced, or some kind of resource must be released, in order for software and hardware to properly function.

It makes no sense to set it on a generic USB host controller interface driver, for example: there is no persistent state and no resources that need to be released before it can be shut down.  Individual USB drivers -- like sd(4) via umass(4) -- might reasonably use DVF_DETACH_SHUTDOWN (or a pmf shutdown hook) to sync persistent storage, but there is no reason for the HCI driver to do that.

And when the detach function, which is inevitably less well-tested (disappointing as that may be), is broken, that unnecessarily breaks shutdown on affected machines.
>How-To-Repeat:
shutdown on a machine with a broken driver detach routine
>Fix:
1. review all cases of DVF_DETACH_SHUTDOWN
2. for each case, write justification or nix it



Home | Main Index | Thread Index | Old Index