[PATCH v2 2/7] crypto: ti - Fix potential deadlock bug in DTHEv2

From: T Pratham

Date: Thu Aug 27 2026 - 09:25:51 EST


Probe and remove functions use spin_(un)lock for acquiring the
dthe_dev_list.lock. But dthe_get_dev uses the bh variant. Change
spin_(un)lock_bh to spin_(un)lock to avoid potential deadlock when a
softIRQ process tries to acquire the already held lock.

Fixes: 52f641bc63a46 ("crypto: ti - Add driver for DTHE V2 AES Engine (ECB, CBC)")
Signed-off-by: T Pratham <t-pratham@xxxxxx>
---
drivers/crypto/ti/dthev2-common.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/ti/dthev2-common.c b/drivers/crypto/ti/dthev2-common.c
index cc02449382673..4c6b72ba104ec 100644
--- a/drivers/crypto/ti/dthev2-common.c
+++ b/drivers/crypto/ti/dthev2-common.c
@@ -39,11 +39,11 @@ struct dthe_data *dthe_get_dev(struct dthe_tfm_ctx *ctx)
if (ctx->dev_data)
return ctx->dev_data;

- spin_lock_bh(&dthe_dev_list.lock);
+ spin_lock(&dthe_dev_list.lock);
dev_data = list_first_entry_or_null(&dthe_dev_list.dev_list, struct dthe_data, list);
if (dev_data)
list_move_tail(&dev_data->list, &dthe_dev_list.dev_list);
- spin_unlock_bh(&dthe_dev_list.lock);
+ spin_unlock(&dthe_dev_list.lock);

return dev_data;
}
--
2.34.1