All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] crypto: caam - fix RNG deinstantiation error checking
@ 2017-04-05  8:41 Horia Geantă
  2017-04-05 14:09 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Horia Geantă @ 2017-04-05  8:41 UTC (permalink / raw)
  To: Herbert Xu
  Cc: David S. Miller, linux-crypto, Dan Douglass, Alexandru Porosanu

RNG instantiation was previously fixed by
commit 62743a4145bb9 ("crypto: caam - fix RNG init descriptor ret. code checking")
while deinstantiation was not addressed.

Since the descriptors used are similar, in the sense that they both end
with a JUMP HALT command, checking for errors should be similar too,
i.e. status code 7000_0000h should be considered successful.

Cc: <stable@vger.kernel.org> # 3.13+
Fixes: 1005bccd7a4a6 ("crypto: caam - enable instantiation of all RNG4 state handles")
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
---
 drivers/crypto/caam/ctrl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c
index b3a94d5eff26..b7a36af5008d 100644
--- a/drivers/crypto/caam/ctrl.c
+++ b/drivers/crypto/caam/ctrl.c
@@ -285,7 +285,8 @@ static int deinstantiate_rng(struct device *ctrldev, int state_handle_mask)
 			/* Try to run it through DECO0 */
 			ret = run_descriptor_deco0(ctrldev, desc, &status);
 
-			if (ret || status) {
+			if (ret ||
+			    (status && status != JRSTA_SSRC_JUMP_HALT_CC)) {
 				dev_err(ctrldev,
 					"Failed to deinstantiate RNG4 SH%d\n",
 					sh_idx);
-- 
2.12.0.264.gd6db3f216544

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

* Re: [PATCH] crypto: caam - fix RNG deinstantiation error checking
  2017-04-05  8:41 [PATCH] crypto: caam - fix RNG deinstantiation error checking Horia Geantă
@ 2017-04-05 14:09 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2017-04-05 14:09 UTC (permalink / raw)
  To: Horia Geantă
  Cc: David S. Miller, linux-crypto, Dan Douglass, Alexandru Porosanu

On Wed, Apr 05, 2017 at 11:41:03AM +0300, Horia Geantă wrote:
> RNG instantiation was previously fixed by
> commit 62743a4145bb9 ("crypto: caam - fix RNG init descriptor ret. code checking")
> while deinstantiation was not addressed.
> 
> Since the descriptors used are similar, in the sense that they both end
> with a JUMP HALT command, checking for errors should be similar too,
> i.e. status code 7000_0000h should be considered successful.
> 
> Cc: <stable@vger.kernel.org> # 3.13+
> Fixes: 1005bccd7a4a6 ("crypto: caam - enable instantiation of all RNG4 state handles")
> Signed-off-by: Horia Geantă <horia.geanta@nxp.com>

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] 2+ messages in thread

end of thread, other threads:[~2017-04-05 14:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-05  8:41 [PATCH] crypto: caam - fix RNG deinstantiation error checking Horia Geantă
2017-04-05 14:09 ` Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.