All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joshua Kinard <kumba@gentoo.org>
To: Ralf Baechle <ralf@linux-mips.org>
Cc: Linux/MIPS <linux-mips@linux-mips.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Subject: [PATCH 12/12] MIPS: PCI: Fix IP27 for the PCI_PROBE_ONLY case
Date: Tue,  7 Feb 2017 01:13:56 -0500	[thread overview]
Message-ID: <20170207061356.8270-13-kumba@gentoo.org> (raw)
In-Reply-To: <20170207061356.8270-1-kumba@gentoo.org>

From: Joshua Kinard <kumba@gentoo.org>

Commit 046136170a56 changed things such that setting PCI_PROBE_ONLY
will now explicitly claim PCI resources instead of skipping the sizing
of the bridges and assigning resources.  This is okay for IP30's PCI
code, which doesn't use physical address space to access I/O resources.

However, IP27 is completely different in this regard.  Instead of using
ioremapped addresses for I/O, IP27 has a dedicated address range,
0x92xxxxxxxxxxxxxx, that is used for all I/O access.  Since this is
uncached physical address space, the generic MIPS PCI code will not
probe it correctly and thus, the original behavior of PCI_PROBE_ONLY
needs to be restored only for the IP27 platform to bypass this logic
and have working PCI, at least for the IO6/IO6G board that houses the
base devices, until a better solution is found.

Fixes: 046136170a56 ("MIPS/PCI: Claim bus resources on PCI_PROBE_ONLY set-ups")
Signed-off-by: Joshua Kinard <kumba@gentoo.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
---
 arch/mips/pci/pci-bridge.c | 15 +++++++++++++++
 arch/mips/pci/pci-legacy.c | 15 +++++++++++++++
 2 files changed, 30 insertions(+)

diff --git a/arch/mips/pci/pci-bridge.c b/arch/mips/pci/pci-bridge.c
index 9df13ce313b5..af7073dba36b 100644
--- a/arch/mips/pci/pci-bridge.c
+++ b/arch/mips/pci/pci-bridge.c
@@ -62,6 +62,21 @@ bridge_probe(nasid_t nasid, int widget_id, int masterwid)
 	unsigned long offset = NODE_OFFSET(nasid);
 	struct bridge_controller *bc;
 
+#ifdef CONFIG_SGI_IP27
+	/*
+	 * Commit 046136170a56 changed things such that setting PCI_PROBE_ONLY
+	 * will now explicitly claim PCI resources instead of skipping the
+	 * sizing of the bridges and assigning resources.  This is okay for
+	 * the IP30's PCI code, which uses normal, ioremapped addresses to
+	 * do I/O.  IP27, however, is different and uses a hardware-specific
+	 * address range of 0x92xxxxxxxxxxxxxx for all I/O access.  As such,
+	 * the generic MIPS PCI code will not probe correctly and thus make
+	 * PCI on IP27 completely unusable.  Thus, we must restore the
+	 * original logic only for IP27 until a better solution can be found.
+	 */
+	pci_set_flags(PCI_PROBE_ONLY);
+#endif
+
 	/* XXX: Temporary until the IP27 "mega update". */
 	bc = &bridges[num_bridges];
 	if (!num_bridges)
diff --git a/arch/mips/pci/pci-legacy.c b/arch/mips/pci/pci-legacy.c
index 68268bbb15b8..5590af4f367f 100644
--- a/arch/mips/pci/pci-legacy.c
+++ b/arch/mips/pci/pci-legacy.c
@@ -107,6 +107,20 @@ static void pcibios_scanbus(struct pci_controller *hose)
 		need_domain_info = 1;
 	}
 
+#ifdef CONFIG_SGI_IP27
+	/*
+	 * Commit 046136170a56 changed things such that setting PCI_PROBE_ONLY
+	 * will now explicitly claim PCI resources instead of skipping the
+	 * sizing of the bridges and assigning resources.  This is okay for
+	 * the IP30's PCI code, which uses normal, ioremapped addresses to
+	 * do I/O.  IP27, however, is different and uses a hardware-specific
+	 * address range of 0x92xxxxxxxxxxxxxx for all I/O access.  As such,
+	 * the generic MIPS PCI code will not probe correctly and thus make
+	 * PCI on IP27 completely unusable.  Thus, we must restore the
+	 * original logic only for IP27 until a better solution can be found.
+	 */
+	if (!pci_has_flag(PCI_PROBE_ONLY)) {
+#else
 	/*
 	 * We insert PCI resources into the iomem_resource and
 	 * ioport_resource trees in either pci_bus_claim_resources()
@@ -115,6 +129,7 @@ static void pcibios_scanbus(struct pci_controller *hose)
 	if (pci_has_flag(PCI_PROBE_ONLY)) {
 		pci_bus_claim_resources(bus);
 	} else {
+#endif
 		pci_bus_size_bridges(bus);
 		pci_bus_assign_resources(bus);
 	}
-- 
2.11.1

  parent reply	other threads:[~2017-02-07  6:19 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-07  6:13 [PATCH 00/12] MIPS: BRIDGE Updates Joshua Kinard
2017-02-07  6:13 ` [PATCH 01/12] MIPS: BRIDGE: Rename pci-ip27.c to pci-bridge.c Joshua Kinard
2017-02-07  6:13 ` [PATCH 02/12] MIPS: IP27: Add pcibr.h header for IP27 Joshua Kinard
2017-02-07  6:13 ` [PATCH 03/12] MIPS: PCI: Minor clean-ups to pci-legacy.c Joshua Kinard
2017-02-07  6:13 ` [PATCH 04/12] MIPS: PCI: Add BRIDGE 'pre_enable' hook Joshua Kinard
2017-02-07  6:13 ` [PATCH 05/12] MIPS: BRIDGE: Clean-up bridge.h header file Joshua Kinard
2017-02-07  6:13 ` [PATCH 06/12] MIPS: BRIDGE: Overhaul " Joshua Kinard
2017-02-07  6:13 ` [PATCH 07/12] MIPS: BRIDGE: Add XBRIDGE revs and SWAP bit Joshua Kinard
2017-02-07  6:13 ` [PATCH 08/12] MIPS: BRIDGE: Update ops-bridge.c Joshua Kinard
2017-02-07  6:13 ` [PATCH 09/12] MIPS: BRIDGE: Use !pci_is_root_bus(bus) to check for bus->number > 0 Joshua Kinard
2017-02-07  6:13 ` [PATCH 10/12] MIPS: BRIDGE: Overhaul pci-bridge.c driver Joshua Kinard
2017-02-07  6:13 ` [PATCH 11/12] MIPS: IP27: Update IRQ code to work with the new BRIDGE code Joshua Kinard
2017-02-07  6:13 ` Joshua Kinard [this message]
2017-02-07 18:29   ` [PATCH 12/12] MIPS: PCI: Fix IP27 for the PCI_PROBE_ONLY case Bjorn Helgaas
2017-02-08  9:39     ` Joshua Kinard
     [not found]       ` <CAErSpo4LsrPCtdZwp6CyT0jKhXLt3j=fGSiFjpRRTPUjFoKHtQ@mail.gmail.com>
2017-02-12  4:09         ` Joshua Kinard
2017-02-13 22:45           ` Bjorn Helgaas
2017-02-13 22:45             ` Bjorn Helgaas
2017-02-13 22:45             ` Bjorn Helgaas
2017-02-14  7:39             ` Joshua Kinard
2017-02-14 14:56               ` Bjorn Helgaas
2017-02-24  8:50                 ` Joshua Kinard
2017-02-24 18:38                   ` Bjorn Helgaas
2017-02-25  9:34                     ` Joshua Kinard
2017-02-27 16:36                       ` Bjorn Helgaas
2017-02-28  0:25                         ` Joshua Kinard
2017-03-01 15:39                           ` Bjorn Helgaas
2017-02-09 18:36     ` Joshua Kinard

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=20170207061356.8270-13-kumba@gentoo.org \
    --to=kumba@gentoo.org \
    --cc=bhelgaas@google.com \
    --cc=linux-mips@linux-mips.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=ralf@linux-mips.org \
    --cc=tsbogend@alpha.franken.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.