[PATCH] crypto: caam: jr: Use dedicated shutdown callback
From: Fabio Estevam
Date: Wed Oct 28 2026 - 09:33:34 EST
From: Fabio Estevam <festevam@xxxxxxxxxxxx>
The CAAM job ring platform driver uses caam_jr_remove() as its
shutdown callback.
The remove path refuses to shut down a job ring while crypto
consumers still hold references to it. This is necessary during
driver unbinding, but causes the following warning on reboot:
caam_jr 30903000.jr: Device is busy; consumers might start to crash
Unlike driver removal, system shutdown does not require
unregistering crypto algorithms or releasing driver resources.
Introduce a dedicated platform shutdown callback that shuts down
the hardware job ring without checking consumer references.
Keep the reference checks and algorithm unregistration in the
remove path.
Tested on a i.MX8MP custom-board.
Cc: stable@xxxxxxxxxxxxxxx
Fixes: c007e720989e ("crypto: caam/jr - add .shutdown hook")
Signed-off-by: Fabio Estevam <festevam@xxxxxxxxxxxx>
---
drivers/crypto/caam/jr.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/crypto/caam/jr.c b/drivers/crypto/caam/jr.c
index cf725a6ac0fb..75be668b74b8 100644
--- a/drivers/crypto/caam/jr.c
+++ b/drivers/crypto/caam/jr.c
@@ -178,6 +178,15 @@ static int caam_jr_shutdown(struct device *dev)
return ret;
}
+static void caam_jr_platform_shutdown(struct platform_device *pdev)
+{
+ int ret;
+
+ ret = caam_jr_shutdown(&pdev->dev);
+ if (ret)
+ dev_err(&pdev->dev, "Failed to shut down job ring: %d\n", ret);
+}
+
static void caam_jr_remove(struct platform_device *pdev)
{
int ret;
@@ -812,7 +821,7 @@ static struct platform_driver caam_jr_driver = {
},
.probe = caam_jr_probe,
.remove = caam_jr_remove,
- .shutdown = caam_jr_remove,
+ .shutdown = caam_jr_platform_shutdown,
};
static int __init jr_driver_init(void)
--
2.43.0