Skip to content

Commit fb6ec87

Browse files
fidomaxdavem330
authored andcommitted
net: dsa: Fix type was not set for devlink port
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 <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent bff5b62 commit fb6ec87

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

net/dsa/dsa2.c

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

796796
list_for_each_entry(dp, &dst->ports, list) {
797797
err = dsa_port_setup(dp);
798-
if (err)
798+
if (err) {
799+
dsa_port_devlink_teardown(dp);
800+
dp->type = DSA_PORT_TYPE_UNUSED;
801+
err = dsa_port_devlink_setup(dp);
802+
if (err)
803+
goto teardown;
799804
continue;
805+
}
800806
}
801807

802808
return 0;

0 commit comments

Comments
 (0)