Page MenuHomeFreeBSD

e6000sw: fix bus ordering; don't panic if miibus devices are destroyed
ClosedPublic

Authored by adrian on May 11 2025, 2:35 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jun 12, 12:14 PM
Unknown Object (File)
Mon, Jun 9, 1:10 AM
Unknown Object (File)
Sun, Jun 8, 5:58 AM
Unknown Object (File)
Sat, Jun 7, 7:53 PM
Unknown Object (File)
Sat, Jun 7, 9:54 AM
Unknown Object (File)
Fri, Jun 6, 12:57 PM
Unknown Object (File)
Fri, Jun 6, 5:32 AM
Unknown Object (File)
Thu, Jun 5, 3:52 PM
Subscribers

Details

Summary

Unloading the e6000sw driver with a "fixed" ixgbe (which is doing
MDIO transfers faster than 8ms per) has exposed another fun race
condition - the MII busses were being torn down before the etherswitch
device.

  • Modify e6000sw_miiforphy() to return NULL if the mii bus device isn't setup, which stops the panic
  • Change the module order so the e6000sw module is detached first, before the miibus entries and attached PHYs are destroyed. This ensures that the miibus entries aren't destroyed outside of the driver lock, and e6000sw_tick() doesn't try dereferencing dead miibus device_t's.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.May 14 2025, 1:11 PM