Re: [PATCH net v2] net: mdio: mux-meson-g12a: keep the MAC data path when switching MDIO

From: Martin Blumenstingl

Date: Tue Nov 24 2026 - 15:50:57 EST


Hi Igor,

On Tue, Nov 17, 2026 at 1:54 AM Igor Velkov via B4 Relay
<devnull+iav.iav.lv@xxxxxxxxxx> wrote:
>
> From: Igor Velkov <iav@xxxxxx>
>
> Switching the mux to the internal MDIO bus writes SMI_SRC_MAC together
> 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 PHY the MAC attaches sits on the
> internal bus. Look the PHY up with fwnode_get_phy_node(), as stmmac
> does, so phy-handle and the deprecated phy and phy-device all count.
>
> Fixes: 7090425104db ("net: phy: add amlogic g12a mdio mux support")
> Signed-off-by: Igor Velkov <iav@xxxxxx>
sorry, I'm late to the party.

I have just reviewed Lucas patch [0] which adds Ethernet support for the T7 SoC.
He kept the internal MDIO mux path disabled by default, so boards
using it will have to enable it.
Have you tested that approach as well? If not: it would be great if
you could investigate the pros/cons of your approach vs. Lucas'
approach.


Best regards,
Martin


[0] https://lore.kernel.org/linux-amlogic/20261121213102.143130-1-tanure@xxxxxxxxx/T/#ma3b325147d6277c4d95dff83cf5bfcb75c1477d0