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

crypto: sun8i-ce - call finalize with bh disabled

Doing ipsec produces a spinlock recursion warning.
This is due to not disabling BH during crypto completion function.

Fixes: 06f751b61329 ("crypto: allwinner - Add sun8i-ce Crypto Engine")
Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Corentin Labbe and committed by
Herbert Xu
f75a749b b169b376

+6
+3
drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c
··· 11 11 * You could find a link for the datasheet in Documentation/arm/sunxi.rst 12 12 */ 13 13 14 + #include <linux/bottom_half.h> 14 15 #include <linux/crypto.h> 15 16 #include <linux/dma-mapping.h> 16 17 #include <linux/io.h> ··· 284 283 285 284 flow = rctx->flow; 286 285 err = sun8i_ce_run_task(ce, flow, crypto_tfm_alg_name(breq->base.tfm)); 286 + local_bh_disable(); 287 287 crypto_finalize_skcipher_request(engine, breq, err); 288 + local_bh_enable(); 288 289 return 0; 289 290 } 290 291
+3
drivers/crypto/allwinner/sun8i-ce/sun8i-ce-hash.c
··· 9 9 * 10 10 * You could find the datasheet in Documentation/arm/sunxi.rst 11 11 */ 12 + #include <linux/bottom_half.h> 12 13 #include <linux/dma-mapping.h> 13 14 #include <linux/pm_runtime.h> 14 15 #include <linux/scatterlist.h> ··· 415 414 theend: 416 415 kfree(buf); 417 416 kfree(result); 417 + local_bh_disable(); 418 418 crypto_finalize_hash_request(engine, breq, err); 419 + local_bh_enable(); 419 420 return 0; 420 421 }