[PATCH net] net: airoha: Fix PPE table access in airoha_ppe_debugfs_foe_show()

Lorenzo Bianconi lorenzo at kernel.org
Thu Jul 31 02:20:57 PDT 2025


> On Mon, 28 Jul 2025 13:58:08 +0200 Lorenzo Bianconi wrote:
> > +struct airoha_foe_entry *
> > +airoha_ppe_foe_get_entry_locked(struct airoha_ppe *ppe, u32 hash)
> 
> Hm, could be just me, but the way we/I used _locked in the core was 
> the opposite. _locked means the caller's already taken the lock.
> Here you seem to be saying that the "callee is locked"..
> Can we stick to core's interpretation?

sure, that's fine.

> 
> > +	struct airoha_foe_entry *hwe;
> > +
> > +	spin_lock_bh(&ppe_lock);
> > +	hwe = airoha_ppe_foe_get_entry(ppe, hash);
> > +	spin_unlock_bh(&ppe_lock);
> > +
> > +	return hwe;
> 
> Is the lifetime of the hwe object somehow guaranteed in the debugfs
> code? Looks questionable..

PPE table entries are allocated at driver load and never freed, the hw is just
writing into this DMA area when the entry is binded.

Regards,
Lorenzo

> -- 
> pw-bot: cr
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-mediatek/attachments/20250731/47e8fe8c/attachment.sig>


More information about the Linux-mediatek mailing list