Skip to content

Commit b31f65f

Browse files
lunndavem330
authored andcommitted
net: dsa: slave: Fix autoneg for phys on switch MDIO bus
When the ports phys are connected to the switches internal MDIO bus, we need to connect the phy to the slave netdev, otherwise auto-negotiation etc, does not work. Signed-off-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5816c3d commit b31f65f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

net/dsa/slave.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,11 +489,14 @@ static void dsa_slave_phy_setup(struct dsa_slave_priv *p,
489489
/* We could not connect to a designated PHY, so use the switch internal
490490
* MDIO bus instead
491491
*/
492-
if (!p->phy)
492+
if (!p->phy) {
493493
p->phy = ds->slave_mii_bus->phy_map[p->port];
494-
else
494+
phy_connect_direct(slave_dev, p->phy, dsa_slave_adjust_link,
495+
p->phy_interface);
496+
} else {
495497
pr_info("attached PHY at address %d [%s]\n",
496498
p->phy->addr, p->phy->drv->name);
499+
}
497500
}
498501

499502
int dsa_slave_suspend(struct net_device *slave_dev)

0 commit comments

Comments
 (0)