Re: [PATCH] ACPI: Unneccessary to scan the PCI bus already scanned.

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

 



On Tue, Mar 4, 2008 at 11:28 AM, Yinghai Lu <yhlu.kernel@xxxxxxxxx> wrote:
> I updated Yakui's patch, so it could be applied after x86.git#testing
>
>  Please check it
>
>  YH

use this v2 one please

YH
From : Zhao Yakui <yakui.zhao@xxxxxxxxx>

[PATCH] Unneccessary to scan the PCI bus already scanned v2

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

commit 08f1c192c3c32797068bfe97738babb3295bbf42
Author: Muli Ben-Yehuda <muli@xxxxxxxxxx>
Date:   Sun Jul 22 00:23:39 2007 +0300

   x86-64: introduce struct pci_sysdata to facilitate sharing of ->sysdata

   This patch introduces struct pci_sysdata to x86 and x86-64, and
   converts the existing two users (NUMA, Calgary) to use it.

   This lays the groundwork for having other users of sysdata, such as
   the PCI domains work.

   The Calgary bits are tested, the NUMA bits just look ok.

that replace pcibios_scan_root by pci_scan_bus_parented...

but in pcibios_scan_root we have check about scanned bus

Yinghai make it can be applied after patches in x86.git#tesing

Signed-off-by: Zhao Yakui <yakui.zhao@xxxxxxxxx>
Signed-off-by: Li Shaohua <shaohua.li@xxxxxxxxx>
Signed-off-by: Yinghai Lu <yhlu.kernel@xxxxxxxxx>

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
@@ -218,28 +218,36 @@ struct pci_bus * __devinit pci_acpi_scan
 		node = -1;
 #endif
 
-	/* Allocate per-root-bus (not per bus) arch-specific data.
-	 * TODO: leak; this memory is never freed.
-	 * It's arguable whether it's worth the trouble to care.
-	 */
-	sd = kzalloc(sizeof(*sd), GFP_KERNEL);
-	if (!sd) {
-		printk(KERN_ERR "PCI: OOM, not probing PCI bus %02x\n", busnum);
-		return NULL;
-	}
+	bus = pci_find_bus(domain, busnum);
+	if (bus) {
+		/* already scanned ?*/
+		sd = bus->sysdata;
+		sd->node = node;
+	} else {
+		/* Allocate per-root-bus (not per bus) arch-specific data.
+		 * TODO: leak; this memory is never freed.
+		 * It's arguable whether it's worth the trouble to care.
+		 */
+		sd = kzalloc(sizeof(*sd), GFP_KERNEL);
+		if (!sd) {
+			printk(KERN_ERR "PCI: OOM, not probing PCI bus %02x\n",
+				 busnum);
+			return NULL;
+		}
 
-	sd->domain = domain;
-	sd->node = node;
+		sd->domain = domain;
+		sd->node = node;
 
-	bus = pci_scan_bus_parented(NULL, busnum, &pci_root_ops, sd);
-	if (!bus)
-		kfree(sd);
+		bus = pci_scan_bus_parented(NULL, busnum, &pci_root_ops, sd);
+		if (!bus)
+			kfree(sd);
+	}
 
 #ifdef CONFIG_ACPI_NUMA
 	if (bus) {
 		if (pxm >= 0) {
 			printk(KERN_DEBUG "bus %02x -> pxm %d -> node %d\n",
-				busnum, pxm, sd->node);
+				busnum, pxm, node);
 		}
 	}
 #endif

[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux