Re: how to fix acpi_pci_root_remap_iospace?

From: Arnd Bergmann
Date: Thu Aug 16 2018 - 17:10:54 EST


On Thu, Aug 16, 2018 at 10:45 PM Luck, Tony <tony.luck@xxxxxxxxx> wrote:
>
> Bjorn,
>
> Back in commit:
>
> 0a70abb38062 ("PCI/ACPI: Support I/O resources when parsing host bridge resources")
>
> we added acpi_pci_root_remap_iospace(). On ia64 this was a no-op because ia64
> didn't define PCI_IOBASE, so the entire body of the function was skipped.
>
> But in the current merge window commit:
>
> 0bbf47eab469 ("ia64: use asm-generic/io.h")
>
> ended up defining PCI_IOBASE for us, and now we die horribly
> in early boot with:
>
> kernel BUG at lib/ioremap.c:72!

Ah, that explains it. I'm sorry for causing you trouble here, and glad
you figured out the cause.

> Is PCI_IOBASE the right thing to check for to decide whether
> acpi_pci_root_remap_iospace() needs to do anything?
>
> The ugly fix would be:

Another way would be to add

#include <asm-generic/io.h>
+#undef PCI_IOBASE

in your asm/io.h. This is about as ugly as the your version, but
it would be local to ia64 ;-)

Arnd