Thread (5 messages) flat view 5 messages, 2 authors, 2014-08-18

Re: [PATCH] powerpc: Fix build failure for PPC_32

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2014-08-18 20:57:32
Also in: lkml

Hi Pranith,

On Mon, Aug 18, 2014 at 10:52 PM, Pranith Kumar [off-list ref] wrote:
On Mon, Aug 18, 2014 at 3:28 PM, Geert Uytterhoeven [off-list ref]
wrote:
quoted
On Mon, Aug 18, 2014 at 9:01 PM, Pranith Kumar [off-list ref]
wrote:
quoted
Fix ppc 32 build failure as reported here:

http://kisskb.ellerman.id.au/kisskb/buildresult/11663513/
| arch/powerpc/include/asm/floppy.h:142:20: error: 'isa_bridge_pcidev'
undeclared (first use in this function)
| make[3]: *** [drivers/block/floppy.o] Error 1

The definition of isa_bridge_pcidev is only available if CONFIG_PCI=y...
quoted
The error is that pci_32.o was not being built for PPC_32. Fix error by
adding
it in the Makefile. Tested using the ppc cross compiler.
... so how can adding this make the floppy.h error go away?
So the definition which you are talking about within CONFIG_PCI=y is an
extern definition

arch/powerpc/include/asm/ppc-pci.h:28:extern struct pci_dev
*isa_bridge_pcidev;

If you build pci_32.o unconditionally, there is an

EXPORT_SYMBOL(isa_bridge_pcidev);

which supplies the required symbol.
Yes, but the error in floppy.h is from the compiler, not from the linker.
Supplying the symbol for the linker doesn't help the compiler when
building floppy.c.
But yes, you are right in that we should not unconditionally compile
pci_32.o. Making floppy depend on PCI is the right thing to do. However,
quoted
Note that arch/powerpc/kernel/Makefile does add
pci_$(CONFIG_WORD_SIZE).o, but only if CONFIG_PCI=y.

So, thanks for your patch, but I don't think your fix is the right
solution.

However, drivers/block/floppy.o is enabled by BLK_DEV_FD, which
depends on ARCH_MAY_HAVE_PC_FDC.

arch/powerpc/Kconfig has:

config ARCH_MAY_HAVE_PC_FDC
        bool
        default !PPC_PSERIES || PCI

PCI is not set, and PPC_PSERIES is also not set, so this
defaults to y, which is obviously not correct, as floppy.h needs PCI.

As this symbol doesn't enable floppy support in-se, probably it should
just
be:

config ARCH_MAY_HAVE_PC_FDC
        bool
        depends on PCI
the right thing I guess here is to depend on !PPC_PSERIES && PCI since I
guess pSeries does not support floppy.h (hence the original condition
check?).
Note that PowerPC supports multi-platform kernels.
A kernel with PPC_PSERIES and something else with PCI may still want to
have floppy support.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help