diff options
author | Romain Perier <romain.perier@free-electrons.com> | 2016-06-21 10:08:32 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2016-06-23 12:14:00 +0200 |
commit | f62830886f6b8cb2f1c55e23cb5eab51c4b9ef2c (patch) | |
tree | 0bac261d8f9d3e60f43ad678c13d15b67002ef1e /drivers/crypto/marvell/cipher.c | |
parent | crypto: marvell - Add a macro constant for the size of the crypto queue (diff) | |
download | linux-f62830886f6b8cb2f1c55e23cb5eab51c4b9ef2c.tar.xz linux-f62830886f6b8cb2f1c55e23cb5eab51c4b9ef2c.zip |
crypto: marvell - Check engine is not already running when enabling a req
Add a BUG_ON() call when the driver tries to launch a crypto request
while the engine is still processing the previous one. This replaces
a silent system hang by a verbose kernel panic with the associated
backtrace to let the user know that something went wrong in the CESA
driver.
Signed-off-by: Romain Perier <romain.perier@free-electrons.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/marvell/cipher.c')
-rw-r--r-- | drivers/crypto/marvell/cipher.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/crypto/marvell/cipher.c b/drivers/crypto/marvell/cipher.c index dcf1fceb9336..8c1432e44338 100644 --- a/drivers/crypto/marvell/cipher.c +++ b/drivers/crypto/marvell/cipher.c @@ -106,6 +106,8 @@ static void mv_cesa_ablkcipher_std_step(struct ablkcipher_request *req) mv_cesa_set_int_mask(engine, CESA_SA_INT_ACCEL0_DONE); writel_relaxed(CESA_SA_CFG_PARA_DIS, engine->regs + CESA_SA_CFG); + BUG_ON(readl(engine->regs + CESA_SA_CMD) & + CESA_SA_CMD_EN_CESA_SA_ACCL0); writel(CESA_SA_CMD_EN_CESA_SA_ACCL0, engine->regs + CESA_SA_CMD); } |