* [PATCH net v2] net: airoha: Fix schedule while atomic in airoha_ppe_deinit()
@ 2026-01-05 8:43 Lorenzo Bianconi
2026-01-08 10:30 ` patchwork-bot+netdevbpf
2026-01-08 13:22 ` Simon Horman
0 siblings, 2 replies; 5+ messages in thread
From: Lorenzo Bianconi @ 2026-01-05 8:43 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Lorenzo Bianconi
Cc: linux-arm-kernel, linux-mediatek, netdev
airoha_ppe_deinit() runs airoha_npu_ppe_deinit() in atomic context.
airoha_npu_ppe_deinit routine allocates ppe_data buffer with GFP_KERNEL
flag. Rely on rcu_replace_pointer in airoha_ppe_deinit routine in order
to fix schedule while atomic issue in airoha_npu_ppe_deinit() since we
do not need atomic context there.
Fixes: 00a7678310fe3 ("net: airoha: Introduce flowtable offload support")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
Changes in v2:
- Update commit log.
- Link to v1: https://lore.kernel.org/r/20251223-airoha-fw-ethtool-v1-1-1dbd1568c585@kernel.org
---
drivers/net/ethernet/airoha/airoha_ppe.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/airoha/airoha_ppe.c b/drivers/net/ethernet/airoha/airoha_ppe.c
index 0caabb0c3aa06948e46ad087c50eba5babc81994..2221bafaf7c9fed73dcf8d30ff3b1c5eecc463d4 100644
--- a/drivers/net/ethernet/airoha/airoha_ppe.c
+++ b/drivers/net/ethernet/airoha/airoha_ppe.c
@@ -1547,13 +1547,16 @@ void airoha_ppe_deinit(struct airoha_eth *eth)
{
struct airoha_npu *npu;
- rcu_read_lock();
- npu = rcu_dereference(eth->npu);
+ mutex_lock(&flow_offload_mutex);
+
+ npu = rcu_replace_pointer(eth->npu, NULL,
+ lockdep_is_held(&flow_offload_mutex));
if (npu) {
npu->ops.ppe_deinit(npu);
airoha_npu_put(npu);
}
- rcu_read_unlock();
+
+ mutex_unlock(&flow_offload_mutex);
rhashtable_destroy(ð->ppe->l2_flows);
rhashtable_destroy(ð->flow_table);
---
base-commit: c303e8b86d9dbd6868f5216272973292f7f3b7f1
change-id: 20251223-airoha-fw-ethtool-21f54b02c98b
Best regards,
--
Lorenzo Bianconi <lorenzo@kernel.org>
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net v2] net: airoha: Fix schedule while atomic in airoha_ppe_deinit()
2026-01-05 8:43 [PATCH net v2] net: airoha: Fix schedule while atomic in airoha_ppe_deinit() Lorenzo Bianconi
@ 2026-01-08 10:30 ` patchwork-bot+netdevbpf
2026-01-08 13:22 ` Simon Horman
1 sibling, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-01-08 10:30 UTC (permalink / raw)
To: Lorenzo Bianconi
Cc: andrew+netdev, davem, edumazet, kuba, pabeni, linux-arm-kernel,
linux-mediatek, netdev
Hello:
This patch was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Mon, 05 Jan 2026 09:43:31 +0100 you wrote:
> airoha_ppe_deinit() runs airoha_npu_ppe_deinit() in atomic context.
> airoha_npu_ppe_deinit routine allocates ppe_data buffer with GFP_KERNEL
> flag. Rely on rcu_replace_pointer in airoha_ppe_deinit routine in order
> to fix schedule while atomic issue in airoha_npu_ppe_deinit() since we
> do not need atomic context there.
>
> Fixes: 00a7678310fe3 ("net: airoha: Introduce flowtable offload support")
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
>
> [...]
Here is the summary with links:
- [net,v2] net: airoha: Fix schedule while atomic in airoha_ppe_deinit()
https://git.kernel.org/netdev/net/c/6abcf751bc08
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
* Re: [PATCH net v2] net: airoha: Fix schedule while atomic in airoha_ppe_deinit()
2026-01-05 8:43 [PATCH net v2] net: airoha: Fix schedule while atomic in airoha_ppe_deinit() Lorenzo Bianconi
2026-01-08 10:30 ` patchwork-bot+netdevbpf
@ 2026-01-08 13:22 ` Simon Horman
2026-01-09 9:33 ` Lorenzo Bianconi
1 sibling, 1 reply; 5+ messages in thread
From: Simon Horman @ 2026-01-08 13:22 UTC (permalink / raw)
To: Lorenzo Bianconi
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, linux-arm-kernel, linux-mediatek, netdev
On Mon, Jan 05, 2026 at 09:43:31AM +0100, Lorenzo Bianconi wrote:
> airoha_ppe_deinit() runs airoha_npu_ppe_deinit() in atomic context.
> airoha_npu_ppe_deinit routine allocates ppe_data buffer with GFP_KERNEL
> flag. Rely on rcu_replace_pointer in airoha_ppe_deinit routine in order
> to fix schedule while atomic issue in airoha_npu_ppe_deinit() since we
> do not need atomic context there.
Hi Lorenzo,
If I understand things correctly the key problem here is that
an allocation with GFP_KERNEL implies GFP_RECLAIM and thus may sleep.
But RCU read-side critical sections are not allowed to sleep in non-RT
kernels.
If so, I think it would be clearer to describe the problem along those
lines. But maybe it is just me.
>
> Fixes: 00a7678310fe3 ("net: airoha: Introduce flowtable offload support")
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> ---
> Changes in v2:
> - Update commit log.
> - Link to v1: https://lore.kernel.org/r/20251223-airoha-fw-ethtool-v1-1-1dbd1568c585@kernel.org
...
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net v2] net: airoha: Fix schedule while atomic in airoha_ppe_deinit()
2026-01-08 13:22 ` Simon Horman
@ 2026-01-09 9:33 ` Lorenzo Bianconi
2026-01-13 13:26 ` Simon Horman
0 siblings, 1 reply; 5+ messages in thread
From: Lorenzo Bianconi @ 2026-01-09 9:33 UTC (permalink / raw)
To: Simon Horman
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, linux-arm-kernel, linux-mediatek, netdev
[-- Attachment #1: Type: text/plain, Size: 1205 bytes --]
> On Mon, Jan 05, 2026 at 09:43:31AM +0100, Lorenzo Bianconi wrote:
> > airoha_ppe_deinit() runs airoha_npu_ppe_deinit() in atomic context.
> > airoha_npu_ppe_deinit routine allocates ppe_data buffer with GFP_KERNEL
> > flag. Rely on rcu_replace_pointer in airoha_ppe_deinit routine in order
> > to fix schedule while atomic issue in airoha_npu_ppe_deinit() since we
> > do not need atomic context there.
>
> Hi Lorenzo,
Hi Simon,
>
> If I understand things correctly the key problem here is that
> an allocation with GFP_KERNEL implies GFP_RECLAIM and thus may sleep.
> But RCU read-side critical sections are not allowed to sleep in non-RT
> kernels.
yes, right, RCU section is atomic.
>
> If so, I think it would be clearer to describe the problem along those
> lines. But maybe it is just me.
This patch is already in Linus's tree.
Regards,
Lorenzo
>
> >
> > Fixes: 00a7678310fe3 ("net: airoha: Introduce flowtable offload support")
> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > ---
> > Changes in v2:
> > - Update commit log.
> > - Link to v1: https://lore.kernel.org/r/20251223-airoha-fw-ethtool-v1-1-1dbd1568c585@kernel.org
>
> ...
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net v2] net: airoha: Fix schedule while atomic in airoha_ppe_deinit()
2026-01-09 9:33 ` Lorenzo Bianconi
@ 2026-01-13 13:26 ` Simon Horman
0 siblings, 0 replies; 5+ messages in thread
From: Simon Horman @ 2026-01-13 13:26 UTC (permalink / raw)
To: Lorenzo Bianconi
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, linux-arm-kernel, linux-mediatek, netdev
On Fri, Jan 09, 2026 at 10:33:55AM +0100, Lorenzo Bianconi wrote:
> > On Mon, Jan 05, 2026 at 09:43:31AM +0100, Lorenzo Bianconi wrote:
> > > airoha_ppe_deinit() runs airoha_npu_ppe_deinit() in atomic context.
> > > airoha_npu_ppe_deinit routine allocates ppe_data buffer with GFP_KERNEL
> > > flag. Rely on rcu_replace_pointer in airoha_ppe_deinit routine in order
> > > to fix schedule while atomic issue in airoha_npu_ppe_deinit() since we
> > > do not need atomic context there.
> >
> > Hi Lorenzo,
>
> Hi Simon,
>
> >
> > If I understand things correctly the key problem here is that
> > an allocation with GFP_KERNEL implies GFP_RECLAIM and thus may sleep.
> > But RCU read-side critical sections are not allowed to sleep in non-RT
> > kernels.
>
> yes, right, RCU section is atomic.
>
> >
> > If so, I think it would be clearer to describe the problem along those
> > lines. But maybe it is just me.
>
> This patch is already in Linus's tree.
Yeah, sorry for missing that.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-01-13 13:26 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-05 8:43 [PATCH net v2] net: airoha: Fix schedule while atomic in airoha_ppe_deinit() Lorenzo Bianconi
2026-01-08 10:30 ` patchwork-bot+netdevbpf
2026-01-08 13:22 ` Simon Horman
2026-01-09 9:33 ` Lorenzo Bianconi
2026-01-13 13:26 ` Simon Horman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox