mirror of
https://github.com/openwrt/openwrt.git
synced 2026-10-13 06:48:43 +04:00
Commit9091c9f8cb("ath79: mikrotik: compile SWCONFIG and AR8216_PHY as modules") caused the hybrid PHY/MDIO ar8xxx driver to be built as a module instead of built-in. On at least MikroTik RouterBOARD 951G-2HnD, this prevents the kernel from binding the correct PHY driver at boot because the ar8xxx driver is not yet available when the MDIO bus is probed: - before: ag71xx-legacy 19000000.eth: invalid MAC address, using random address switch0: Atheros AR8327 rev. 4 switch registered on mdio.0 ag71xx-legacy 19000000.eth: connected to PHY at mdio.0:00 [uid=004dd034, driver=Atheros AR8216/AR8236/AR8316] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode: rgmii - after: ag71xx-legacy 19000000.eth: invalid MAC address, using random address ag71xx-legacy 19000000.eth: connected to PHY at mdio.0:00 [uid=004dd034, driver=Generic PHY] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode: rgmii As the PHY is already bound to the fallback "Generic PHY" driver when the ar8xxx module is loaded, the switch remains non-functional and the router has no network connectivity. Fix by also compiling the MAC driver (ag71xx-legacy) as a module, deferring switch initialization until control is transferred to userspace during boot. The configured module autoload priorities (ar8xxx: 43, ag71xx-legacy: 50) ensure that the ar8xxx driver is loaded before ag71xx-legacy. Fixes: https://github.com/openwrt/openwrt/issues/23739 Fixes:9091c9f8cb("ath79: mikrotik: compile SWCONFIG and AR8216_PHY as modules") Suggested-by: Daniel Golle <daniel@makrotopia.org> Signed-off-by: Michał Kępień <openwrt@kempniu.pl> Link: https://github.com/openwrt/openwrt/pull/23748 Signed-off-by: Robert Marko <robimarko@gmail.com> (cherry picked from commit12abb2413a) Link: https://github.com/openwrt/openwrt/pull/23833 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>