* [PATCH] crypto: caam: jr: Use dedicated shutdown callback
@ 2026-10-28 13:28 Fabio Estevam
2026-11-12 10:05 ` Herbert Xu
2026-11-12 10:41 ` Sahil Malhotra
0 siblings, 2 replies; 4+ messages in thread
From: Fabio Estevam @ 2026-10-28 13:28 UTC (permalink / raw)
To: herbert
Cc: horia.geanta, pankaj.gupta, sahil.malhotra, gaurav.jain,
linux-crypto, linux-kernel, Fabio Estevam, stable
From: Fabio Estevam <festevam@nabladev.com>
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@vger.kernel.org
Fixes: c007e720989e ("crypto: caam/jr - add .shutdown hook")
Signed-off-by: Fabio Estevam <festevam@nabladev.com>
---
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] crypto: caam: jr: Use dedicated shutdown callback
2026-10-28 13:28 [PATCH] crypto: caam: jr: Use dedicated shutdown callback Fabio Estevam
@ 2026-11-12 10:05 ` Herbert Xu
2026-11-12 10:41 ` Sahil Malhotra
1 sibling, 0 replies; 4+ messages in thread
From: Herbert Xu @ 2026-11-12 10:05 UTC (permalink / raw)
To: Fabio Estevam
Cc: horia.geanta, pankaj.gupta, sahil.malhotra, gaurav.jain,
linux-crypto, linux-kernel, Fabio Estevam, stable
On Wed, Oct 28, 2026 at 10:28:25AM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <festevam@nabladev.com>
>
> 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@vger.kernel.org
> Fixes: c007e720989e ("crypto: caam/jr - add .shutdown hook")
> Signed-off-by: Fabio Estevam <festevam@nabladev.com>
> ---
> drivers/crypto/caam/jr.c | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] crypto: caam: jr: Use dedicated shutdown callback
2026-10-28 13:28 [PATCH] crypto: caam: jr: Use dedicated shutdown callback Fabio Estevam
2026-11-12 10:05 ` Herbert Xu
@ 2026-11-12 10:41 ` Sahil Malhotra
2026-11-12 11:48 ` Fabio Estevam
1 sibling, 1 reply; 4+ messages in thread
From: Sahil Malhotra @ 2026-11-12 10:41 UTC (permalink / raw)
To: Fabio Estevam
Cc: Fabio Estevam, herbert, horia.geanta, pankaj.gupta, gaurav.jain,
linux-crypto, linux-kernel, stable
On Wed, Oct 28, 2026 at 10:28:25AM -0300, Fabio Estevam wrote:
> 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
[...]
> Tested on a i.MX8MP custom-board.
Hi Fabio,
Thanks for the patch.
Can you please tell me how to reproduce this issue ?
Thanks,
Sahil
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] crypto: caam: jr: Use dedicated shutdown callback
2026-11-12 10:41 ` Sahil Malhotra
@ 2026-11-12 11:48 ` Fabio Estevam
0 siblings, 0 replies; 4+ messages in thread
From: Fabio Estevam @ 2026-11-12 11:48 UTC (permalink / raw)
To: Sahil Malhotra
Cc: Fabio Estevam, herbert, horia.geanta, pankaj.gupta, gaurav.jain,
linux-crypto, linux-kernel, stable
Hi Sahil,
On Thu, Nov 12, 2026 at 7:41 AM Sahil Malhotra
<sahil.malhotra@oss.nxp.com> wrote:
> Hi Fabio,
>
> Thanks for the patch.
> Can you please tell me how to reproduce this issue ?
I observed the warning during a normal reboot on an i.MX8MP-based
system with CAAM enabled and an encrypted volume:
caam_jr 30903000.jr: Device is busy; consumers might start to crash
It happened in all 'reboot' cycles, so it's 100% deterministic.
The warning occurs when crypto consumers still hold references to the
job ring during shutdown.
The patch allows the shutdown callback to quiesce the hardware without
requiring consumers to release their references first.
Regards,
Fabio Estevam
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-11-12 11:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-28 13:28 [PATCH] crypto: caam: jr: Use dedicated shutdown callback Fabio Estevam
2026-11-12 10:05 ` Herbert Xu
2026-11-12 10:41 ` Sahil Malhotra
2026-11-12 11:48 ` Fabio Estevam
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox