Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] arc: Fix warning if atomics are selected
@ 2014-09-10 12:46 Anton Kolesov
  2014-09-10 13:19 ` Thomas Petazzoni
  0 siblings, 1 reply; 4+ messages in thread
From: Anton Kolesov @ 2014-09-10 12:46 UTC (permalink / raw)
  To: buildroot

If atomic instructions were selected for ARC, there was a warning, like:
"(BR2_ARC_ATOMIC_EXT) selects BR2_ARCH_HAS_ATOMICS which has unmet direct
dependencies". This patch removes the reason of this warning by adding a
respective configuration entry.

Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
---
 arch/Config.in.arc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/Config.in.arc b/arch/Config.in.arc
index 8a7f290..d2ccf09 100644
--- a/arch/Config.in.arc
+++ b/arch/Config.in.arc
@@ -1,3 +1,6 @@
+config  BR2_ARCH_HAS_ATOMICS
+	bool
+
 # Choise of atomic instructions presence
 config BR2_ARC_ATOMIC_EXT
 	bool "Atomic extension (LLOCK/SCOND instructions)"
-- 
1.8.4.1

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

* [Buildroot] [PATCH] arc: Fix warning if atomics are selected
  2014-09-10 12:46 [Buildroot] [PATCH] arc: Fix warning if atomics are selected Anton Kolesov
@ 2014-09-10 13:19 ` Thomas Petazzoni
  2014-09-10 13:28   ` Anton Kolesov
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Petazzoni @ 2014-09-10 13:19 UTC (permalink / raw)
  To: buildroot

Dear Anton Kolesov,

On Wed, 10 Sep 2014 16:46:27 +0400, Anton Kolesov wrote:

> If atomic instructions were selected for ARC, there was a warning, like:
> "(BR2_ARC_ATOMIC_EXT) selects BR2_ARCH_HAS_ATOMICS which has unmet direct
> dependencies". This patch removes the reason of this warning by adding a
> respective configuration entry.
> 
> Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
> ---
>  arch/Config.in.arc | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/Config.in.arc b/arch/Config.in.arc
> index 8a7f290..d2ccf09 100644
> --- a/arch/Config.in.arc
> +++ b/arch/Config.in.arc
> @@ -1,3 +1,6 @@
> +config  BR2_ARCH_HAS_ATOMICS
> +	bool

No. This option is already defined in arch/Config.in. There's no point
in redefining it anywhere else.

Can you give me a .config that shows the warning you had?

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH] arc: Fix warning if atomics are selected
  2014-09-10 13:19 ` Thomas Petazzoni
@ 2014-09-10 13:28   ` Anton Kolesov
  2014-09-10 13:46     ` Thomas Petazzoni
  0 siblings, 1 reply; 4+ messages in thread
From: Anton Kolesov @ 2014-09-10 13:28 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

defconfig is pretty simple:

BR2_arcle=y
BR2_ARC_ATOMIC_EXT=y

When I do anything with such configuration (like savedefconfig or menuconfig), I observe the following warning:

warning: (BR2_ARC_ATOMIC_EXT) selects BR2_ARCH_HAS_ATOMICS 
which has unmet direct dependencies (BR2_arm || BR2_armeb || BR2_aarch64 
|| BR2_avr32 || BR2_bfin || BR2_m68k || BR2_microblazeel || BR2_microblazebe
|| BR2_mips || BR2_mips64 || BR2_mipsel || BR2_mips64el || BR2_nios2 ||
BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le || BR2_sh || BR2_sh64
|| BR2_sparc || BR2_i386 || BR2_x86_64 || BR2_xtensa)

That is using current master branch.

Anton


> -----Original Message-----
> From: Thomas Petazzoni [mailto:thomas.petazzoni at free-electrons.com]
> Sent: 10 September 2014 17:19
> To: Anton Kolesov
> Cc: buildroot at uclibc.org
> Subject: Re: [Buildroot] [PATCH] arc: Fix warning if atomics are selected
> 
> Dear Anton Kolesov,
> 
> On Wed, 10 Sep 2014 16:46:27 +0400, Anton Kolesov wrote:
> 
> > If atomic instructions were selected for ARC, there was a warning, like:
> > "(BR2_ARC_ATOMIC_EXT) selects BR2_ARCH_HAS_ATOMICS which has
> unmet direct
> > dependencies". This patch removes the reason of this warning by adding a
> > respective configuration entry.
> >
> > Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
> > ---
> >  arch/Config.in.arc | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/arch/Config.in.arc b/arch/Config.in.arc
> > index 8a7f290..d2ccf09 100644
> > --- a/arch/Config.in.arc
> > +++ b/arch/Config.in.arc
> > @@ -1,3 +1,6 @@
> > +config  BR2_ARCH_HAS_ATOMICS
> > +	bool
> 
> No. This option is already defined in arch/Config.in. There's no point
> in redefining it anywhere else.
> 
> Can you give me a .config that shows the warning you had?
> 
> Thanks,
> 
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com

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

* [Buildroot] [PATCH] arc: Fix warning if atomics are selected
  2014-09-10 13:28   ` Anton Kolesov
@ 2014-09-10 13:46     ` Thomas Petazzoni
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2014-09-10 13:46 UTC (permalink / raw)
  To: buildroot

Dear Anton Kolesov,

On Wed, 10 Sep 2014 13:28:59 +0000, Anton Kolesov wrote:

> defconfig is pretty simple:
> 
> BR2_arcle=y
> BR2_ARC_ATOMIC_EXT=y
> 
> When I do anything with such configuration (like savedefconfig or menuconfig), I observe the following warning:
> 
> warning: (BR2_ARC_ATOMIC_EXT) selects BR2_ARCH_HAS_ATOMICS 
> which has unmet direct dependencies (BR2_arm || BR2_armeb || BR2_aarch64 
> || BR2_avr32 || BR2_bfin || BR2_m68k || BR2_microblazeel || BR2_microblazebe
> || BR2_mips || BR2_mips64 || BR2_mipsel || BR2_mips64el || BR2_nios2 ||
> BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le || BR2_sh || BR2_sh64
> || BR2_sparc || BR2_i386 || BR2_x86_64 || BR2_xtensa)
> 
> That is using current master branch.

There is indeed something weird going on here with the kconfig logic.
We have:

config BR2_ARCH_HAS_ATOMICS
	bool

in arch/Config.in, i.e defined for all architectures.

Then, most architectures (except ARC) are doing:

config BR2_ARCH_HAS_ATOMICS
	default y

because they all have atomic operations in all cases.

But ARC is just doing:

config BR2_ARC_ATOMIC_EXT
	bool "Atomic extension (LLOCK/SCOND instructions)"
	select BR2_ARCH_HAS_ATOMICS

But for some reason, kconfig decides that BR2_ARCH_HAS_ATOMICS is only
available for the other architectures, not ARC. Seems like the trick
used by Yann to declare the type of BR2_ARCH_HAS_ATOMICS in
arch/Config.in, and then its value in each individual
arch/Config.in.<foo> doesn't work when you do just a select.

One solution would be:

diff --git a/arch/Config.in.arc b/arch/Config.in.arc
index 8a7f290..1173f41 100644
--- a/arch/Config.in.arc
+++ b/arch/Config.in.arc
@@ -1,7 +1,9 @@
 # Choise of atomic instructions presence
+config BR2_ARCH_HAS_ATOMICS
+       default y if BR2_ARC_ATOMIC_EXT
+
 config BR2_ARC_ATOMIC_EXT
        bool "Atomic extension (LLOCK/SCOND instructions)"
-       select BR2_ARCH_HAS_ATOMICS
 
 config BR2_ARCH
        default "arc"   if BR2_arcle

Which is basically very close to what you were proposing. But I'm still
not convinced, so I'm Cc'ing Yann to get an idea on what's going on here.

Thanks for the report!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

end of thread, other threads:[~2014-09-10 13:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-10 12:46 [Buildroot] [PATCH] arc: Fix warning if atomics are selected Anton Kolesov
2014-09-10 13:19 ` Thomas Petazzoni
2014-09-10 13:28   ` Anton Kolesov
2014-09-10 13:46     ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox