netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: mvneta: fix locking in mvneta_cpu_online()
@ 2025-01-21  0:50 Harshit Mogalapalli
  2025-01-21  0:53 ` Harshit Mogalapalli
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Harshit Mogalapalli @ 2025-01-21  0:50 UTC (permalink / raw)
  To: Marcin Wojtas, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Francois Romieu, Kuniyuki Iwashima,
	netdev, linux-kernel
  Cc: dan.carpenter, kernel-janitors, error27, harshit.m.mogalapalli

When port is stopped, unlock before returning

Fixes: 413f0271f396 ("net: protect NAPI enablement with netdev_lock()")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
---
This is based on static analysis, only compile tested
---
 drivers/net/ethernet/marvell/mvneta.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index 82f4333fb426..4fe121b9f94b 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -4432,6 +4432,7 @@ static int mvneta_cpu_online(unsigned int cpu, struct hlist_node *node)
 	 */
 	if (pp->is_stopped) {
 		spin_unlock(&pp->lock);
+		netdev_unlock(port->napi.dev);
 		return 0;
 	}
 	netif_tx_stop_all_queues(pp->dev);
-- 
2.39.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] net: mvneta: fix locking in mvneta_cpu_online()
  2025-01-21  0:50 [PATCH] net: mvneta: fix locking in mvneta_cpu_online() Harshit Mogalapalli
@ 2025-01-21  0:53 ` Harshit Mogalapalli
  2025-01-21  1:04   ` Jakub Kicinski
  2025-01-21  9:53 ` Simon Horman
  2025-01-23 15:10 ` patchwork-bot+netdevbpf
  2 siblings, 1 reply; 5+ messages in thread
From: Harshit Mogalapalli @ 2025-01-21  0:53 UTC (permalink / raw)
  To: Marcin Wojtas, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Francois Romieu, Kuniyuki Iwashima,
	netdev, linux-kernel
  Cc: dan.carpenter, kernel-janitors, error27

Hi,

On 21/01/25 06:20, Harshit Mogalapalli wrote:
> When port is stopped, unlock before returning
> 
Missed adding a period at the end of sentence. Should I send a V2 ?

Thanks,
Harshit
> Fixes: 413f0271f396 ("net: protect NAPI enablement with netdev_lock()")
> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
> ---
> This is based on static analysis, only compile tested
> ---
>   drivers/net/ethernet/marvell/mvneta.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
> index 82f4333fb426..4fe121b9f94b 100644
> --- a/drivers/net/ethernet/marvell/mvneta.c
> +++ b/drivers/net/ethernet/marvell/mvneta.c
> @@ -4432,6 +4432,7 @@ static int mvneta_cpu_online(unsigned int cpu, struct hlist_node *node)
>   	 */
>   	if (pp->is_stopped) {
>   		spin_unlock(&pp->lock);
> +		netdev_unlock(port->napi.dev);
>   		return 0;
>   	}
>   	netif_tx_stop_all_queues(pp->dev);


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] net: mvneta: fix locking in mvneta_cpu_online()
  2025-01-21  0:53 ` Harshit Mogalapalli
@ 2025-01-21  1:04   ` Jakub Kicinski
  0 siblings, 0 replies; 5+ messages in thread
From: Jakub Kicinski @ 2025-01-21  1:04 UTC (permalink / raw)
  To: Harshit Mogalapalli
  Cc: Marcin Wojtas, Andrew Lunn, David S. Miller, Eric Dumazet,
	Paolo Abeni, Francois Romieu, Kuniyuki Iwashima, netdev,
	linux-kernel, dan.carpenter, kernel-janitors, error27

On Tue, 21 Jan 2025 06:23:16 +0530 Harshit Mogalapalli wrote:
> On 21/01/25 06:20, Harshit Mogalapalli wrote:
> > When port is stopped, unlock before returning
> >   
> Missed adding a period at the end of sentence. Should I send a V2 ?

It's alright, we can add the period when applying.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] net: mvneta: fix locking in mvneta_cpu_online()
  2025-01-21  0:50 [PATCH] net: mvneta: fix locking in mvneta_cpu_online() Harshit Mogalapalli
  2025-01-21  0:53 ` Harshit Mogalapalli
@ 2025-01-21  9:53 ` Simon Horman
  2025-01-23 15:10 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 5+ messages in thread
From: Simon Horman @ 2025-01-21  9:53 UTC (permalink / raw)
  To: Harshit Mogalapalli
  Cc: Marcin Wojtas, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Francois Romieu, Kuniyuki Iwashima,
	netdev, linux-kernel, dan.carpenter, kernel-janitors, error27

On Mon, Jan 20, 2025 at 04:50:02PM -0800, Harshit Mogalapalli wrote:
> When port is stopped, unlock before returning
> 
> Fixes: 413f0271f396 ("net: protect NAPI enablement with netdev_lock()")
> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
> ---
> This is based on static analysis, only compile tested

Thanks Harshit,

I agree that this is correct.

FWIIW, I would have used the idiomatic approach of a goto to jump to nearly
the end of the function, but the effect is the same either way.

Reviewed-by: Simon Horman <horms@kernel.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] net: mvneta: fix locking in mvneta_cpu_online()
  2025-01-21  0:50 [PATCH] net: mvneta: fix locking in mvneta_cpu_online() Harshit Mogalapalli
  2025-01-21  0:53 ` Harshit Mogalapalli
  2025-01-21  9:53 ` Simon Horman
@ 2025-01-23 15:10 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-01-23 15:10 UTC (permalink / raw)
  To: Harshit Mogalapalli
  Cc: marcin.s.wojtas, andrew+netdev, davem, edumazet, kuba, pabeni,
	romieu, kuniyu, netdev, linux-kernel, dan.carpenter,
	kernel-janitors, error27

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 20 Jan 2025 16:50:02 -0800 you wrote:
> When port is stopped, unlock before returning
> 
> Fixes: 413f0271f396 ("net: protect NAPI enablement with netdev_lock()")
> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
> ---
> This is based on static analysis, only compile tested
> 
> [...]

Here is the summary with links:
  - net: mvneta: fix locking in mvneta_cpu_online()
    https://git.kernel.org/netdev/net/c/59e00e8ca242

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-01-23 15:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-21  0:50 [PATCH] net: mvneta: fix locking in mvneta_cpu_online() Harshit Mogalapalli
2025-01-21  0:53 ` Harshit Mogalapalli
2025-01-21  1:04   ` Jakub Kicinski
2025-01-21  9:53 ` Simon Horman
2025-01-23 15:10 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).