[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4c787fc1-637d-41dd-84eb-d11fbd71ddfb@roeck-us.net>
Date: Mon, 2 Jun 2025 22:44:25 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Huacai Chen <chenhuacai@...ngson.cn>
Cc: Arnd Bergmann <arnd@...db.de>, Huacai Chen <chenhuacai@...il.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
linux-arch@...r.kernel.org, Ard Biesheuvel <ardb@...nel.org>,
"David S . Miller" <davem@...emloft.net>,
Eric Biggers <ebiggers@...nel.org>, linux-crypto@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] asm-generic: Add sched.h inclusion in simd.h
On Fri, May 30, 2025 at 12:16:58PM +0800, Huacai Chen wrote:
> Commit 7ba8df47810f073 ("asm-generic: Make simd.h more resilient")
> causes a build error for PREEMPT_RT kernels:
>
> CC lib/crypto/sha256.o
> In file included from ./include/asm-generic/simd.h:6,
> from ./arch/loongarch/include/generated/asm/simd.h:1,
> from ./include/crypto/internal/simd.h:9,
> from ./include/crypto/internal/sha2.h:6,
> from lib/crypto/sha256.c:15:
> ./include/asm-generic/simd.h: In function 'may_use_simd':
> ./include/linux/preempt.h:111:34: error: 'current' undeclared (first use in this function)
> 111 | # define softirq_count() (current->softirq_disable_cnt & SOFTIRQ_MASK)
> | ^~~~~~~
> ./include/linux/preempt.h:112:82: note: in expansion of macro 'softirq_count'
> 112 | # define irq_count() ((preempt_count() & (NMI_MASK | HARDIRQ_MASK)) | softirq_count())
> | ^~~~~~~~~~~~~
> ./include/linux/preempt.h:143:34: note: in expansion of macro 'irq_count'
> 143 | #define in_interrupt() (irq_count())
> | ^~~~~~~~~
> ./include/asm-generic/simd.h:18:17: note: in expansion of macro 'in_interrupt'
> 18 | return !in_interrupt();
> | ^~~~~~~~~~~~
>
> So add sched.h inclusion in simd.h to fix it.
>
> Fixes: 7ba8df47810f073 ("asm-generic: Make simd.h more resilient")
> Signed-off-by: Huacai Chen <chenhuacai@...ngson.cn>
Tested-by: Guenter Roeck <linux@...ck-us.net>
> ---
> include/asm-generic/simd.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/asm-generic/simd.h b/include/asm-generic/simd.h
> index ac29a22eb7cf..70c8716ad32a 100644
> --- a/include/asm-generic/simd.h
> +++ b/include/asm-generic/simd.h
> @@ -4,6 +4,7 @@
>
> #include <linux/compiler_attributes.h>
> #include <linux/preempt.h>
> +#include <linux/sched.h>
> #include <linux/types.h>
>
> /*
Powered by blists - more mailing lists