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)
Sat, Aug 23, 6:39 AM
Unknown Object (File)
Mon, Aug 18, 10:30 PM
Unknown Object (File)
Fri, Aug 15, 12:08 AM
Unknown Object (File)
Sat, Aug 2, 10:10 PM
Unknown Object (File)
Jul 25 2025, 1:26 AM
Unknown Object (File)
Jul 24 2025, 9:54 PM
Unknown Object (File)
Jul 24 2025, 5:20 PM
Unknown Object (File)
Jul 23 2025, 1:39 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 64077
Build 60961: arc lint + arc unit

Event Timeline

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