mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC][PATCH] master abort on scanning fixes [6/9]
@ 2005-07-14  8:55 Adam Belay
  0 siblings, 0 replies; only message in thread
From: Adam Belay @ 2005-07-14  8:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: greg

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 <abelay@novell.com>

--- 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);
 }



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-07-14  9:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-14  8:55 [RFC][PATCH] master abort on scanning fixes [6/9] Adam Belay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®