Skip to contentSkip to conversation

ARM: bcm: Don't build brcmstb SMP code when building for V6

PATCH New Mark Brown 3 participants 5 messages Aug 22, 2014 – Aug 26, 2014

Subsystems (3)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 ARM: bcm: Don't build brcmstb SMP code when building for V6

From: Mark Brown <[email protected]>

The brcmstb SMP code contains isb() and dsb() which are not supported when building for -march=armv6 as happens when building allmodconfig. Since I have not been able to identify a way to override the compiler architecture selection per file add a Kconfig dependency to ensure this code is not built if V6 support is enabled.

There is doubtless a better solution.

---
 arch/arm/mach-bcm/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-bcm/Kconfig +1 -0
index fc93800..372132d 100644
@@ -102,6 +102,7 @@ config ARCH_BCM_5301X
 config ARCH_BRCMSTB
 	bool "Broadcom BCM7XXX based boards" if ARCH_MULTI_V7
 	depends on MMU
+	depends on !CPU_V6
 	select ARM_GIC
 	select MIGHT_HAVE_PCI
 	select HAVE_SMP
Signature · 1 line
2.1.0.rc1
#1 lore raw

PATCH 1/1 ARM: bcm: Don't build brcmstb SMP code when building for V6

+ Russell

Quoted 3 lines · Mark Brown

From: Mark Brown <[email protected]>

The brcmstb SMP code contains isb() and dsb() which are not supported when

The problem is not with isb() and dsb() (which have different definitions when v6 is enabled), but with v7_exit_coherency_flush().

Quoted 4 lines

building for -march=armv6 as happens when building allmodconfig. Since I have not been able to identify a way to override the compiler architecture selection per file add a Kconfig dependency to ensure this code is not built if V6 support is enabled.

I already proposed this solution to override the compiler architecture, in the same pattern as other similar code in the same directory.

http://article.gmane.org/gmane.linux.drivers.devicetree/84517

My using 'CFLAGS_<obj> += <flags>', you can compile in v7.

Quoted 1 line

There is doubtless a better solution.

I think mine is better? Not sure. Comments are welcome.

But anyway, this file *should* be dropped for 3.17 (resolving the current problem at hand), if somebody will eventually pick up this patch:

http://article.gmane.org/gmane.linux.kernel/1767679

Hello, anybody? Should Matt be picking this up, or for post-rc1, do Arnd/Olof take these patches directly?

Quoted 10 lines
---
 arch/arm/mach-bcm/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-bcm/Kconfig +0 -0
index fc93800..372132d 100644

arch/arm/mach-bcm/Kconfig config ARCH_BCM_5301X · line 108

Quoted 7 lines
arch/arm/mach-bcm/Kconfig +1 -0
@@ -102,6 +102,7 @@ config ARCH_BCM_5301X
 config ARCH_BRCMSTB
 	bool "Broadcom BCM7XXX based boards" if ARCH_MULTI_V7
 	depends on MMU
+	depends on !CPU_V6
 	select ARM_GIC
 	select MIGHT_HAVE_PCI
 	select HAVE_SMP

Regards,
Brian

author
#2 lore raw

PATCH 1/1 ARM: bcm: Don't build brcmstb SMP code when building for V6

Quoted 8 lines · Brian Norris
Quoted 6 lines · Mark Brown

From: Mark Brown <[email protected]>

building for -march=armv6 as happens when building allmodconfig. Since I have not been able to identify a way to override the compiler architecture selection per file add a Kconfig dependency to ensure this code is not built if V6 support is enabled.

Quoted 6 lines

I already proposed this solution to override the compiler architecture, in the same pattern as other similar code in the same directory.

http://article.gmane.org/gmane.linux.drivers.devicetree/84517

My using 'CFLAGS_<obj> += <flags>', you can compile in v7.

I tried that but it wasn't doing the right thing for me - it appeared
since the compiler ends up getting both -march=armv7-a and -march=armv6
it complained that it couldn't satisfy both options. It might be that
this is version dependant or the actual cause wsa something else, I
didn't investigate too hard.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140822/274418c1/attachment.sig>

#3 lore raw

PATCH 1/1 ARM: bcm: Don't build brcmstb SMP code when building for V6

Quoted 14 lines · Mark Brown
Quoted 12 lines · Brian Norris
Quoted 6 lines · Mark Brown

From: Mark Brown <[email protected]>

building for -march=armv6 as happens when building allmodconfig. Since I have not been able to identify a way to override the compiler architecture selection per file add a Kconfig dependency to ensure this code is not built if V6 support is enabled.

I already proposed this solution to override the compiler architecture, in the same pattern as other similar code in the same directory.

http://article.gmane.org/gmane.linux.drivers.devicetree/84517

Quoted 7 lines
Quoted 1 line

My using 'CFLAGS_<obj> += <flags>', you can compile in v7.

I tried that but it wasn't doing the right thing for me - it appeared since the compiler ends up getting both -march=armv7-a and -march=armv6 it complained that it couldn't satisfy both options. It might be that this is version dependant or the actual cause wsa something else, I didn't investigate too hard.

If you ever see revisit this or see this again, I'd be interested in seeing the gcc args (make V=1) and version that failed. My fix worked for me, and I'll likely use it for the next revision if I don't find a good reason not to.

Thanks,
Brian

#4 lore raw

PATCH 1/1 ARM: bcm: Don't build brcmstb SMP code when building for V6

Quoted 15 lines · On Monday 25 August 2014 10:27:13 Brian Norris wrote:
Quoted 14 lines · Mark Brown
Quoted 12 lines · Brian Norris
Quoted 6 lines · Mark Brown

From: Mark Brown <[email protected]>

building for -march=armv6 as happens when building allmodconfig. Since I have not been able to identify a way to override the compiler architecture selection per file add a Kconfig dependency to ensure this code is not built if V6 support is enabled.

I already proposed this solution to override the compiler architecture, in the same pattern as other similar code in the same directory.

http://article.gmane.org/gmane.linux.drivers.devicetree/84517

Quoted 7 lines
Quoted 7 lines
Quoted 1 line

My using 'CFLAGS_<obj> += <flags>', you can compile in v7.

I tried that but it wasn't doing the right thing for me - it appeared since the compiler ends up getting both -march=armv7-a and -march=armv6 it complained that it couldn't satisfy both options. It might be that this is version dependant or the actual cause wsa something else, I didn't investigate too hard.

I've never seen that happen. Normally, the last option just overrides all previous conflicting ones.

Quoted 4 lines

If you ever see revisit this or see this again, I'd be interested in seeing the gcc args (make V=1) and version that failed. My fix worked for me, and I'll likely use it for the next revision if I don't find a good reason not to.

FWIW, I haven't seen any problems with the version below:

arch/arm/mach-bcm/Makefile +2 -0
index 67c492aabf4d..546d3d3022a4 100644
@@ -38,3 +38,5 @@ ifeq ($(CONFIG_ARCH_BRCMSTB),y)
 obj-y				+= brcmstb.o
 obj-$(CONFIG_SMP)		+= headsmp-brcmstb.o platsmp-brcmstb.o
 endif
+
+CFLAGS_platsmp-brcmstb.o	+= -march=armv7-a

Arnd