Skip to content

Commit d8dcf5b

Browse files
arinc9Paolo Abeni
authored andcommitted
net: dsa: mt7530: detect PHY muxing when PHY is defined on switch MDIO bus
Currently, the MT7530 DSA subdriver configures the MT7530 switch to provide direct access to switch PHYs, meaning, the switch PHYs listen on the MDIO bus the switch listens on. The PHY muxing feature makes use of this. This is problematic as the PHY may be attached before the switch is initialised, in which case, the PHY will fail to be attached. Since commit 91374ba ("net: dsa: mt7530: support OF-based registration of switch MDIO bus"), we can describe the switch PHYs on the MDIO bus of the switch on the device tree. Extend the check to detect PHY muxing when the PHY is defined on the MDIO bus of the switch on the device tree. When the PHY is described this way, the switch will be initialised first, then the switch MDIO bus will be registered. Only after these steps, the PHY will be attached. Signed-off-by: Arınç ÜNAL <[email protected]> Reviewed-by: Daniel Golle <[email protected]> Link: https://lore.kernel.org/r/20240430-b4-for-netnext-mt7530-use-switch-mdio-bus-for-phy-muxing-v2-1-9104d886d0db@arinc9.com Signed-off-by: Paolo Abeni <[email protected]>
1 parent 7b67baf commit d8dcf5b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/dsa/mt7530.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2484,7 +2484,8 @@ mt7530_setup(struct dsa_switch *ds)
24842484
if (!phy_node)
24852485
continue;
24862486

2487-
if (phy_node->parent == priv->dev->of_node->parent) {
2487+
if (phy_node->parent == priv->dev->of_node->parent ||
2488+
phy_node->parent->parent == priv->dev->of_node) {
24882489
ret = of_get_phy_mode(mac_np, &interface);
24892490
if (ret && ret != -ENODEV) {
24902491
of_node_put(mac_np);

0 commit comments

Comments
 (0)