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
F158055043: D50294.id155275.diff
Thu, May 28, 12:36 AM
F158043210: D50294.id.diff
Wed, May 27, 9:04 PM
Unknown Object (File)
Tue, May 26, 1:00 PM
Unknown Object (File)
Mon, May 25, 12:13 PM
Unknown Object (File)
Fri, May 22, 7:08 AM
Unknown Object (File)
Sun, May 17, 2:13 PM
Unknown Object (File)
Sun, May 17, 7:14 AM
Unknown Object (File)
Sun, May 17, 3:28 AM
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