2023-06-21 13:59:12

by Bartosz Golaszewski

[permalink] [raw]
Subject: [PATCH net] net: stmmac: fix double serdes powerdown

From: Bartosz Golaszewski <[email protected]>

Commit 49725ffc15fc ("net: stmmac: power up/down serdes in
stmmac_open/release") correctly added a call to the serdes_powerdown()
callback to stmmac_release() but did not remove the one from
stmmac_remove() which leads to a doubled call to serdes_powerdown().

This can lead to all kinds of problems: in the case of the qcom ethqos
driver, it caused an unbalanced regulator disable splat.

Fixes: 49725ffc15fc ("net: stmmac: power up/down serdes in stmmac_open/release")
Signed-off-by: Bartosz Golaszewski <[email protected]>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 ------
1 file changed, 6 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 10e8a5606ba6..4727f7be4f86 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -7461,12 +7461,6 @@ void stmmac_dvr_remove(struct device *dev)
netif_carrier_off(ndev);
unregister_netdev(ndev);

- /* Serdes power down needs to happen after VLAN filter
- * is deleted that is triggered by unregister_netdev().
- */
- if (priv->plat->serdes_powerdown)
- priv->plat->serdes_powerdown(ndev, priv->plat->bsp_priv);
-
#ifdef CONFIG_DEBUG_FS
stmmac_exit_fs(ndev);
#endif
--
2.39.2



2023-06-22 08:23:13

by Jiri Pirko

[permalink] [raw]
Subject: Re: [PATCH net] net: stmmac: fix double serdes powerdown

Wed, Jun 21, 2023 at 03:55:37PM CEST, [email protected] wrote:
>From: Bartosz Golaszewski <[email protected]>
>
>Commit 49725ffc15fc ("net: stmmac: power up/down serdes in
>stmmac_open/release") correctly added a call to the serdes_powerdown()
>callback to stmmac_release() but did not remove the one from
>stmmac_remove() which leads to a doubled call to serdes_powerdown().
>
>This can lead to all kinds of problems: in the case of the qcom ethqos
>driver, it caused an unbalanced regulator disable splat.
>
>Fixes: 49725ffc15fc ("net: stmmac: power up/down serdes in stmmac_open/release")
>Signed-off-by: Bartosz Golaszewski <[email protected]>

Reviewed-by: Jiri Pirko <[email protected]>

2023-06-22 19:43:42

by Andrew Halaney

[permalink] [raw]
Subject: Re: [PATCH net] net: stmmac: fix double serdes powerdown

On Wed, Jun 21, 2023 at 03:55:37PM +0200, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <[email protected]>
>
> Commit 49725ffc15fc ("net: stmmac: power up/down serdes in
> stmmac_open/release") correctly added a call to the serdes_powerdown()
> callback to stmmac_release() but did not remove the one from
> stmmac_remove() which leads to a doubled call to serdes_powerdown().
>
> This can lead to all kinds of problems: in the case of the qcom ethqos
> driver, it caused an unbalanced regulator disable splat.
>
> Fixes: 49725ffc15fc ("net: stmmac: power up/down serdes in stmmac_open/release")
> Signed-off-by: Bartosz Golaszewski <[email protected]>

Reviewed-by: Andrew Halaney <[email protected]>
Tested-by: Andrew Halaney <[email protected]>

> ---
> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 10e8a5606ba6..4727f7be4f86 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -7461,12 +7461,6 @@ void stmmac_dvr_remove(struct device *dev)
> netif_carrier_off(ndev);
> unregister_netdev(ndev);
>
> - /* Serdes power down needs to happen after VLAN filter
> - * is deleted that is triggered by unregister_netdev().
> - */
> - if (priv->plat->serdes_powerdown)
> - priv->plat->serdes_powerdown(ndev, priv->plat->bsp_priv);
> -
> #ifdef CONFIG_DEBUG_FS
> stmmac_exit_fs(ndev);
> #endif
> --
> 2.39.2
>


2023-06-23 00:34:35

by Chang, Junxiao

[permalink] [raw]
Subject: RE: [PATCH net] net: stmmac: fix double serdes powerdown

Acked-by: Junxiao Chang <[email protected]>

-----Original Message-----
From: Andrew Halaney <[email protected]>
Sent: Friday, June 23, 2023 2:54 AM
To: Bartosz Golaszewski <[email protected]>
Cc: Giuseppe Cavallaro <[email protected]>; Alexandre Torgue <[email protected]>; Jose Abreu <[email protected]>; David S . Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Maxime Coquelin <[email protected]>; Chang, Junxiao <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; Bartosz Golaszewski <[email protected]>
Subject: Re: [PATCH net] net: stmmac: fix double serdes powerdown

On Wed, Jun 21, 2023 at 03:55:37PM +0200, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <[email protected]>
>
> Commit 49725ffc15fc ("net: stmmac: power up/down serdes in
> stmmac_open/release") correctly added a call to the serdes_powerdown()
> callback to stmmac_release() but did not remove the one from
> stmmac_remove() which leads to a doubled call to serdes_powerdown().
>
> This can lead to all kinds of problems: in the case of the qcom ethqos
> driver, it caused an unbalanced regulator disable splat.
>
> Fixes: 49725ffc15fc ("net: stmmac: power up/down serdes in
> stmmac_open/release")
> Signed-off-by: Bartosz Golaszewski <[email protected]>

Reviewed-by: Andrew Halaney <[email protected]>
Tested-by: Andrew Halaney <[email protected]>

> ---
> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 10e8a5606ba6..4727f7be4f86 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -7461,12 +7461,6 @@ void stmmac_dvr_remove(struct device *dev)
> netif_carrier_off(ndev);
> unregister_netdev(ndev);
>
> - /* Serdes power down needs to happen after VLAN filter
> - * is deleted that is triggered by unregister_netdev().
> - */
> - if (priv->plat->serdes_powerdown)
> - priv->plat->serdes_powerdown(ndev, priv->plat->bsp_priv);
> -
> #ifdef CONFIG_DEBUG_FS
> stmmac_exit_fs(ndev);
> #endif
> --
> 2.39.2
>


2023-06-23 03:22:59

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [PATCH net] net: stmmac: fix double serdes powerdown

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

On Wed, 21 Jun 2023 15:55:37 +0200 you wrote:
> From: Bartosz Golaszewski <[email protected]>
>
> Commit 49725ffc15fc ("net: stmmac: power up/down serdes in
> stmmac_open/release") correctly added a call to the serdes_powerdown()
> callback to stmmac_release() but did not remove the one from
> stmmac_remove() which leads to a doubled call to serdes_powerdown().
>
> [...]

Here is the summary with links:
- [net] net: stmmac: fix double serdes powerdown
https://git.kernel.org/netdev/net/c/c4fc88ad2a76

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html