In message: [PATCH v5.15] octeontx2-pf: Drop the redundant preempt disable in __cn10k_aura_freeptr() on 02/02/2023 Kevin Hao wrote:
> From: Kevin Hao <[email protected]> > > In order to fix a sleeping in atomic context bug, we have replaced the > per_cpu_ptr() with get_cpu_ptr() in commit 97b853120a3e ("octeontx2: > nic: Replace get_cpu()/put_cpu() with get_cpu_ptr()/put_cpu_ptr()") > to disable the preempt in __cn10k_aura_freeptr(). But > __cn10k_aura_freeptr() may be used in NAPI, the preempt disable seems > redundant. The commit 29e9c67bf327 ("octeontx2-pf: Fix the use of > GFP_KERNEL in atomic context on rt") chose to add the get/put_cpu() in > cn10k_aura_freeptr(). With this change, the preempt disable in > __cn10k_aura_freeptr() becomes unnecessary. So restore the > per_cpu_ptr(). > > Signed-off-by: Kevin Hao <[email protected]> > --- > > Hi Bruce, > > Please help me merge this patch into the following two branches: > v5.15/standard/cn-sdkv5.4/octeon > v5.15/standard/preempt-rt/cn-sdkv5.4/octeon merged. Bruce > > drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h > b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h > index 132a9e5bb540..a8b004af781c 100644 > --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h > +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h > @@ -690,7 +690,7 @@ static inline void __cn10k_aura_freeptr(struct otx2_nic > *pfvf, u64 aura, > u64 size = 0, count_eot = 0; > u64 tar_addr, val = 0; > > - lmt_info = get_cpu_ptr(pfvf->hw.lmt_info); > + lmt_info = per_cpu_ptr(pfvf->hw.lmt_info, smp_processor_id()); > tar_addr = (__force u64)otx2_get_regaddr(pfvf, NPA_LF_AURA_BATCH_FREE0); > /* LMTID is same as AURA Id */ > val = (lmt_info->lmt_id & 0x7FF) | BIT_ULL(63); > @@ -711,7 +711,6 @@ static inline void __cn10k_aura_freeptr(struct otx2_nic > *pfvf, u64 aura, > } > dma_wmb(); > memcpy((u64 *)lmt_info->lmt_addr, ptrs, sizeof(u64) * num_ptrs); > - put_cpu_ptr(pfvf->hw.lmt_info); > /* Perform LMTST flush */ > cn10k_lmt_flush(val, tar_addr); > } > -- > 2.38.1 >
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#12145): https://lists.yoctoproject.org/g/linux-yocto/message/12145 Mute This Topic: https://lists.yoctoproject.org/mt/96695025/21656 Group Owner: [email protected] Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/leave/6687884/21656/624485779/xyzzy [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
