linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* how to fix acpi_pci_root_remap_iospace?
@ 2018-08-16 20:45 Luck, Tony
  2018-08-16 21:10 ` Arnd Bergmann
  2018-08-17 11:24 ` how to fix acpi_pci_root_remap_iospace? Lorenzo Pieralisi
  0 siblings, 2 replies; 11+ messages in thread
From: Luck, Tony @ 2018-08-16 20:45 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: linux-kernel, Jayachandran C, Sinan Kaya, Tomasz Nowicki,
	Lorenzo Pieralisi, Arnd Bergmann, Boris Brezillon, Miquel Raynal

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!


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:


diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index 7433035ded95..de06377de13b 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -741,7 +741,7 @@ static void acpi_pci_root_validate_resources(struct device *dev,
 static void acpi_pci_root_remap_iospace(struct fwnode_handle *fwnode,
 			struct resource_entry *entry)
 {
-#ifdef PCI_IOBASE
+#if defined(PCI_IOBASE) && !defined(CONFIG_IA64)
 	struct resource *res = entry->res;
 	resource_size_t cpu_addr = res->start;
 	resource_size_t pci_addr = cpu_addr - entry->offset;

or we can do some other juggling with defines to get the
same outcome.

-Tony

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

end of thread, other threads:[~2018-08-20 19:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-16 20:45 how to fix acpi_pci_root_remap_iospace? Luck, Tony
2018-08-16 21:10 ` Arnd Bergmann
2018-08-16 23:26   ` Luck, Tony
2018-08-17  8:47     ` Arnd Bergmann
2018-08-17  8:55       ` Boris Brezillon
2018-08-17 15:56         ` Luck, Tony
2018-08-17 16:20           ` Boris Brezillon
2018-08-17 19:01             ` Arnd Bergmann
2018-08-20 16:31               ` [PATCH] ia64: Fix kernel BUG at lib/ioremap.c:72! Tony Luck
2018-08-20 19:23                 ` Linus Torvalds
2018-08-17 11:24 ` how to fix acpi_pci_root_remap_iospace? Lorenzo Pieralisi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).