Skip to content

Commit 2e7d1d6

Browse files
sm00thherbertx
authored andcommitted
crypto: sun4i_ss_prng - convert lock to _bh in sun4i_ss_prng_generate
Lockdep detects a possible deadlock in sun4i_ss_prng_generate() and throws an "inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage" warning. Disabling softirqs to fix this. Fixes: b8ae5c7 ("crypto: sun4i-ss - support the Security System PRNG") Signed-off-by: Artem Savkov <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent dd78c83 commit 2e7d1d6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/crypto/sunxi-ss/sun4i-ss-prng.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ int sun4i_ss_prng_generate(struct crypto_rng *tfm, const u8 *src,
2828
algt = container_of(alg, struct sun4i_ss_alg_template, alg.rng);
2929
ss = algt->ss;
3030

31-
spin_lock(&ss->slock);
31+
spin_lock_bh(&ss->slock);
3232

3333
writel(mode, ss->base + SS_CTL);
3434

@@ -51,6 +51,6 @@ int sun4i_ss_prng_generate(struct crypto_rng *tfm, const u8 *src,
5151
}
5252

5353
writel(0, ss->base + SS_CTL);
54-
spin_unlock(&ss->slock);
54+
spin_unlock_bh(&ss->slock);
5555
return 0;
5656
}

0 commit comments

Comments
 (0)