[RFC][PATCH] master abort on scanning fixes [6/9]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The PCI bridge driver now checks if changing bridge_ctrl is necessary.
It also restores the original bridge_ctl settings when finished scanning
for devices.  Finally, a pci_bus setup fix is included.

Signed-off-by: Adam Belay <[email protected]>

--- a/drivers/pci/bus/pci-bridge.c	2005-07-12 01:45:46.000000000 -0400
+++ b/drivers/pci/bus/pci-bridge.c	2005-07-14 02:09:15.000000000 -0400
@@ -30,7 +30,7 @@
 	bus->bridge = &dev->dev;
 	bus->ops = bus->parent->ops;
 	bus->sysdata = bus->parent->sysdata;
-	bus->bridge = get_device(&dev->dev);
+	bus->self = dev;
 
 	/* Set up default resource pointers and names.. */
 	for (i = 0; i < 4; i++) {
@@ -82,12 +82,7 @@
 	if (!bus)
 		return NULL;
 
-	/* Disable MasterAbortMode during probing to avoid reporting
-	 * of bus errors (in some architectures)
-	 */ 
 	pci_read_config_word(dev, PCI_BRIDGE_CONTROL, &bctl);
-	pci_write_config_word(dev, PCI_BRIDGE_CONTROL,
-			      bctl & ~PCI_BRIDGE_CTL_MASTER_ABORT);
 
 	bus->number = bus->secondary = busnr;
 	bus->primary = buses & 0xFF;
@@ -105,10 +100,22 @@
 {
 	unsigned int devfn;
 
+	/* Disable MasterAbortMode during probing to avoid reporting
+	 * of bus errors (in some architectures)
+	 */ 
+	if (!(bus->bridge_ctl & PCI_BRIDGE_CTL_MASTER_ABORT))
+		pci_write_config_word(bus->self, PCI_BRIDGE_CONTROL,
+			bus->bridge_ctl & ~PCI_BRIDGE_CTL_MASTER_ABORT);
+
 	/* Go find them, Rover! */
 	for (devfn = 0; devfn < 0x100; devfn += 8)
 		pci_scan_slot(bus, devfn);
 
+	/* restore the original bridge_ctl configuration */
+	if (!(bus->bridge_ctl & PCI_BRIDGE_CTL_MASTER_ABORT))
+		pci_write_config_word(bus->self, PCI_BRIDGE_CONTROL,
+				      bus->bridge_ctl);
+
 	pcibios_fixup_bus(bus);
 	pci_bus_add_devices(bus);
 }


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux