Skip to content

Commit 9945c1f

Browse files
Russell King (Oracle)kuba-moo
authored andcommitted
net: dsa: fix older DSA drivers using phylink
Older DSA drivers that do not provide an dsa_ops adjust_link method end up using phylink. Unfortunately, a recent phylink change that requires its supported_interfaces bitmap to be filled breaks these drivers because the bitmap remains empty. Rather than fixing each driver individually, fix it in the core code so we have a sensible set of defaults. Reported-by: Sergei Antonov <[email protected]> Fixes: de5c9bf ("net: phylink: require supported_interfaces to be filled") Signed-off-by: Russell King (Oracle) <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Tested-by: Vladimir Oltean <[email protected]> # dsa_loop Reviewed-by: Florian Fainelli <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent d73ef2d commit 9945c1f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

net/dsa/port.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1727,8 +1727,15 @@ int dsa_port_phylink_create(struct dsa_port *dp)
17271727
ds->ops->phylink_mac_an_restart)
17281728
dp->pl_config.legacy_pre_march2020 = true;
17291729

1730-
if (ds->ops->phylink_get_caps)
1730+
if (ds->ops->phylink_get_caps) {
17311731
ds->ops->phylink_get_caps(ds, dp->index, &dp->pl_config);
1732+
} else {
1733+
/* For legacy drivers */
1734+
__set_bit(PHY_INTERFACE_MODE_INTERNAL,
1735+
dp->pl_config.supported_interfaces);
1736+
__set_bit(PHY_INTERFACE_MODE_GMII,
1737+
dp->pl_config.supported_interfaces);
1738+
}
17321739

17331740
pl = phylink_create(&dp->pl_config, of_fwnode_handle(dp->dn),
17341741
mode, &dsa_port_phylink_mac_ops);

0 commit comments

Comments
 (0)