Skip to content

Commit cc1049c

Browse files
wojtas-marcinkuba-moo
authored andcommitted
net: dsa: mv88e6xxx: fix speed setting for CPU/DSA ports
Commit 3c783b8 ("net: dsa: mv88e6xxx: get rid of SPEED_MAX setting") stopped relying on SPEED_MAX constant and hardcoded speed settings for the switch ports and rely on phylink configuration. It turned out, however, that when the relevant code is called, the mac_capabilites of CPU/DSA port remain unset. mv88e6xxx_setup_port() is called via mv88e6xxx_setup() in dsa_tree_setup_switches(), which precedes setting the caps in phylink_get_caps down in the chain of dsa_tree_setup_ports(). As a result the mac_capabilites are 0 and the default speed for CPU/DSA port is 10M at the start. To fix that, execute mv88e6xxx_get_caps() and obtain the capabilities driectly. Fixes: 3c783b8 ("net: dsa: mv88e6xxx: get rid of SPEED_MAX setting") Signed-off-by: Marcin Wojtas <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 2bb88b2 commit cc1049c

File tree

1 file changed

+6
-1
lines changed
  • drivers/net/dsa/mv88e6xxx

1 file changed

+6
-1
lines changed

drivers/net/dsa/mv88e6xxx/chip.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3293,7 +3293,12 @@ static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port)
32933293
* port and all DSA ports to their maximum bandwidth and full duplex.
32943294
*/
32953295
if (dsa_is_cpu_port(ds, port) || dsa_is_dsa_port(ds, port)) {
3296-
unsigned long caps = dp->pl_config.mac_capabilities;
3296+
struct phylink_config pl_config = {};
3297+
unsigned long caps;
3298+
3299+
mv88e6xxx_get_caps(ds, port, &pl_config);
3300+
3301+
caps = pl_config.mac_capabilities;
32973302

32983303
if (chip->info->ops->port_max_speed_mode)
32993304
mode = chip->info->ops->port_max_speed_mode(port);

0 commit comments

Comments
 (0)