net: airoha: Fix PPE table access in airoha_ppe_debugfs_foe_show()
authorLorenzo Bianconi <lorenzo@kernel.org>
Thu, 31 Jul 2025 10:29:08 +0000 (12:29 +0200)
committerJakub Kicinski <kuba@kernel.org>
Fri, 1 Aug 2025 20:52:36 +0000 (13:52 -0700)
commit38358fa3cc8e16c6862a3e5c5c233f9f652e3a6d
tree870a706e68842b07cf55fbbdd8865bc41e54716b
parentf8fded7536a9350ce849f21eee124d66056aa54c
net: airoha: Fix PPE table access in airoha_ppe_debugfs_foe_show()

In order to avoid any possible race we need to hold the ppe_lock
spinlock accessing the hw PPE table. airoha_ppe_foe_get_entry routine is
always executed holding ppe_lock except in airoha_ppe_debugfs_foe_show
routine. Fix the problem introducing airoha_ppe_foe_get_entry_locked
routine.

Fixes: 3fe15c640f380 ("net: airoha: Introduce PPE debugfs support")
Reviewed-by: Dawid Osuchowski <dawid.osuchowski@linux.intel.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20250731-airoha_ppe_foe_get_entry_locked-v2-1-50efbd8c0fd6@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/airoha/airoha_ppe.c