Re: [lpieralisi-pci:pci/rcar 2/2] drivers/pci/controller/pcie-rcar-host.c:139:3: error: instruction requires: data-barriers

From: Arnd Bergmann
Date: Thu Mar 10 2022 - 02:40:18 EST


On Thu, Mar 10, 2022 at 1:18 AM Nathan Chancellor <nathan@xxxxxxxxxx> wrote:

> > To avoid this error, for now I have cherry-picked de6b5097f58b to a
> > local pci/host/rcar branch and dropped 9775965dbae5.
>
> FWIW, this is not clang specific, the same configuration blows up with
> GCC 11.2.0 as well:
>
> $ make -skj"$(nproc)" \
> ARCH=arm \
> CROSS_COMPILE=arm-linux-gnueabi- \
> olddefconfig drivers/pci/controller/pcie-rcar-host.o
> /tmp/ccz8ybtm.s: Assembler messages:
> /tmp/ccz8ybtm.s:742: Error: selected processor does not support `isb' in ARM mode
> /tmp/ccz8ybtm.s:812: Error: selected processor does not support `isb' in ARM mode
> make[4]: *** [scripts/Makefile.build:288: drivers/pci/controller/pcie-rcar-host.o] Error 1
>
> $ rg CONFIG_CPU_32 .config
> 289:CONFIG_CPU_32v4=y
>
> It does not look like isb can be used with this configuration, at least
> if I understand arch/arm/include/asm/barrier.h correctly.

My first thought was to amend the #ifdef to

#if IS_ENABLED(CONFIG_ARM) && IS_ENABLED(CONFIG_ARCH_RENESAS)

However, this is still broken because you can build a kernel that
enables the Renesas ARMv7 platform along with early ARMv6 (omap2 and
imx3) that do not support "isb" either.

What I think we want to do here instead is to add a ".arch armv7-a" in the
inline assembly.

Arnd