* [PATCH net] net: airoha: Fix schedule while atomic in airoha_ppe_deinit()
@ 2025-12-23 21:56 Lorenzo Bianconi
2026-01-04 17:57 ` Jakub Kicinski
0 siblings, 1 reply; 3+ messages in thread
From: Lorenzo Bianconi @ 2025-12-23 21:56 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni
Cc: linux-arm-kernel, linux-mediatek, netdev, Lorenzo Bianconi
Rely on rcu_replace_pointer in airoha_ppe_deinit routine in order to fix
schedule while atomic issue.
Fixes: 00a7678310fe3 ("net: airoha: Introduce flowtable offload support")
Signed-off-by: Lorenzo Bianconi <lorenzo@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: 7b8e9264f55a9c320f398e337d215e68cca50131
change-id: 20251223-airoha-fw-ethtool-21f54b02c98b
Best regards,
--
Lorenzo Bianconi <lorenzo@kernel.org>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] net: airoha: Fix schedule while atomic in airoha_ppe_deinit()
2025-12-23 21:56 [PATCH net] net: airoha: Fix schedule while atomic in airoha_ppe_deinit() Lorenzo Bianconi
@ 2026-01-04 17:57 ` Jakub Kicinski
2026-01-05 8:33 ` Lorenzo Bianconi
0 siblings, 1 reply; 3+ messages in thread
From: Jakub Kicinski @ 2026-01-04 17:57 UTC (permalink / raw)
To: Lorenzo Bianconi
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Paolo Abeni,
linux-arm-kernel, linux-mediatek, netdev
On Tue, 23 Dec 2025 22:56:44 +0100 Lorenzo Bianconi wrote:
> Rely on rcu_replace_pointer in airoha_ppe_deinit routine in order to fix
> schedule while atomic issue.
The information in the commit message is not sufficient.
What "schedule while atomic issue"?
> - 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);
--
pw-bot: cr
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] net: airoha: Fix schedule while atomic in airoha_ppe_deinit()
2026-01-04 17:57 ` Jakub Kicinski
@ 2026-01-05 8:33 ` Lorenzo Bianconi
0 siblings, 0 replies; 3+ messages in thread
From: Lorenzo Bianconi @ 2026-01-05 8:33 UTC (permalink / raw)
To: Jakub Kicinski
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Paolo Abeni,
linux-arm-kernel, linux-mediatek, netdev
[-- Attachment #1: Type: text/plain, Size: 770 bytes --]
> On Tue, 23 Dec 2025 22:56:44 +0100 Lorenzo Bianconi wrote:
> > Rely on rcu_replace_pointer in airoha_ppe_deinit routine in order to fix
> > schedule while atomic issue.
>
> The information in the commit message is not sufficient.
> What "schedule while atomic issue"?
The issue is we run kzalloc() with GFP_KERNEL in airoha_npu_ppe_deinit()
in atomic context but we do not really need atomic context there.
I will fix the commit log in v2.
Regards,
Lorenzo
>
> > - 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);
> --
> pw-bot: cr
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-01-05 8:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-23 21:56 [PATCH net] net: airoha: Fix schedule while atomic in airoha_ppe_deinit() Lorenzo Bianconi
2026-01-04 17:57 ` Jakub Kicinski
2026-01-05 8:33 ` Lorenzo Bianconi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox