Skip to content

Commit 6abcf75

Browse files
LorenzoBianconiPaolo Abeni
authored andcommitted
net: airoha: Fix schedule while atomic in airoha_ppe_deinit()
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: 00a7678 ("net: airoha: Introduce flowtable offload support") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://patch.msgid.link/20260105-airoha-fw-ethtool-v2-1-3b32b158cc31@kernel.org Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 6532673 commit 6abcf75

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

drivers/net/ethernet/airoha/airoha_ppe.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1547,13 +1547,16 @@ void airoha_ppe_deinit(struct airoha_eth *eth)
15471547
{
15481548
struct airoha_npu *npu;
15491549

1550-
rcu_read_lock();
1551-
npu = rcu_dereference(eth->npu);
1550+
mutex_lock(&flow_offload_mutex);
1551+
1552+
npu = rcu_replace_pointer(eth->npu, NULL,
1553+
lockdep_is_held(&flow_offload_mutex));
15521554
if (npu) {
15531555
npu->ops.ppe_deinit(npu);
15541556
airoha_npu_put(npu);
15551557
}
1556-
rcu_read_unlock();
1558+
1559+
mutex_unlock(&flow_offload_mutex);
15571560

15581561
rhashtable_destroy(&eth->ppe->l2_flows);
15591562
rhashtable_destroy(&eth->flow_table);

0 commit comments

Comments
 (0)