Commit f2aea90d authored by David S. Miller's avatar David S. Miller

Merge branch 'ocelot-phylink-fixes'

Vladimir Oltean says:

====================
Ocelot phylink fixes

This series addresses a regression reported by Horatiu which introduced
by the ocelot conversion to phylink: there are broken device trees in
the wild, and the driver fails to probe the entire switch when a port
fails to probe, which it previously did not do.

Continue probing even when some ports fail to initialize properly.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 42edc1fc 5c8bb71d
...@@ -164,6 +164,7 @@ int ocelot_port_devlink_init(struct ocelot *ocelot, int port, ...@@ -164,6 +164,7 @@ int ocelot_port_devlink_init(struct ocelot *ocelot, int port,
struct devlink *dl = ocelot->devlink; struct devlink *dl = ocelot->devlink;
struct devlink_port_attrs attrs = {}; struct devlink_port_attrs attrs = {};
memset(dlp, 0, sizeof(*dlp));
memcpy(attrs.switch_id.id, &ocelot->base_mac, id_len); memcpy(attrs.switch_id.id, &ocelot->base_mac, id_len);
attrs.switch_id.id_len = id_len; attrs.switch_id.id_len = id_len;
attrs.phys.port_number = port; attrs.phys.port_number = port;
......
...@@ -978,14 +978,15 @@ static int mscc_ocelot_init_ports(struct platform_device *pdev, ...@@ -978,14 +978,15 @@ static int mscc_ocelot_init_ports(struct platform_device *pdev,
of_node_put(portnp); of_node_put(portnp);
goto out_teardown; goto out_teardown;
} }
devlink_ports_registered |= BIT(port);
err = ocelot_probe_port(ocelot, port, target, portnp); err = ocelot_probe_port(ocelot, port, target, portnp);
if (err) { if (err) {
of_node_put(portnp); ocelot_port_devlink_teardown(ocelot, port);
goto out_teardown; continue;
} }
devlink_ports_registered |= BIT(port);
ocelot_port = ocelot->ports[port]; ocelot_port = ocelot->ports[port];
priv = container_of(ocelot_port, struct ocelot_port_private, priv = container_of(ocelot_port, struct ocelot_port_private,
port); port);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment