2022-02-21 17:42:07

by Corentin LABBE

[permalink] [raw]
Subject: [PATCH 0/5] crypto: completion should be ran with BH disabled

Hello

This is the follow up of https://lore.kernel.org/lkml/Yd1SIHUNdLIvKhzz@Red/
and https://patchwork.kernel.org/project/linux-crypto/patch/[email protected]/
This serie fix all drivers which do not call completion with BH disabled
and add the check in crypto/engine asked by Herbert.
I have verified that this check does not generate warnings on all other crypto
hardware I got (omap, ccree, rockchip)

Regards

Corentin Labbe (5):
crypto: sun8i-ss: call finalize with bh disabled
crypto: sun8i-ce: call finalize with bh disabled
crypto: amlogic: call finalize with bh disabled
crypto: gemini: call finalize with bh disabled
crypto: engine: check if BH is disabled during completion

crypto/crypto_engine.c | 1 +
drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c | 3 +++
drivers/crypto/allwinner/sun8i-ce/sun8i-ce-hash.c | 3 +++
drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c | 3 +++
drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c | 3 +++
drivers/crypto/amlogic/amlogic-gxl-cipher.c | 2 ++
drivers/crypto/gemini/sl3516-ce-cipher.c | 2 ++
7 files changed, 17 insertions(+)

--
2.34.1


2022-02-21 18:21:11

by Corentin LABBE

[permalink] [raw]
Subject: [PATCH 3/5] crypto: amlogic: call finalize with bh disabled

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

Fixes: 48fe583fe541 ("crypto: amlogic - Add crypto accelerator for amlogic GXL")
Signed-off-by: Corentin Labbe <[email protected]>
---
drivers/crypto/amlogic/amlogic-gxl-cipher.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/crypto/amlogic/amlogic-gxl-cipher.c b/drivers/crypto/amlogic/amlogic-gxl-cipher.c
index c6865cbd334b..e79514fce731 100644
--- a/drivers/crypto/amlogic/amlogic-gxl-cipher.c
+++ b/drivers/crypto/amlogic/amlogic-gxl-cipher.c
@@ -265,7 +265,9 @@ static int meson_handle_cipher_request(struct crypto_engine *engine,
struct skcipher_request *breq = container_of(areq, struct skcipher_request, base);

err = meson_cipher(breq);
+ local_bh_disable();
crypto_finalize_skcipher_request(engine, breq, err);
+ local_bh_enable();

return 0;
}
--
2.34.1