linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Luck, Tony" <tony.luck@intel.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-kernel@vger.kernel.org,
	Jayachandran C <jchandra@broadcom.com>,
	Sinan Kaya <okaya@codeaurora.org>,
	Tomasz Nowicki <tn@semihalf.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Boris Brezillon <boris.brezillon@bootlin.com>,
	Miquel Raynal <miquel.raynal@bootlin.com>
Subject: how to fix acpi_pci_root_remap_iospace?
Date: Thu, 16 Aug 2018 13:45:07 -0700	[thread overview]
Message-ID: <20180816204506.GA21144@agluck-desk> (raw)

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

             reply	other threads:[~2018-08-16 20:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-16 20:45 Luck, Tony [this message]
2018-08-16 21:10 ` how to fix acpi_pci_root_remap_iospace? 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180816204506.GA21144@agluck-desk \
    --to=tony.luck@intel.com \
    --cc=arnd@arndb.de \
    --cc=bhelgaas@google.com \
    --cc=boris.brezillon@bootlin.com \
    --cc=jchandra@broadcom.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=okaya@codeaurora.org \
    --cc=tn@semihalf.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).