From: Herbert Xu Date: Mon, 23 May 2005 19:36:25 +0000 (-0700) Subject: [CRYPTO]: Only reschedule if !in_atomic() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=15333038d577b0c0255c0f14a38d9e6895937453;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [CRYPTO]: Only reschedule if !in_atomic() The netlink gfp_any() problem made me double-check the uses of in_softirq() in crypto/*. It seems to me that we should be checking in_atomic() instead of in_softirq() in crypto_yield. Otherwise people calling the crypto ops with spin locks held or preemption disabled will get burnt, right? Signed-off-by: David S. Miller --- diff --git a/crypto/internal.h b/crypto/internal.h index e68e43886d3c..964b9a60ca24 100644 --- a/crypto/internal.h +++ b/crypto/internal.h @@ -38,7 +38,7 @@ static inline void crypto_kunmap(void *vaddr, int out) static inline void crypto_yield(struct crypto_tfm *tfm) { - if (!in_softirq()) + if (!in_atomic()) cond_resched(); }