mbox series

[net,v3,0/7] eth: fix calling napi_enable() in atomic context

Message ID 20250124031841.1179756-1-kuba@kernel.org (mailing list archive)
Headers show
Series eth: fix calling napi_enable() in atomic context | expand

Message

Jakub Kicinski Jan. 24, 2025, 3:18 a.m. UTC
Dan has reported that I missed a lot of drivers which call napi_enable()
in atomic with the naive coccinelle search for spin locks:
https://lore.kernel.org/dcfd56bc-de32-4b11-9e19-d8bd1543745d@stanley.mountain

Fix them. Most of the fixes involve taking the netdev_lock()
before the spin lock. mt76 is special because we can just
move napi_enable() from the BH section.

All patches compile tested only.

v3:
 - [patch 1] move the annotation
v2: https://lore.kernel.org/20250123004520.806855-1-kuba@kernel.org
 - [patch 1] correct commit msg (can't sleep -> needs to sleep)
 - [patch 1] add re-locking annotation to tg3_irq_quiesce()
 - [patch 6] actually switch to napi_enable_locked()
 - [patch 7] reword the commit msg slightly
v1: https://lore.kernel.org/20250121221519.392014-1-kuba@kernel.org 

Jakub Kicinski (7):
  eth: tg3: fix calling napi_enable() in atomic context
  eth: forcedeth: remove local wrappers for napi enable/disable
  eth: forcedeth: fix calling napi_enable() in atomic context
  eth: 8139too: fix calling napi_enable() in atomic context
  eth: niu: fix calling napi_enable() in atomic context
  eth: via-rhine: fix calling napi_enable() in atomic context
  wifi: mt76: move napi_enable() from under BH

 drivers/net/ethernet/broadcom/tg3.c           | 35 ++++++++++++++++---
 drivers/net/ethernet/nvidia/forcedeth.c       | 32 ++++++-----------
 drivers/net/ethernet/realtek/8139too.c        |  4 ++-
 drivers/net/ethernet/sun/niu.c                | 10 +++++-
 drivers/net/ethernet/via/via-rhine.c          | 11 +++++-
 .../net/wireless/mediatek/mt76/mt7603/mac.c   |  9 +++--
 .../net/wireless/mediatek/mt76/mt7615/pci.c   |  8 +++--
 .../wireless/mediatek/mt76/mt7615/pci_mac.c   |  8 +++--
 .../net/wireless/mediatek/mt76/mt76x0/pci.c   |  8 +++--
 .../net/wireless/mediatek/mt76/mt76x02_mmio.c |  8 +++--
 .../net/wireless/mediatek/mt76/mt76x2/pci.c   |  7 ++--
 .../net/wireless/mediatek/mt76/mt7915/mac.c   | 17 ++++++---
 .../net/wireless/mediatek/mt76/mt7921/pci.c   |  7 ++--
 .../wireless/mediatek/mt76/mt7921/pci_mac.c   |  7 ++--
 .../net/wireless/mediatek/mt76/mt7925/pci.c   |  7 ++--
 .../wireless/mediatek/mt76/mt7925/pci_mac.c   |  7 ++--
 .../net/wireless/mediatek/mt76/mt7996/mac.c   | 12 +++----
 17 files changed, 132 insertions(+), 65 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Jan. 27, 2025, 10:40 p.m. UTC | #1
Hello:

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

On Thu, 23 Jan 2025 19:18:34 -0800 you wrote:
> Dan has reported that I missed a lot of drivers which call napi_enable()
> in atomic with the naive coccinelle search for spin locks:
> https://lore.kernel.org/dcfd56bc-de32-4b11-9e19-d8bd1543745d@stanley.mountain
> 
> Fix them. Most of the fixes involve taking the netdev_lock()
> before the spin lock. mt76 is special because we can just
> move napi_enable() from the BH section.
> 
> [...]

Here is the summary with links:
  - [net,v3,1/7] eth: tg3: fix calling napi_enable() in atomic context
    https://git.kernel.org/netdev/net/c/8ed47e4e0b42
  - [net,v3,2/7] eth: forcedeth: remove local wrappers for napi enable/disable
    https://git.kernel.org/netdev/net/c/a878f3e4ace7
  - [net,v3,3/7] eth: forcedeth: fix calling napi_enable() in atomic context
    https://git.kernel.org/netdev/net/c/5c4470a1719c
  - [net,v3,4/7] eth: 8139too: fix calling napi_enable() in atomic context
    https://git.kernel.org/netdev/net/c/d19e612c47f4
  - [net,v3,5/7] eth: niu: fix calling napi_enable() in atomic context
    https://git.kernel.org/netdev/net/c/f1d12bc7a596
  - [net,v3,6/7] eth: via-rhine: fix calling napi_enable() in atomic context
    https://git.kernel.org/netdev/net/c/09a939487fc8
  - [net,v3,7/7] wifi: mt76: move napi_enable() from under BH
    https://git.kernel.org/netdev/net/c/a60558644e20

You are awesome, thank you!