Postpone the media state update to avoid DPMAC link toggling. Should fix https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279352.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Comment Actions
You'll have to explain WHY this is possibly fixing the problem. Usually deferred contexts are not the right solutions to fix ordering problems (if that's what it would be)?
Comment Actions
I'm not exactly sure this problem is about ordering, but rather a lack of proper MAC<->PHY link configuration. And the result of the improper configuration is the "dpaa2_ni_miibus_statchg" behavior I observed in dmesg_dpaa2_mii_trace_filtered.txt and dmesg_dpaa2_mii_trace2_filtered.txt. i.e.
[13357.646529] dpaa2_ni0: dpaa2_ni_miibus_statchg: miibus state: mii_media_status=1, mii_media_active=100026, ifm_media=0 [13357.646679] dpaa2_ni0: dpaa2_ni_miibus_statchg: miibus state: mii_media_status=3, mii_media_active=100036, ifm_media=0 [13357.655337] dpaa2_ni0: dpaa2_ni_miibus_statchg: miibus state: mii_media_status=3, mii_media_active=100130, ifm_media=0
which leads to the DPMAC link state toggling. I'm not sure why the PHY driver reports changes on the MII bus so quickly, but I don't think it's a good idea to call DPAA2_CMD_MAC_SET_LINK_STATE on each and every one of them. Hence 2s callout.