Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: caam - fix RNG init descriptor ret. code checking

When successful, the descriptor that performs RNG initialization
is allowed to return a status code of 7000_0000h, since last command
in the descriptor is a JUMP HALT.

Signed-off-by: Horia Geant? <horia.geanta@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Horia Geant? and committed by
Herbert Xu
62743a41 f1096749

+3 -2
+3 -2
drivers/crypto/caam/ctrl.c
··· 175 175 { 176 176 struct caam_drv_private *ctrlpriv = dev_get_drvdata(ctrldev); 177 177 struct caam_ctrl __iomem *ctrl; 178 - u32 *desc, status, rdsta_val; 178 + u32 *desc, status = 0, rdsta_val; 179 179 int ret = 0, sh_idx; 180 180 181 181 ctrl = (struct caam_ctrl __iomem *)ctrlpriv->ctrl; ··· 207 207 * CAAM eras), then try again. 208 208 */ 209 209 rdsta_val = rd_reg32(&ctrl->r4tst[0].rdsta) & RDSTA_IFMASK; 210 - if (status || !(rdsta_val & (1 << sh_idx))) 210 + if ((status && status != JRSTA_SSRC_JUMP_HALT_CC) || 211 + !(rdsta_val & (1 << sh_idx))) 211 212 ret = -EAGAIN; 212 213 if (ret) 213 214 break;