public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH]  ACPI:  Unneccessary to scan the PCI bus already scanned.
@ 2008-03-03  6:19 Zhao Yakui
  2008-03-03  7:32 ` Ingo Molnar
  0 siblings, 1 reply; 15+ messages in thread
From: Zhao Yakui @ 2008-03-03  6:19 UTC (permalink / raw)
  To: lenb; +Cc: linux-acpi

Subject: ACPI : Unneccessary to scan the PCI bus already scanned.
>From : Zhao Yakui <yakui.zhao@intel.com>

Maybe the desired pci bus has been already scanned. In such case it is
unnecessary to scan the pci bus with the given domain, busnum.

http://bugzilla.kernel.org/show_bug.cgi?id=10124

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Li Shaohua <shaohua.li@intel.com>

---
 arch/ia64/pci/pci.c |    7 ++++++-
 arch/x86/pci/acpi.c |   17 +++++++++++++++--
 2 files changed, 21 insertions(+), 3 deletions(-)

Index: linux-2.6/arch/x86/pci/acpi.c
===================================================================
--- linux-2.6.orig/arch/x86/pci/acpi.c
+++ linux-2.6/arch/x86/pci/acpi.c
@@ -219,8 +219,21 @@ struct pci_bus * __devinit pci_acpi_scan
 	if (pxm >= 0)
 		sd->node = pxm_to_node(pxm);
 #endif
+	/*
+	 * Maybe the desired pci bus has been already scanned. In such case
+	 * it is unnecessary to scan the pci bus with the given domain,busnum.
+	 */
+	bus = pci_find_bus(domain, busnum);
+	if (bus) {
+		/*
+		 * If the desired bus exits, the content of bus->sysdata will
+		 * be replaced by sd.
+		 */
+		memcpy(bus->sysdata, sd, sizeof(*sd));
+		kfree(sd);
+	} else
+		bus = pci_scan_bus_parented(NULL, busnum, &pci_root_ops, sd);
 
-	bus = pci_scan_bus_parented(NULL, busnum, &pci_root_ops, sd);
 	if (!bus)
 		kfree(sd);
 
@@ -228,7 +241,7 @@ struct pci_bus * __devinit pci_acpi_scan
 	if (bus != NULL) {
 		if (pxm >= 0) {
 			printk("bus %d -> pxm %d -> node %d\n",
-				busnum, pxm, sd->node);
+				busnum, pxm, pxm_to_node(pxm));
 		}
 	}
 #endif
Index: linux-2.6/arch/ia64/pci/pci.c
===================================================================
--- linux-2.6.orig/arch/ia64/pci/pci.c
+++ linux-2.6/arch/ia64/pci/pci.c
@@ -362,7 +362,12 @@ pci_acpi_scan_root(struct acpi_device *d
 	info.name = name;
 	acpi_walk_resources(device->handle, METHOD_NAME__CRS, add_window,
 			&info);
-
+	/*
+	 * See arch/x86/pci/acpi.c.
+	 * The desired pci bus might already be scanned in a quirk. We
+	 * should handle the case here, but it appears that IA64 hasn't
+	 * such quirk. So we just ignore the case now.
+	 */
 	pbus = pci_scan_bus_parented(NULL, bus, &pci_root_ops, controller);
 	if (pbus)
 		pcibios_setup_root_windows(pbus, controller);



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

end of thread, other threads:[~2008-03-04 21:23 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-03  6:19 [PATCH] ACPI: Unneccessary to scan the PCI bus already scanned Zhao Yakui
2008-03-03  7:32 ` Ingo Molnar
2008-03-03  8:06   ` Yinghai Lu
2008-03-03  8:30     ` Yinghai Lu
2008-03-03 10:01       ` Yinghai Lu
2008-03-03 10:10         ` Ingo Molnar
2008-03-03 10:33           ` Yinghai Lu
2008-03-03 11:11             ` Ingo Molnar
2008-03-03 18:57               ` Yinghai Lu
2008-03-04 19:28                 ` Yinghai Lu
2008-03-04 19:34                   ` Yinghai Lu
2008-03-04 21:23                     ` Ingo Molnar
2008-03-03 10:11         ` Ingo Molnar
2008-03-03 10:30           ` Yinghai Lu
2008-03-03  8:18   ` Zhao Yakui

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