OpenCloudOS-Kernel/drivers/net/dsa/mv88e6xxx
Linus Walleij 95ce158b6c dsa: mv88e6xxx: Do a final check before timing out
I get sporadic timeouts from the driver when using the
MV88E6352. Reading the status again after the loop fixes the
problem: the operation is successful but goes undetected.

Some added prints show things like this:

[   58.356209] mv88e6085 mdio_mux-0.1:00: Timeout while waiting
    for switch, addr 1b reg 0b, mask 8000, val 0000, data c000
[   58.367487] mv88e6085 mdio_mux-0.1:00: Timeout waiting for
    ATU op 4000, fid 0001
(...)
[   61.826293] mv88e6085 mdio_mux-0.1:00: Timeout while waiting
    for switch, addr 1c reg 18, mask 8000, val 0000, data 9860
[   61.837560] mv88e6085 mdio_mux-0.1:00: Timeout waiting
    for PHY command 1860 to complete

The reason is probably not the commands: I think those are
mostly fine with the 50+50ms timeout, but the problem
appears when OpenWrt brings up several interfaces in
parallel on a system with 7 populated ports: if one of
them take more than 50 ms and waits one or more of the
others can get stuck on the mutex for the switch and then
this can easily multiply.

As we sleep and wait, the function loop needs a final
check after exiting the loop if we were successful.

Suggested-by: Andrew Lunn <andrew@lunn.ch>
Cc: Tobias Waldekranz <tobias@waldekranz.com>
Fixes: 35da1dfd94 ("net: dsa: mv88e6xxx: Improve performance of busy bit polling")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20230712223405.861899-1-linus.walleij@linaro.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-07-13 20:31:11 -07:00
..
Kconfig net: dsa: mv88e6xxx: depend on PTP conditionally 2022-12-26 09:03:44 +00:00
Makefile net: dsa: mv88e6xxx: mac-auth/MAB implementation 2023-01-10 11:58:39 +01:00
chip.c dsa: mv88e6xxx: Do a final check before timing out 2023-07-13 20:31:11 -07:00
chip.h net: dsa: mv88e6xxx: add support for MV88E6071 switch 2023-05-31 09:56:08 +01:00
devlink.c net: devlink: let the core report the driver name instead of the drivers 2022-11-30 21:49:38 -08:00
devlink.h net: dsa: tear down devlink port regions when tearing down the devlink port on error 2021-09-19 13:05:44 +01:00
global1.c net: dsa: mv88e6xxx: Enable PTP receive for mv88e6390 2023-01-16 13:36:57 +00:00
global1.h net: dsa: mv88e6xxx: Enable PTP receive for mv88e6390 2023-01-16 13:36:57 +00:00
global1_atu.c net: dsa: mv88e6xxx: mac-auth/MAB implementation 2023-01-10 11:58:39 +01:00
global1_vtu.c net: dsa: mv88e6xxx: replace VTU violation prints with trace points 2022-12-12 15:01:18 -08:00
global2.c net: dsa: mv88e6xxx: add field to specify internal phys layout 2023-05-30 23:54:33 -07:00
global2.h net: dsa: mv88e6xxx: Reset mv88e6393x force WD event bit 2023-04-02 13:32:37 +01:00
global2_avb.c net: dsa: mv88e6xxx: wait for AVB Busy bit 2019-08-11 21:27:15 -07:00
global2_scratch.c net: dsa: mv88e6xxx: add mv88e6352_g2_scratch_port_has_serdes() 2022-02-03 14:10:35 +00:00
hwtstamp.c net: dsa: Use netif_rx(). 2022-03-04 12:02:19 +00:00
hwtstamp.h net: dsa: no longer clone skb in core driver 2021-04-27 14:10:15 -07:00
phy.c net: dsa: mv88e6xxx: Separate C22 and C45 transactions 2023-01-10 15:53:37 -08:00
phy.h net: dsa: mv88e6xxx: Separate C22 and C45 transactions 2023-01-10 15:53:37 -08:00
port.c net: dsa: mv88e6xxx: implement USXGMII mode for mv88e6393x 2023-06-07 21:26:36 -07:00
port.h net: dsa: mv88e6xxx: add support for MV88E6071 switch 2023-05-31 09:56:08 +01:00
port_hidden.c net: dsa: mv88e6xxx: Fix port_hidden_wait to account for port_base_addr 2022-04-26 12:03:58 +02:00
ptp.c net: dsa: mv88e6xxx: Enable PTP receive for mv88e6390 2023-01-16 13:36:57 +00:00
ptp.h net: dsa: mv88e6xxx: Enable PTP receive for mv88e6390 2023-01-16 13:36:57 +00:00
serdes.c net: dsa: mv88e6xxx: implement USXGMII mode for mv88e6393x 2023-06-07 21:26:36 -07:00
serdes.h net: dsa: mv88e6xxx: implement USXGMII mode for mv88e6393x 2023-06-07 21:26:36 -07:00
smi.c net: dsa: mv88e6xxx: Improve indirect addressing performance 2022-01-31 11:29:12 +00:00
smi.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
switchdev.c net: dsa: mv88e6xxx: mac-auth/MAB implementation 2023-01-10 11:58:39 +01:00
switchdev.h net: dsa: mv88e6xxx: mac-auth/MAB implementation 2023-01-10 11:58:39 +01:00
trace.c net: dsa: mv88e6xxx: replace ATU violation prints with trace points 2022-12-12 15:01:18 -08:00
trace.h net: dsa: mv88e6xxx: replace VTU violation prints with trace points 2022-12-12 15:01:18 -08:00