1 From 3f50d686e5dda76ba523cc30a320ab8ffae531de Mon Sep 17 00:00:00 2001 2 From: =?UTF-8?q?Marek=20Beh=C3=BAn?= <kabel@kernel.org> 3 Date: Sat, 11 Dec 2021 23:44:14 +0100 4 Subject: [PATCH net] net: dsa: mv88e6xxx: Unforce speed & duplex in 5 mac_link_down() 6 MIME-Version: 1.0 7 Content-Type: text/plain; charset=UTF-8 8 Content-Transfer-Encoding: 8bit 9 10 Commit 64d47d50be7a ("net: dsa: mv88e6xxx: configure interface settings 11 in mac_config") removed forcing of speed and duplex from 12 mv88e6xxx_mac_config(), where the link is forced down, and left it only 13 in mv88e6xxx_mac_link_up(), by which time link is unforced. 14 15 It seems that (at least on 88E6190) when changing cmode to 2500base-x, 16 if the link is not forced down, but the speed or duplex are still 17 forced, the forcing of new settings for speed & duplex doesn't take in 18 mv88e6xxx_mac_link_up(). 19 20 Fix this by unforcing speed & duplex in mv88e6xxx_mac_link_down(). 21 22 Fixes: 64d47d50be7a ("net: dsa: mv88e6xxx: configure interface settings in mac_config") 23 Signed-off-by: Marek BehĂșn <kabel@kernel.org> 24 --- 25 drivers/net/dsa/mv88e6xxx/chip.c | 4 ++++ 26 1 file changed, 4 insertions(+) 27 28 diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c 29 index 14f87f6ac479..cd8462d1e27c 100644 30 --- a/drivers/net/dsa/mv88e6xxx/chip.c 31 +++ b/drivers/net/dsa/mv88e6xxx/chip.c 32 @@ -768,6 +768,10 @@ static void mv88e6xxx_mac_link_down(struct dsa_switch *ds, int port, 33 if ((!mv88e6xxx_port_ppu_updates(chip, port) || 34 mode == MLO_AN_FIXED) && ops->port_sync_link) 35 err = ops->port_sync_link(chip, port, mode, false); 36 + 37 + if (!err && ops->port_set_speed_duplex) 38 + err = ops->port_set_speed_duplex(chip, port, SPEED_UNFORCED, 39 + DUPLEX_UNFORCED); 40 mv88e6xxx_reg_unlock(chip); 41 42 if (err) 43 -- 44 2.32.0 45