Skip to content

Commit 72f93dc

Browse files
LorenzoBianconigregkh
authored andcommitted
net: airoha: Fix schedule while atomic in airoha_ppe_deinit()
[ Upstream commit 6abcf75 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 9e17d06 commit 72f93dc

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
@@ -1466,13 +1466,16 @@ void airoha_ppe_deinit(struct airoha_eth *eth)
14661466
{
14671467
struct airoha_npu *npu;
14681468

1469-
rcu_read_lock();
1470-
npu = rcu_dereference(eth->npu);
1469+
mutex_lock(&flow_offload_mutex);
1470+
1471+
npu = rcu_replace_pointer(eth->npu, NULL,
1472+
lockdep_is_held(&flow_offload_mutex));
14711473
if (npu) {
14721474
npu->ops.ppe_deinit(npu);
14731475
airoha_npu_put(npu);
14741476
}
1475-
rcu_read_unlock();
1477+
1478+
mutex_unlock(&flow_offload_mutex);
14761479

14771480
rhashtable_destroy(&eth->ppe->l2_flows);
14781481
rhashtable_destroy(&eth->flow_table);

0 commit comments

Comments
 (0)