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)
Dec 22 2023, 7:13 AM
Unknown Object (File)
Nov 9 2023, 1:18 PM
Unknown Object (File)
Nov 7 2023, 5:15 AM
Unknown Object (File)
Nov 6 2023, 9:08 PM
Unknown Object (File)
Oct 20 2023, 9:13 AM
Unknown Object (File)
Oct 19 2023, 11:26 PM
Unknown Object (File)
Oct 8 2023, 12:13 PM
Unknown Object (File)
Oct 6 2023, 4:16 AM
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.