Machine check during PCI scan on PMac G5

Benjamin Herrenschmidt benh at
Sat Oct 2 21:17:01 EST 2004

On Sat, 2004-10-02 at 07:40, Andreas Schwab wrote:
> Has anyone been able to get 2.6.9-rc3 running on the new PMacs
> (PowerMac7,3)?  I'm getting a machine check during PCI scan in
> u3_ht_read_config while doing in_8 on 0xe00000008094800e.

Argh... again ! Looks like the box doesn't like us to probe the
PCI device that is there. Can you print out the precise devfn
bus number & offset where the machine check happens ?

I wonder if it's something that is turned off by the firmware
like one of the K2 internal USB1 controllers that are unused on
this machine.
K2 is notoriously allergic to us probing things that are turned off.

This patch should help by preventing the config space accesses to
occur on those devices that aren't in the device-tree, I'll push it
to Linus as a temporary fix if you confirm it works.


===== arch/ppc64/kernel/pmac_pci.c 1.5 vs edited =====
--- 1.5/arch/ppc64/kernel/pmac_pci.c	2004-07-25 14:51:52 +10:00
+++ edited/arch/ppc64/kernel/pmac_pci.c	2004-08-04 10:26:07 +10:00
@@ -271,7 +271,7 @@
 				    int offset, int len, u32 *val)
 	struct pci_controller *hose;
-	struct device_node *busdn;
+	struct device_node *busdn, *dn;
 	unsigned long addr;
 	if (bus->self)
@@ -282,6 +282,16 @@
 	hose = busdn->phb;
 	if (hose == NULL)
+	/* We only allow config cycles to devices that are in OF device-tree
+	 * as we are apparently having some weird things going on with some
+	 * revs of K2 on recent G5s
+	 */
+	for (dn = busdn->child; dn; dn = dn->sibling)
+		if (dn->devfn == devfn)
+			break;
+	if (dn == NULL)
 	addr = u3_ht_cfg_access(hose, bus->number, devfn, offset);

More information about the Linuxppc64-dev mailing list