Skip to contentSkip to conversation

PCI probe status cleanup

PATCH New Tim Hockin 1 participant 1 message Aug 14, 2001 PCI

lore
Share & tools
lore

Tim Hockin

author
#0 lore raw

PATCH 1/1 PCI probe status cleanup

All,

Attached is a very small patch against 2.4.8, which I have been sending for a while. It merely clears the Master Abort bit on a PCI bridge when a failed probe occurs.

If there is any reason this can't go into the next 2.4.x release, please let me know. It has been in use here for months.

Tim

Signature · 4 lines
Tim Hockin
Systems Software Engineer
Sun Microsystems, Cobalt Server Appliances
[email protected]
drivers/pci/pci.c +12 -1
diff -ruN dist+patches-2.4.8/drivers/pci/pci.c cobalt-2.4.8/drivers/pci/pci.c
@@ -1232,8 +1236,19 @@
 		return NULL;
 
 	/* some broken boards return 0 or ~0 if a slot is empty: */
-	if (l == 0xffffffff || l == 0x00000000 || l == 0x0000ffff || l == 0xffff0000)
+	if (l == 0xffffffff || l == 0x00000000 
+	 || l == 0x0000ffff || l == 0xffff0000) {
+		/*
+		 * host/pci and pci/pci bridges will set Received Master Abort
+		 * (bit 13) on failed configuration access (happens when
+		 * searching for devices).  To be safe, clear the status
+		 * register.
+		 */
+		unsigned short st;
+		pci_read_config_word(temp, PCI_STATUS, &st);
+		pci_write_config_word(temp, PCI_STATUS, st);
 		return NULL;
+	}
 
 	dev = kmalloc(sizeof(*dev), GFP_KERNEL);
 	if (!dev)