Skip to content

Commit d93a2f8

Browse files
meremSTgregkh
authored andcommitted
crypto: stm32/cryp - call finalize with bh disabled
[ Upstream commit 56ddb9a ] The finalize operation in interrupt mode produce a produces a spinlock recursion warning. The reason is the fact that BH must be disabled during this process. Signed-off-by: Maxime Méré <[email protected]> Signed-off-by: Herbert Xu <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 68957f5 commit d93a2f8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/crypto/stm32/stm32-cryp.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <crypto/internal/des.h>
1212
#include <crypto/internal/skcipher.h>
1313
#include <crypto/scatterwalk.h>
14+
#include <linux/bottom_half.h>
1415
#include <linux/clk.h>
1516
#include <linux/delay.h>
1617
#include <linux/err.h>
@@ -1665,8 +1666,11 @@ static irqreturn_t stm32_cryp_irq_thread(int irq, void *arg)
16651666
it_mask &= ~IMSCR_OUT;
16661667
stm32_cryp_write(cryp, cryp->caps->imsc, it_mask);
16671668

1668-
if (!cryp->payload_in && !cryp->header_in && !cryp->payload_out)
1669+
if (!cryp->payload_in && !cryp->header_in && !cryp->payload_out) {
1670+
local_bh_disable();
16691671
stm32_cryp_finish_req(cryp, 0);
1672+
local_bh_enable();
1673+
}
16701674

16711675
return IRQ_HANDLED;
16721676
}

0 commit comments

Comments
 (0)