[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220822111903.328957-1-kshitiz.varshney@nxp.com>
Date: Mon, 22 Aug 2022 13:19:03 +0200
From: Kshitiz Varshney <kshitiz.varshney@....com>
To: Horia Geanta <horia.geanta@....com>,
Pankaj Gupta <pankaj.gupta@....com>,
Varun Sethi <V.Sethi@....com>,
Herbert Xu <herbert@...dor.apana.org.au>,
"David S . Miller" <davem@...emloft.net>,
Iuliana Prodan <iuliana.prodan@....com>,
Gaurav Jain <gaurav.jain@....com>,
Rahul Kumar Yadav <rahulkumar.yadav@....com>,
Vabhav Sharma <vabhav.sharma@....com>,
Sahil Malhotra <sahil.malhotra@....com>,
Matt Mackall <mpm@...enic.com>,
Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>,
Steffen Trumtrar <s.trumtrar@...gutronix.de>,
PrasannaKumar Muralidharan <prasannatsmkumar@...il.com>,
Martin Kaiser <martin@...ser.cx>
Cc: linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-imx@....com, linux-arm-kernel@...ts.infradead.org,
Kshitiz Varshney <kshitiz.varshney@....com>
Subject: [PATCH v1] Moving IRQ handler registering after imx_rngc_irq_mask_clear()
Issue:
While servicing interrupt, if the IRQ happens to be because of a SEED_DONE
due to a previous boot stage, you end up completing the completion
prematurely, hence causing kernel to crash while booting.
Fix:
Moving IRQ handler registering after imx_rngc_irq_mask_clear()
Fixes: 1d5449445bd0 (hwrng: mx-rngc - add a driver for Freescale RNGC)
Signed-off-by: Kshitiz Varshney <kshitiz.varshney@....com>
---
drivers/char/hw_random/imx-rngc.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/char/hw_random/imx-rngc.c b/drivers/char/hw_random/imx-rngc.c
index 53e571c4f283..0b71ed850809 100644
--- a/drivers/char/hw_random/imx-rngc.c
+++ b/drivers/char/hw_random/imx-rngc.c
@@ -272,14 +272,6 @@ static int imx_rngc_probe(struct platform_device *pdev)
init_completion(&rngc->rng_op_done);
- ret = devm_request_irq(&pdev->dev,
- irq, imx_rngc_irq, 0, pdev->name, (void *)rngc);
- if (ret) {
- dev_err(rngc->dev, "Can't get interrupt working.\n");
- goto err;
- }
-
-
rngc->rng.name = pdev->name;
rngc->rng.init = imx_rngc_init;
rngc->rng.read = imx_rngc_read;
@@ -291,6 +283,14 @@ static int imx_rngc_probe(struct platform_device *pdev)
imx_rngc_irq_mask_clear(rngc);
+
+ ret = devm_request_irq(&pdev->dev,
+ irq, imx_rngc_irq, 0, pdev->name, (void *)rngc);
+
+ if (ret) {
+ dev_err(rngc->dev, "Can't get interrupt working.\n");
+ goto err;
+ }
if (self_test) {
ret = imx_rngc_self_test(rngc);
if (ret) {
--
2.25.1
Powered by blists - more mailing lists