Skip to content

Commit 08e3998

Browse files
chunkeeydavem330
authored andcommitted
net: emac: fix fixed-link setup for the RTL8363SB switch
On the Netgear WNDAP620, the emac ethernet isn't receiving nor xmitting any frames from/to the RTL8363SB (identifies itself as a RTL8367RB). This is caused by the emac hardware not knowing the forced link parameters for speed, duplex, pause, etc. This begs the question, how this was working on the original driver code, when it was necessary to set the phy_address and phy_map to 0xffffffff. But I guess without access to the old PPC405/440/460 hardware, it's not possible to know. Signed-off-by: Christian Lamparter <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e285d5b commit 08e3998

File tree

1 file changed

+10
-5
lines changed
  • drivers/net/ethernet/ibm/emac

1 file changed

+10
-5
lines changed

drivers/net/ethernet/ibm/emac/core.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2677,12 +2677,17 @@ static int emac_init_phy(struct emac_instance *dev)
26772677
if (of_phy_is_fixed_link(np)) {
26782678
int res = emac_dt_mdio_probe(dev);
26792679

2680-
if (!res) {
2681-
res = of_phy_register_fixed_link(np);
2682-
if (res)
2683-
mdiobus_unregister(dev->mii_bus);
2680+
if (res)
2681+
return res;
2682+
2683+
res = of_phy_register_fixed_link(np);
2684+
dev->phy_dev = of_phy_find_device(np);
2685+
if (res || !dev->phy_dev) {
2686+
mdiobus_unregister(dev->mii_bus);
2687+
return res ? res : -EINVAL;
26842688
}
2685-
return res;
2689+
emac_adjust_link(dev->ndev);
2690+
put_device(&dev->phy_dev->mdio.dev);
26862691
}
26872692
return 0;
26882693
}

0 commit comments

Comments
 (0)