[SRU][J/N:linux-bluefield][PATCH v1 1/1] UBUNTU: SAUCE: platform/mellanox: fix the PKA shim mutex initialization issue

Ron Li xiangrongl at nvidia.com
Thu Oct 9 17:56:50 UTC 2025


BugLink: https://bugs.launchpad.net/bugs/2127200

Moved the initialization of shim->mutex before the TRNG related operations.

Reviewed-by: David Thompson  <davthompson at nvidia.com>
Signed-off-by: Ron Li <xiangrongl at nvidia.com>
---
 drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_dev.c b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_dev.c
index bf987eed52cd..f46c6d43f4ed 100644
--- a/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_dev.c
+++ b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_dev.c
@@ -1815,6 +1815,7 @@ static int pka_dev_init_shim(pka_dev_shim_t *shim)
 
     shim->trng_enabled   = PKA_SHIM_TRNG_ENABLED;
     shim->trng_err_cycle = 0;
+    mutex_init(&shim->mutex);
 
     // Configure the TRNG
     ret = pka_dev_config_trng_drbg(&shim->resources.aic_csr,
@@ -1839,7 +1840,6 @@ static int pka_dev_init_shim(pka_dev_shim_t *shim)
         shim->trng_enabled = PKA_SHIM_TRNG_DISABLED;
     }
 
-    mutex_init(&shim->mutex);
     shim->busy_ring_num  = 0;
     shim->status         = PKA_SHIM_STATUS_INITIALIZED;
 
-- 
2.43.2




More information about the kernel-team mailing list