linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Restore PCI IO space behind Freescale pseudo-bridge
@ 2009-01-14 19:48 Andrew Klossner
  2009-01-14 20:37 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Klossner @ 2009-01-14 19:48 UTC (permalink / raw)
  To: linuxppc-dev

When I moved from 2.6.27 to 2.6.28, one of my devices didn't work
until I devised the attached patch.  The kernel disallowed PCI I/O
space resources behind the pseudo-bridge in the Freescale MPC8545
because that bridge's config-space registers incorrectly report that
it doesn't forward I/O space transactions.

Checking for a specific vendor ID is hacky, but it got my system going
again with only a few perturbed lines.  Is there a more correct way to
achieve this?

diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index f36936d..f9f0048 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -985,6 +985,7 @@ static int __devinit pcibios_uninitialized_bridge_resource(struct pci_bus *bus,
 	struct pci_dev *dev = bus->self;
 	resource_size_t offset;
 	u16 command;
+	u16 vendor;
 	int i;
 
 	/* We don't do anything if PCI_PROBE_ONLY is set */
@@ -1030,7 +1031,16 @@ static int __devinit pcibios_uninitialized_bridge_resource(struct pci_bus *bus,
 		 * starting at low addresses -is- valid. What we do instead if that
 		 * we consider as unassigned anything that doesn't have IO enabled
 		 * in the PCI command register, and that's it.
+		 * However, we don't do that if the bridge is internal to a Freescale
+		 * CPU, as such bridges break the rules by, for example, not populating
+		 * the PCI_COMMAND_IO bit.
 		 */
+		pci_read_config_word(dev, PCI_VENDOR_ID, &vendor);
+		if (vendor == PCI_VENDOR_ID_MOTOROLA ||
+		    vendor == PCI_VENDOR_ID_FREESCALE) {
+			return 0;
+		}
+
 		pci_read_config_word(dev, PCI_COMMAND, &command);
 		if (command & PCI_COMMAND_IO)
 			return 0;

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

end of thread, other threads:[~2009-01-28 15:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <200901271813.n0RIDBHq023872@pogo.cesa.opbu.xerox.com>
2009-01-28  5:37 ` [PATCH] Restore PCI IO space behind Freescale pseudo-bridge Kumar Gala
2009-01-28  9:31   ` Benjamin Herrenschmidt
2009-01-28 15:59     ` Kumar Gala
2009-01-14 19:48 Andrew Klossner
2009-01-14 20:37 ` Benjamin Herrenschmidt

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).