stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/6] hwrng: imx-rngc - fix an error path
       [not found] <20200128110102.11522-1-martin@kaiser.cx>
@ 2020-01-28 11:00 ` Martin Kaiser
  2020-02-12 16:22   ` PrasannaKumar Muralidharan
       [not found] ` <20200305205824.4371-1-martin@kaiser.cx>
  1 sibling, 1 reply; 3+ messages in thread
From: Martin Kaiser @ 2020-01-28 11:00 UTC (permalink / raw)
  To: Herbert Xu, PrasannaKumar Muralidharan, NXP Linux Team
  Cc: linux-crypto, linux-arm-kernel, linux-kernel, Martin Kaiser, stable

Make sure that the rngc interrupt is masked if the rngc self test fails.
Self test failure means that probe fails as well. Interrupts should be
masked in this case, regardless of the error.

Cc: stable@vger.kernel.org
Fixes: 1d5449445bd0 ("hwrng: mx-rngc - add a driver for Freescale RNGC")
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/char/hw_random/imx-rngc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/char/hw_random/imx-rngc.c b/drivers/char/hw_random/imx-rngc.c
index 30cf00f8e9a0..0576801944fd 100644
--- a/drivers/char/hw_random/imx-rngc.c
+++ b/drivers/char/hw_random/imx-rngc.c
@@ -105,8 +105,10 @@ static int imx_rngc_self_test(struct imx_rngc *rngc)
 		return -ETIMEDOUT;
 	}
 
-	if (rngc->err_reg != 0)
+	if (rngc->err_reg != 0) {
+		imx_rngc_irq_mask_clear(rngc);
 		return -EIO;
+	}
 
 	return 0;
 }
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/6] hwrng: imx-rngc - fix an error path
  2020-01-28 11:00 ` [PATCH 1/6] hwrng: imx-rngc - fix an error path Martin Kaiser
@ 2020-02-12 16:22   ` PrasannaKumar Muralidharan
  0 siblings, 0 replies; 3+ messages in thread
From: PrasannaKumar Muralidharan @ 2020-02-12 16:22 UTC (permalink / raw)
  To: Martin Kaiser
  Cc: Herbert Xu, NXP Linux Team,
	open list:HARDWARE RANDOM NUMBER GENERATOR CORE,
	linux-arm-kernel, open list, stable

Hi Martin,

On Tue, 28 Jan 2020 at 16:31, Martin Kaiser <martin@kaiser.cx> wrote:
>
> Make sure that the rngc interrupt is masked if the rngc self test fails.
> Self test failure means that probe fails as well. Interrupts should be
> masked in this case, regardless of the error.
>
> Cc: stable@vger.kernel.org
> Fixes: 1d5449445bd0 ("hwrng: mx-rngc - add a driver for Freescale RNGC")
> Signed-off-by: Martin Kaiser <martin@kaiser.cx>
> ---
>  drivers/char/hw_random/imx-rngc.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/char/hw_random/imx-rngc.c b/drivers/char/hw_random/imx-rngc.c
> index 30cf00f8e9a0..0576801944fd 100644
> --- a/drivers/char/hw_random/imx-rngc.c
> +++ b/drivers/char/hw_random/imx-rngc.c
> @@ -105,8 +105,10 @@ static int imx_rngc_self_test(struct imx_rngc *rngc)
>                 return -ETIMEDOUT;
>         }
>
> -       if (rngc->err_reg != 0)
> +       if (rngc->err_reg != 0) {
> +               imx_rngc_irq_mask_clear(rngc);
>                 return -EIO;
> +       }
>
>         return 0;
>  }
> --
> 2.20.1
>

Looks good to me. You can add
Reviewed-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>

Regards,
PrasannaKumar

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v2 1/5] hwrng: imx-rngc - fix an error path
       [not found] ` <20200305205824.4371-1-martin@kaiser.cx>
@ 2020-03-05 20:58   ` Martin Kaiser
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Kaiser @ 2020-03-05 20:58 UTC (permalink / raw)
  To: Herbert Xu, PrasannaKumar Muralidharan, NXP Linux Team
  Cc: linux-crypto, linux-arm-kernel, linux-kernel, Martin Kaiser, stable

Make sure that the rngc interrupt is masked if the rngc self test fails.
Self test failure means that probe fails as well. Interrupts should be
masked in this case, regardless of the error.

Cc: stable@vger.kernel.org
Fixes: 1d5449445bd0 ("hwrng: mx-rngc - add a driver for Freescale RNGC")
Reviewed-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/char/hw_random/imx-rngc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/char/hw_random/imx-rngc.c b/drivers/char/hw_random/imx-rngc.c
index 30cf00f8e9a0..0576801944fd 100644
--- a/drivers/char/hw_random/imx-rngc.c
+++ b/drivers/char/hw_random/imx-rngc.c
@@ -105,8 +105,10 @@ static int imx_rngc_self_test(struct imx_rngc *rngc)
 		return -ETIMEDOUT;
 	}
 
-	if (rngc->err_reg != 0)
+	if (rngc->err_reg != 0) {
+		imx_rngc_irq_mask_clear(rngc);
 		return -EIO;
+	}
 
 	return 0;
 }
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-05 21:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20200128110102.11522-1-martin@kaiser.cx>
2020-01-28 11:00 ` [PATCH 1/6] hwrng: imx-rngc - fix an error path Martin Kaiser
2020-02-12 16:22   ` PrasannaKumar Muralidharan
     [not found] ` <20200305205824.4371-1-martin@kaiser.cx>
2020-03-05 20:58   ` [PATCH v2 1/5] " Martin Kaiser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).