Thread (3 messages) flat view 3 messages, 2 authors, 2021-08-18
STALE1815d

[PATCH net-next] net: mscc: ocelot: Fix probe for vsc7514

From: Horatiu Vultur <horatiu.vultur@microchip.com>
Date: 2021-08-17 12:06:19
Also in: lkml
Subsystem: networking drivers, ocelot ethernet switch driver, the rest · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Vladimir Oltean, Linus Torvalds

The check for parsing the 'phy-handle' was removed in the blamed commit.
Therefor it would try to create phylinks for each port and connect to
the phys. But on ocelot_pcb123 and ocelot_pcb120 not all the ports have
a phy, so this will failed. So the probe of the network driver will
fail.

The fix consists in adding back the check for 'phy-handle' for vsc7514

Fixes: e6e12df625f2 ("net: mscc: ocelot: convert to phylink")
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
---
 drivers/net/ethernet/mscc/ocelot_vsc7514.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/mscc/ocelot_vsc7514.c b/drivers/net/ethernet/mscc/ocelot_vsc7514.c
index 18aed504f45d..96ac64f13382 100644
--- a/drivers/net/ethernet/mscc/ocelot_vsc7514.c
+++ b/drivers/net/ethernet/mscc/ocelot_vsc7514.c
@@ -954,6 +954,9 @@ static int mscc_ocelot_init_ports(struct platform_device *pdev,
 		if (of_property_read_u32(portnp, "reg", &reg))
 			continue;
 
+		if (!of_parse_phandle(portnp, "phy-handle", 0))
+			continue;
+
 		port = reg;
 		if (port < 0 || port >= ocelot->num_phys_ports) {
 			dev_err(ocelot->dev,
-- 
2.31.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help