[PATCH] crypto: inside-secure: initialize EIP93 state before requesting IRQ

From: Runyu Xiao

Date: Wed Sep 30 2026 - 05:35:50 EST


devm_request_threaded_irq() can invoke the handler as soon as
registration starts. The EIP93 probe currently requests the IRQ
before allocating the descriptor rings and initializing the tasklet,
locks, and IDR used by the handler.

Initialize the software and hardware state, and disable the device
interrupts, before requesting the IRQ. The existing interrupt enable
remains after successful IRQ registration.

Fixes: 9739f5f93b78 ("crypto: eip93 - Add Inside Secure SafeXcel EIP-93 crypto engine support")
Cc: stable@xxxxxxxxxxxxxxx
Assisted-by: LLM
Signed-off-by: Runyu Xiao <runyu.xiao@xxxxxxxxxx>
---
drivers/crypto/inside-secure/eip93/eip93-main.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/crypto/inside-secure/eip93/eip93-main.c b/drivers/crypto/inside-secure/eip93/eip93-main.c
index e62785952..06c8d771a 100644
--- a/drivers/crypto/inside-secure/eip93/eip93-main.c
+++ b/drivers/crypto/inside-secure/eip93/eip93-main.c
@@ -430,12 +430,6 @@ static int eip93_crypto_probe(struct platform_device *pdev)
if (eip93->irq < 0)
return eip93->irq;

- ret = devm_request_threaded_irq(eip93->dev, eip93->irq, eip93_irq_handler,
- NULL, IRQF_ONESHOT,
- dev_name(eip93->dev), eip93);
- if (ret)
- return ret;
-
ret = eip93_desc_init(eip93);
if (ret)
return ret;
@@ -452,6 +446,12 @@ static int eip93_crypto_probe(struct platform_device *pdev)

eip93_initialize(eip93, algo_flags);

+ ret = devm_request_threaded_irq(eip93->dev, eip93->irq, eip93_irq_handler,
+ NULL, IRQF_ONESHOT,
+ dev_name(eip93->dev), eip93);
+ if (ret)
+ return ret;
+
/* Init finished, enable RDR interrupt */
eip93_irq_enable(eip93, EIP93_INT_RDR_THRESH);

--
2.34.1