Page MenuHomeFreeBSD

for (generic) bus suspend, detach and shutdown iterate children in reverse order
ClosedPublic

Authored by avg on May 4 2018, 7:04 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 27, 11:24 AM
Unknown Object (File)
Sep 22 2024, 9:33 PM
Unknown Object (File)
Sep 22 2024, 1:30 PM
Unknown Object (File)
Sep 21 2024, 9:51 PM
Unknown Object (File)
Sep 21 2024, 3:54 PM
Unknown Object (File)
Sep 20 2024, 2:05 AM
Unknown Object (File)
Sep 10 2024, 3:44 AM
Unknown Object (File)
Sep 9 2024, 8:48 PM
Subscribers
None

Details

Summary

For most buses all children are equal, so the order does not matter.
Other buses, such as acpi, carefully order their child devices to express
implicit dependencies between them. For such buses it is safer to bring
down devices in the reverse order.

I believe that this is the reason why hpet_suspend had to be disabled.
Some drivers depend on a working event timer until they are suspended.
But previously we would suspend hpet very early.

Test Plan

Tested suspend/resume and shutdown.
Made hpet_suspend actually stop HPET timers and tested that too.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Thanks for the changes we talked about.

For the record, this is only a sliver of the ordering problem. There's more pervasive ordering issues on some platforms (A needs the services of B, so should attach strictly after and detach/shutdown/suspend strictly before). We have some other hacks to cope wit that.

Also, this ignores bus pass, which should have some influence on the order of the children as well, since acpi's child ordering pre-dates our bus passes.

Having said that, this is better than the situation today.

This revision is now accepted and ready to land.May 4 2018, 1:27 PM

This looks like a hack, but I have no real objections.

This revision was automatically updated to reflect the committed changes.