Re: [PATCH net] net: mdio: mux-meson-g12a: keep the MAC data path when switching MDIO
From: Paolo Abeni
Date: Thu Nov 19 2026 - 05:42:07 EST
On 11/15/26 20:22, Igor Velkov wrote:
Switching the mux to the internal MDIO bus writes SMI_SRC_MAC togetherNot that this 'broken since introduction' H/W setup does not qualify
with USE_INTERNAL and RX_CLK_EPHY to ETH_PHY_CNTL2. The last two move the
MAC data path and RX clock to the internal PHY. On boards whose MAC uses
an external PHY, any access to the internal PHY stops reception until an
access to the external bus switches the mux back.
phylib suspends and resumes the unattached internal PHY across system
sleep. stmmac sets mac_managed_pm, and with Wake-on-LAN in the MAC
phylink_resume() does not start the external PHY, so nothing switches
the mux back. On ODROID-HC4 (RTL8211F), after suspend-to-RAM with WoL in
the MAC and an RTC wakeup, ETH_PHY_CNTL2 stays at 0x260 and the MAC
receives nothing while TX works.
With the MAC on the external PHY, SMI_SRC_MAC alone is enough to read
the internal PHY ID (0x0180/0x3301) while RX keeps running; adding
USE_INTERNAL or RX_CLK_EPHY stops RX.
Set the data path bits only when the MAC's phy-handle names a PHY on
the internal bus. As in dwmac-rk, which reads phy-is-integrated from
that node, the node phy-handle names decides; here it is the mux bus
the PHY sits on.
Fixes: 7090425104db ("net: phy: add amlogic g12a mdio mux support")
Signed-off-by: Igor Velkov <iav@xxxxxx>
anymore as 'net' material. I'm applying this to 'net-next'
/P