Skip to content

Commit 63a64c3

Browse files
fidomaxgregkh
authored andcommitted
net: dsa: Fix type was not set for devlink port
[ Upstream commit fb6ec87 ] If PHY is not available on DSA port (described at devicetree but absent or failed to detect) then kernel prints warning after 3700 secs: [ 3707.948771] ------------[ cut here ]------------ [ 3707.948784] Type was not set for devlink port. [ 3707.948894] WARNING: CPU: 1 PID: 17 at net/core/devlink.c:8097 0xc083f9d8 We should unregister the devlink port as a user port and re-register it as an unused port before executing "continue" in case of dsa_port_setup error. Fixes: 86f8b1c ("net: dsa: Do not make user port errors fatal") Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent ed613d9 commit 63a64c3

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎net/dsa/dsa2.c‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,8 +533,14 @@ static int dsa_tree_setup_switches(struct dsa_switch_tree *dst)
533533

534534
list_for_each_entry(dp, &dst->ports, list) {
535535
err = dsa_port_setup(dp);
536-
if (err)
536+
if (err) {
537+
dsa_port_devlink_teardown(dp);
538+
dp->type = DSA_PORT_TYPE_UNUSED;
539+
err = dsa_port_devlink_setup(dp);
540+
if (err)
541+
goto teardown;
537542
continue;
543+
}
538544
}
539545

540546
return 0;

0 commit comments

Comments
 (0)