7299a25e377820d0e77d614da4f433d7904b061b
[openwrt/staging/xback.git] /
1 From 4f580e9aced1816398c1c64f178302a22b8ea6e2 Mon Sep 17 00:00:00 2001
2 From: Luiz Angelo Daros de Luca <luizluca@gmail.com>
3 Date: Sat, 27 Apr 2024 02:11:29 -0300
4 Subject: [PATCH 2/3] net: dsa: realtek: do not assert reset on remove
5
6 The necessity of asserting the reset on removal was previously
7 questioned, as DSA's own cleanup methods should suffice to prevent
8 traffic leakage[1].
9
10 When a driver has subdrivers controlled by devres, they will be
11 unregistered after the main driver's .remove is executed. If it asserts
12 a reset, the subdrivers will be unable to communicate with the hardware
13 during their cleanup. For LEDs, this means that they will fail to turn
14 off, resulting in a timeout error.
15
16 [1] https://lore.kernel.org/r/20240123215606.26716-9-luizluca@gmail.com/
17
18 Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
19 Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
20 Signed-off-by: David S. Miller <davem@davemloft.net>
21 ---
22 drivers/net/dsa/realtek/rtl83xx.c | 7 ++-----
23 1 file changed, 2 insertions(+), 5 deletions(-)
24
25 --- a/drivers/net/dsa/realtek/rtl83xx.c
26 +++ b/drivers/net/dsa/realtek/rtl83xx.c
27 @@ -291,16 +291,13 @@ EXPORT_SYMBOL_NS_GPL(rtl83xx_shutdown, R
28 * rtl83xx_remove() - Cleanup a realtek switch driver
29 * @priv: realtek_priv pointer
30 *
31 - * If a method is provided, this function asserts the hard reset of the switch
32 - * in order to avoid leaking traffic when the driver is gone.
33 + * Placehold for common cleanup procedures.
34 *
35 - * Context: Might sleep if priv->gdev->chip->can_sleep.
36 + * Context: Any
37 * Return: nothing
38 */
39 void rtl83xx_remove(struct realtek_priv *priv)
40 {
41 - /* leave the device reset asserted */
42 - rtl83xx_reset_assert(priv);
43 }
44 EXPORT_SYMBOL_NS_GPL(rtl83xx_remove, REALTEK_DSA);
45