Linux SNPS ARC Archive mirror
 help / color / mirror / Atom feed
* [PATCH] bit_spinlock: Include <asm/processor.h>
@ 2023-01-08 19:04 Christophe JAILLET
  2023-01-09  8:26 ` Dan Carpenter
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Christophe JAILLET @ 2023-01-08 19:04 UTC (permalink / raw
  To: Greg Kroah-Hartman, Vineet Gupta, Dan Carpenter
  Cc: linux-snps-arc, linux-kernel, kernel-janitors, Christophe JAILLET

In an attempt to simplify some includes in <include/dcache.h>, it
appeared, when compiling fs/ecryptfs/dentry.c, that <linux/bit_spinlock.h>
was relying on other includes to get the definition of cpu_relax().
(see [1])

It broke on arc.

Include <asm/processor.h> in <linux/bit_spinlock.h> to fix the issue.
This will help remove some un-needed includes from <include/dcache.h>.

[1]: https://lore.kernel.org/all/202301082130.LXMj5qkD-lkp@intel.com/

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Not sure who to send this to.
get_maintainer.pl is of no help, and the file is untouched from a too long
time.

Greg? Dan? Any pointer?
---
 include/linux/bit_spinlock.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/bit_spinlock.h b/include/linux/bit_spinlock.h
index bbc4730a6505..d0fd2a7afca2 100644
--- a/include/linux/bit_spinlock.h
+++ b/include/linux/bit_spinlock.h
@@ -2,6 +2,7 @@
 #ifndef __LINUX_BIT_SPINLOCK_H
 #define __LINUX_BIT_SPINLOCK_H
 
+#include <asm/processor.h>
 #include <linux/kernel.h>
 #include <linux/preempt.h>
 #include <linux/atomic.h>
-- 
2.34.1


_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] bit_spinlock: Include <asm/processor.h>
  2023-01-08 19:04 [PATCH] bit_spinlock: Include <asm/processor.h> Christophe JAILLET
@ 2023-01-09  8:26 ` Dan Carpenter
  2023-01-09 22:46 ` Andrew Morton
  2023-01-10  7:19 ` Vineet Gupta
  2 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2023-01-09  8:26 UTC (permalink / raw
  To: Christophe JAILLET
  Cc: Greg Kroah-Hartman, Vineet Gupta, linux-snps-arc, linux-kernel,
	kernel-janitors

On Sun, Jan 08, 2023 at 08:04:44PM +0100, Christophe JAILLET wrote:
> In an attempt to simplify some includes in <include/dcache.h>, it
> appeared, when compiling fs/ecryptfs/dentry.c, that <linux/bit_spinlock.h>
> was relying on other includes to get the definition of cpu_relax().
> (see [1])
> 
> It broke on arc.
> 
> Include <asm/processor.h> in <linux/bit_spinlock.h> to fix the issue.
> This will help remove some un-needed includes from <include/dcache.h>.
> 
> [1]: https://lore.kernel.org/all/202301082130.LXMj5qkD-lkp@intel.com/
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> Not sure who to send this to.
> get_maintainer.pl is of no help, and the file is untouched from a too long
> time.
> 
> Greg? Dan? Any pointer?

Andrew Morton is the maintainer of last resort.  Plus spinlocks seem
like something he would be interested in.  Otherwise Ingo, Peter Z and
the x86 team.

regards,
dan carpenter


_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] bit_spinlock: Include <asm/processor.h>
  2023-01-08 19:04 [PATCH] bit_spinlock: Include <asm/processor.h> Christophe JAILLET
  2023-01-09  8:26 ` Dan Carpenter
@ 2023-01-09 22:46 ` Andrew Morton
  2023-01-10  7:19 ` Vineet Gupta
  2 siblings, 0 replies; 6+ messages in thread
From: Andrew Morton @ 2023-01-09 22:46 UTC (permalink / raw
  To: Christophe JAILLET
  Cc: Greg Kroah-Hartman, Vineet Gupta, Dan Carpenter, linux-snps-arc,
	linux-kernel, kernel-janitors

On Sun,  8 Jan 2023 20:04:44 +0100 Christophe JAILLET <christophe.jaillet@wanadoo.fr> wrote:

> In an attempt to simplify some includes in <include/dcache.h>, it
> appeared, when compiling fs/ecryptfs/dentry.c, that <linux/bit_spinlock.h>
> was relying on other includes to get the definition of cpu_relax().
> (see [1])
> 
> It broke on arc.
> 
> Include <asm/processor.h> in <linux/bit_spinlock.h> to fix the issue.
> This will help remove some un-needed includes from <include/dcache.h>.
> 
> [1]: https://lore.kernel.org/all/202301082130.LXMj5qkD-lkp@intel.com/
> 
> ...
>
> --- a/include/linux/bit_spinlock.h
> +++ b/include/linux/bit_spinlock.h
> @@ -2,6 +2,7 @@
>  #ifndef __LINUX_BIT_SPINLOCK_H
>  #define __LINUX_BIT_SPINLOCK_H
>  
> +#include <asm/processor.h>
>  #include <linux/kernel.h>
>  #include <linux/preempt.h>
>  #include <linux/atomic.h>

linux/processor.h would be preferable, rather than diving straight into asm/?

_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] bit_spinlock: Include <asm/processor.h>
  2023-01-08 19:04 [PATCH] bit_spinlock: Include <asm/processor.h> Christophe JAILLET
  2023-01-09  8:26 ` Dan Carpenter
  2023-01-09 22:46 ` Andrew Morton
@ 2023-01-10  7:19 ` Vineet Gupta
  2023-01-10 18:08   ` Christophe JAILLET
  2 siblings, 1 reply; 6+ messages in thread
From: Vineet Gupta @ 2023-01-10  7:19 UTC (permalink / raw
  To: Christophe JAILLET, Greg Kroah-Hartman, Vineet Gupta,
	Dan Carpenter
  Cc: linux-snps-arc, linux-kernel, kernel-janitors


On 1/8/23 11:04, Christophe JAILLET wrote:
> In an attempt to simplify some includes in <include/dcache.h>, it
> appeared, when compiling fs/ecryptfs/dentry.c, that <linux/bit_spinlock.h>
> was relying on other includes to get the definition of cpu_relax().
> (see [1])
>
> It broke on arc.

It its just ARC that broke, maybe we can do something there ?

> Include <asm/processor.h> in <linux/bit_spinlock.h> to fix the issue.
> This will help remove some un-needed includes from <include/dcache.h>.
>
> [1]: https://lore.kernel.org/all/202301082130.LXMj5qkD-lkp@intel.com/
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> Not sure who to send this to.
> get_maintainer.pl is of no help, and the file is untouched from a too long
> time.
>
> Greg? Dan? Any pointer?
> ---
>   include/linux/bit_spinlock.h | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/include/linux/bit_spinlock.h b/include/linux/bit_spinlock.h
> index bbc4730a6505..d0fd2a7afca2 100644
> --- a/include/linux/bit_spinlock.h
> +++ b/include/linux/bit_spinlock.h
> @@ -2,6 +2,7 @@
>   #ifndef __LINUX_BIT_SPINLOCK_H
>   #define __LINUX_BIT_SPINLOCK_H
>   
> +#include <asm/processor.h>
>   #include <linux/kernel.h>
>   #include <linux/preempt.h>
>   #include <linux/atomic.h>


_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] bit_spinlock: Include <asm/processor.h>
  2023-01-10  7:19 ` Vineet Gupta
@ 2023-01-10 18:08   ` Christophe JAILLET
  2023-01-10 21:23     ` Al Viro
  0 siblings, 1 reply; 6+ messages in thread
From: Christophe JAILLET @ 2023-01-10 18:08 UTC (permalink / raw
  To: Vineet Gupta, Greg Kroah-Hartman, Dan Carpenter, Andrew Morton
  Cc: linux-snps-arc, linux-kernel, kernel-janitors

Le 10/01/2023 à 08:19, Vineet Gupta a écrit :
> 
> On 1/8/23 11:04, Christophe JAILLET wrote:
>> In an attempt to simplify some includes in <include/dcache.h>, it
>> appeared, when compiling fs/ecryptfs/dentry.c, that 
>> <linux/bit_spinlock.h>
>> was relying on other includes to get the definition of cpu_relax().
>> (see [1])
>>
>> It broke on arc.
> 
> It its just ARC that broke, maybe we can do something there ?

Hi,

It is all what build-bots have spotted so far :)

I don't think that "fixing" it in ARC is the right approach, unless I 
missed something.

<linux/bit_spinlock.h> does use cpu_relax(), so it should include what 
is need for that, and not rely on other black magic.

CJ

> 
>> Include <asm/processor.h> in <linux/bit_spinlock.h> to fix the issue.
>> This will help remove some un-needed includes from <include/dcache.h>.
>>
>> [1]: https://lore.kernel.org/all/202301082130.LXMj5qkD-lkp@intel.com/
>>
>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>> ---
>> Not sure who to send this to.
>> get_maintainer.pl is of no help, and the file is untouched from a too 
>> long
>> time.
>>
>> Greg? Dan? Any pointer?
>> ---
>>   include/linux/bit_spinlock.h | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/include/linux/bit_spinlock.h b/include/linux/bit_spinlock.h
>> index bbc4730a6505..d0fd2a7afca2 100644
>> --- a/include/linux/bit_spinlock.h
>> +++ b/include/linux/bit_spinlock.h
>> @@ -2,6 +2,7 @@
>>   #ifndef __LINUX_BIT_SPINLOCK_H
>>   #define __LINUX_BIT_SPINLOCK_H
>> +#include <asm/processor.h>
>>   #include <linux/kernel.h>
>>   #include <linux/preempt.h>
>>   #include <linux/atomic.h>
> 
> 


_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] bit_spinlock: Include <asm/processor.h>
  2023-01-10 18:08   ` Christophe JAILLET
@ 2023-01-10 21:23     ` Al Viro
  0 siblings, 0 replies; 6+ messages in thread
From: Al Viro @ 2023-01-10 21:23 UTC (permalink / raw
  To: Christophe JAILLET
  Cc: Vineet Gupta, Greg Kroah-Hartman, Dan Carpenter, Andrew Morton,
	linux-snps-arc, linux-kernel, kernel-janitors

On Tue, Jan 10, 2023 at 07:08:33PM +0100, Christophe JAILLET wrote:
> Le 10/01/2023 à 08:19, Vineet Gupta a écrit :
> > 
> > On 1/8/23 11:04, Christophe JAILLET wrote:
> > > In an attempt to simplify some includes in <include/dcache.h>, it
> > > appeared, when compiling fs/ecryptfs/dentry.c, that
> > > <linux/bit_spinlock.h>
> > > was relying on other includes to get the definition of cpu_relax().
> > > (see [1])
> > > 
> > > It broke on arc.
> > 
> > It its just ARC that broke, maybe we can do something there ?
> 
> Hi,
> 
> It is all what build-bots have spotted so far :)
> 
> I don't think that "fixing" it in ARC is the right approach, unless I missed
> something.
> 
> <linux/bit_spinlock.h> does use cpu_relax(), so it should include what is
> need for that, and not rely on other black magic.

Umm...  That's not obvious - it only uses cpu_relax() in macros, so missing
include would not cause problems if all actual users of those macros happen
to pull the needed header by other means.

Said that, we have

1) defined directly in asm/processor.h, using nothing but the stuff provided by
compiler.h:
	alpha, arc, csky, loongarch, m68k, microblaze, nios2,
	openrisc, parisc, s390, sh, xtensa
2) same, using something in headers pulled by asm/processor.h itself:
	ia64 (needs asm/intrinsic.h)
	hexagon (needs asm/hexagon_vm.h)
	um (needs arch/um/include/linux/time-internal.h)
3) same, but defined in something pulled by asm/processor.h rather than
in asm/processor.h itself; asm/vdso/processor.h is the common location -
those are the cases when we share the same definition for kernel and
vdso builds
	sparc (asm/processor_32.h or asm/processor_64.h)
	arm (asm/vdso/processor.h)
	arm64 (asm/vdso/processor.h)
	powerpc (asm/vdso/processor.h)
	x86 (asm/vdso/processor.h)
	riscv (asm/vdso/processor.h; needs several headers included there -
jump_label.h, etc.)
	mips (asm/vdso/processor.h, needs asm/barrier.h, pulled from asm/processor.h
by way of linux/atomic.h -> asm/atomic.h -> asm/barrier.h)

So asm/processor.h is sufficient for working cpu_relax() and if some
arch-independent code wants cpu_relax() it should pull either
asm/processor.h or linux/processor.h

_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-01-10 21:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-08 19:04 [PATCH] bit_spinlock: Include <asm/processor.h> Christophe JAILLET
2023-01-09  8:26 ` Dan Carpenter
2023-01-09 22:46 ` Andrew Morton
2023-01-10  7:19 ` Vineet Gupta
2023-01-10 18:08   ` Christophe JAILLET
2023-01-10 21:23     ` Al Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).