Linux SNPS ARC Archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Vineet Gupta <vgupta@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Dan Carpenter <error27@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] bit_spinlock: Include <asm/processor.h>
Date: Tue, 10 Jan 2023 21:23:35 +0000	[thread overview]
Message-ID: <Y73XV1SRtcpJQ1Vq@ZenIV> (raw)
In-Reply-To: <f4aa7f0d-50a9-b5e0-e980-1e8e779b48bc@wanadoo.fr>

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

      reply	other threads:[~2023-01-10 21:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y73XV1SRtcpJQ1Vq@ZenIV \
    --to=viro@zeniv.linux.org.uk \
    --cc=akpm@linux-foundation.org \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=error27@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=vgupta@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).