Moving IRQ handler registering after imx_rngc_irq_mask_clear()
PATCH 1/1 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 <[email protected]>
--- drivers/char/hw_random/imx-rngc.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/char/hw_random/imx-rngc.c +8 -8
@@ -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) {
Signature · 1 line
2.25.1
Herbert Xu
maintainerQuoted 5 lines · Kshitiz Varshney
Issue:
While servicing interrupt, if the IRQ happens to be because of aSEED_DONEdue to a previous boot stage, you end up completing the completion prematurely, hence causing kernel to crash while booting.
Quoted 8 lines
Fix:
Moving IRQ handler registering afterimx_rngc_irq_mask_clear()Fixes 1d5449445bd0 (hwrng: mx-rngc - add a driver for Freescale RNGC)Signed-off-by Kshitiz Varshney <[email protected]>--- drivers/char/hw_random/imx-rngc.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
Patch applied. Thanks.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt