PCI: use pci host bridge to loop pci root bus
Subsystems (15)
cover PCI: use pci host bridge to loop pci root bus
could remove pci_root_buses list.
Yinghai Lu (29):
PCI, x86: Separate out pcibios_allocate_bridge_resources() PCI. x86: Separate out pcibios_allocate_dev_resources() PCI, x86: Let pcibios_allocate_bus_resources() take bus instead PCI, x86: Separate out rom resource claim
PCI: rename pci_release_bus_bridge_dev to pci_release_host_bridge_dev
PCI: Add dummy bus_type for pci_host_bridge
PCI, ACPI: add acpi_bus_type for host bridge
PCI, ACPI: Remove acpi_find_bridge_device for acpi_bus_type PCI, libata: remove find_bridge in acpi_bus_type
PCI, USB: remove find_bridge in acpi_bus_type
PCI, ACPI: remove find_bridge in acpi_bus_type
PCI: Add for_each_pci_host_bridge() and pci_get_next_host_bridge PCI, hotplug: kill pci_find_next_bus n sgi_hotplug
PCI: kill pci_find_next_bus in pci_sysfs
PCI, edac: kill pci_find_next_bus in edac
PCI, x86: kill pci_find_next_bus in pcibios_scan_root
PCI, x86: kill pci_root_buses in resources reservations PCI, drm: kill pci_root_buses in alpha hose setting
PCI: kill pci_root_buses in setup-bus
PCI, sparc: kill pci_find_next_bus
PCI, ia64: kill pci_find_next_bus
PCI, alpha: kill pci_root_buses
PCI, arm: kill pci_root_buses
PCI, frv: kill pci_root_buses in resources reservations PCI, microblaze: kill pci_root_buses in resources reservations PCI, mn10300: kill pci_root_buses in resources reservations PCI, powerpc: kill pci_root_buses in resources reservations
PCI: kill pci_find_next_bus
PCI: kill pci_root_buses
arch/alpha/kernel/pci.c | 6 +- arch/arm/kernel/bios32.c | 9 +- arch/frv/mb93090-mb00/pci-frv.c | 37 ++++--- arch/ia64/hp/common/sba_iommu.c | 7 +- arch/ia64/sn/kernel/io_common.c | 5 +- arch/microblaze/pci/pci-common.c | 10 +- arch/mn10300/unit-asb2305/pci-asb2305.c | 62 ++++++------ arch/powerpc/kernel/pci-common.c | 13 +-- arch/powerpc/kernel/pci_64.c | 7 +- arch/sparc/kernel/pci.c | 6 +- arch/x86/pci/common.c | 9 +- arch/x86/pci/i386.c | 162 +++++++++++++++++++------------ drivers/acpi/glue.c | 22 +---- drivers/ata/libata-acpi.c | 6 - drivers/edac/i7core_edac.c | 6 +- drivers/gpu/drm/drm_fops.c | 10 ++- drivers/pci/hotplug/sgi_hotplug.c | 6 +- drivers/pci/pci-acpi.c | 13 ++- drivers/pci/pci-driver.c | 11 ++- drivers/pci/pci-sysfs.c | 6 +- drivers/pci/probe.c | 13 +-- drivers/pci/search.c | 60 ++++++------ drivers/pci/setup-bus.c | 24 +++-- drivers/usb/core/usb-acpi.c | 1 - include/acpi/acpi_bus.h | 2 - include/linux/pci.h | 11 +-- 26 files changed, 281 insertions(+), 243 deletions(-)
Signature · 1 line
1.7.7
PATCH 1/29 PCI, x86: Separate out pcibios_allocate_bridge_resources()
Thus pcibios_allocate_bus_resources() could more simple and clean.
--- arch/x86/pci/i386.c | 46 ++++++++++++++++++++++++---------------------- 1 files changed, 24 insertions(+), 22 deletions(-)
arch/x86/pci/i386.c +24 -22
@@ -193,34 +193,36 @@ EXPORT_SYMBOL(pcibios_align_resource);* as well. */ -static void __init pcibios_allocate_bus_resources (struct list_head *bus_list) +static void __init pcibios_allocate_bridge_resources (struct pci_dev *dev) { -struct pci_bus *bus; -struct pci_dev *dev;int idx;struct resource *r; +for (idx =PCI_BRIDGE_RESOURCES ; idx <PCI_NUM_RESOURCES ; idx++) { + r = &dev->resource[idx]; +if (!r->flags) +continue ; +if (!r->start ||pci_claim_resource (dev, idx) <0 ) { +/* +* Something is wrong with the region. +* Invalidate the resource to prevent +* child resource allocations in this +* range. +*/ + r->start = r->end =0 ; + r->flags =0 ; + } + } +} + +static void __init pcibios_allocate_bus_resources (struct list_head *bus_list) +{ +struct pci_bus *bus; +/* Depth-First Search on bus tree */ list_for_each_entry (bus, bus_list, node) { -if ((dev = bus->self)) { -for (idx =PCI_BRIDGE_RESOURCES ; - idx <PCI_NUM_RESOURCES ; idx++) { - r = &dev->resource[idx]; -if (!r->flags) -continue ; -if (!r->start || -pci_claim_resource (dev, idx) <0 ) { -/* -* Something is wrong with the region. -* Invalidate the resource to prevent -* child resource allocations in this -* range. -*/ - r->start = r->end =0 ; - r->flags =0 ; - } - } - } +if (bus->self) +pcibios_allocate_bridge_resources (bus->self);pcibios_allocate_bus_resources (&bus->children); } }
Signature · 1 line
1.7.7
PATCH 2/29 PCI. x86: Separate out pcibios_allocate_dev_resources()
In reply to Yinghai LuThus pcibios_allocate_resources() could more simple and clean.
--- arch/x86/pci/i386.c | 42 +++++++++++++++++++++++------------------- 1 files changed, 23 insertions(+), 19 deletions(-)
arch/x86/pci/i386.c +23 -19
@@ -232,9 +232,8 @@ struct pci_check_idx_range {int end; }; -static void __init pcibios_allocate_resources (int pass) +static void __init pcibios_allocate_dev_resources (struct pci_dev *dev,int pass) { -struct pci_dev *dev =NULL ;int idx, disabled, i;u16 command;struct resource *r;
@@ -246,14 +245,13 @@ static void __init pcibios_allocate_resources(int pass)#endif }; -for_each_pci_dev (dev) { -pci_read_config_word (dev,PCI_COMMAND , &command); -for (i =0 ; i <ARRAY_SIZE (idx_range); i++) +pci_read_config_word (dev,PCI_COMMAND , &command); +for (i =0 ; i <ARRAY_SIZE (idx_range); i++)for (idx = idx_range[i].start; idx <= idx_range[i].end; idx++) { r = &dev->resource[idx]; -if (r->parent)/* Already allocated */ +if (r->parent)/* Already allocated */ continue ; -if (!r->start)/* Address not assigned at all */ +if (!r->start)/* Address not assigned at all */ continue ;if (r->flags &IORESOURCE_IO ) disabled = !(command &PCI_COMMAND_IO );
@@ -272,23 +270,29 @@ static void __init pcibios_allocate_resources(int pass) } } } -if (!pass) { - r = &dev->resource[PCI_ROM_RESOURCE ]; -if (r->flags &IORESOURCE_ROM_ENABLE ) { -/* Turn the ROM off, leave the resource region, -* but keep it unregistered. */ -u32 reg; -dev_dbg (&dev->dev,"disabling ROM %pR\n" , r); - r->flags &= ~IORESOURCE_ROM_ENABLE ; -pci_read_config_dword (dev, - dev->rom_base_reg, ®); -pci_write_config_dword (dev, dev->rom_base_reg, +if (!pass) { + r = &dev->resource[PCI_ROM_RESOURCE ]; +if (r->flags &IORESOURCE_ROM_ENABLE ) { +/* Turn the ROM off, leave the resource region, +* but keep it unregistered. */ +u32 reg; +dev_dbg (&dev->dev,"disabling ROM %pR\n" , r); + r->flags &= ~IORESOURCE_ROM_ENABLE ; +pci_read_config_dword (dev, dev->rom_base_reg, ®); +pci_write_config_dword (dev, dev->rom_base_reg, reg & ~PCI_ROM_ADDRESS_ENABLE ); - } } } } +static void __init pcibios_allocate_resources (int pass) +{ +struct pci_dev *dev =NULL ; + +for_each_pci_dev (dev) +pcibios_allocate_dev_resources (dev, pass); +} +static int __init pcibios_assign_resources (void ) {struct pci_dev *dev =NULL ;
Signature · 1 line
1.7.7
PATCH 3/29 PCI, x86: Let pcibios_allocate_bus_resources() take bus instead
In reply to Yinghai LuWill need call the same code for one single root bus during hot add. So make it take bus instead of bus list.
--- arch/x86/pci/i386.c | 38 +++++++++++++++++++++++++------------- 1 files changed, 25 insertions(+), 13 deletions(-)
arch/x86/pci/i386.c +25 -13
@@ -215,16 +215,15 @@ static void __init pcibios_allocate_bridge_resources(struct pci_dev *dev) } } -static void __init pcibios_allocate_bus_resources (struct list_head *bus_list) +static void __init pcibios_allocate_bus_resources (struct pci_bus *bus) { -struct pci_bus *bus; +struct pci_bus *child;/* Depth-First Search on bus tree */ -list_for_each_entry (bus, bus_list, node) { -if (bus->self) -pcibios_allocate_bridge_resources (bus->self); -pcibios_allocate_bus_resources (&bus->children); - } +if (bus->self) +pcibios_allocate_bridge_resources (bus->self); +list_for_each_entry (child, &bus->children, node) +pcibios_allocate_bus_resources (child); }struct pci_check_idx_range {
@@ -285,12 +284,18 @@ static void __init pcibios_allocate_dev_resources(struct pci_dev *dev, int pass) } } -static void __init pcibios_allocate_resources (int pass) +static void __init pcibios_allocate_resources (struct pci_bus *bus,int pass) { -struct pci_dev *dev =NULL ; +struct pci_dev *dev; +struct pci_bus *child; -for_each_pci_dev (dev) +list_for_each_entry (dev, &bus->devices, bus_list) {pcibios_allocate_dev_resources (dev, pass); + + child = dev->subordinate; +if (child) +pcibios_allocate_resources (child, pass); + } }static int __init pcibios_assign_resources (void )
@@ -323,10 +328,17 @@ static int __init pcibios_assign_resources(void)void __init pcibios_resource_survey (void ) { +struct pci_bus *bus; +DBG ("PCI: Allocating resources\n" ); -pcibios_allocate_bus_resources (&pci_root_buses); -pcibios_allocate_resources (0 ); -pcibios_allocate_resources (1 ); + +list_for_each_entry (bus, &pci_root_buses, node) +pcibios_allocate_bus_resources (bus); + +list_for_each_entry (bus, &pci_root_buses, node) +pcibios_allocate_resources (bus,0 ); +list_for_each_entry (bus, &pci_root_buses, node) +pcibios_allocate_resources (bus,1 );e820_reserve_resources_late ();/*
Signature · 1 line
1.7.7
PATCH 4/29 PCI, x86: Separate out rom resource claim
In reply to Yinghai LuSo could use it with hot-added root bus later.
-v2: remove extra functions.
--- arch/x86/pci/i386.c | 52 ++++++++++++++++++++++++++++++++++---------------- 1 files changed, 35 insertions(+), 17 deletions(-)
arch/x86/pci/i386.c +35 -17
@@ -298,27 +298,45 @@ static void __init pcibios_allocate_resources(struct pci_bus *bus, int pass) } } -static int __init pcibios_assign_resources (void ) +static void __init pcibios_allocate_dev_rom_resource (struct pci_dev *dev) { -struct pci_dev *dev =NULL ;struct resource *r; -if (!(pci_probe &PCI_ASSIGN_ROMS )) { -/* -* Try to use BIOS settings for ROMs, otherwise let -* pci_assign_unassigned_resources() allocate the new -* addresses. -*/ -for_each_pci_dev (dev) { - r = &dev->resource[PCI_ROM_RESOURCE ]; -if (!r->flags || !r->start) -continue ; -if (pci_claim_resource (dev,PCI_ROM_RESOURCE ) <0 ) { - r->end -= r->start; - r->start =0 ; - } - } +/* +* Try to use BIOS settings for ROMs, otherwise let +* pci_assign_unassigned_resources() allocate the new +* addresses. +*/ + r = &dev->resource[PCI_ROM_RESOURCE ]; +if (!r->flags || !r->start) +return ; + +if (pci_claim_resource (dev,PCI_ROM_RESOURCE ) <0 ) { + r->end -= r->start; + r->start =0 ; } +} +static void __init pcibios_allocate_rom_resources (struct pci_bus *bus) +{ +struct pci_dev *dev; +struct pci_bus *child; + +list_for_each_entry (dev, &bus->devices, bus_list) { +pcibios_allocate_dev_rom_resource (dev); + + child = dev->subordinate; +if (child) +pcibios_allocate_rom_resources (child); + } +} + +static int __init pcibios_assign_resources (void ) +{ +struct pci_bus *bus; + +if (!(pci_probe &PCI_ASSIGN_ROMS )) +list_for_each_entry (bus, &pci_root_buses, node) +pcibios_allocate_rom_resources (bus);pci_assign_unassigned_resources ();pcibios_fw_addr_list_del ();
Signature · 1 line
1.7.7
PATCH 5/29 PCI: rename pci_release_bus_bridge_dev to pci_release_host_bridge_dev
In reply to Yinghai Luit is for host bridge.
--- drivers/pci/probe.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/pci/probe.c +2 -2
@@ -1173,7 +1173,7 @@ int pci_cfg_space_size(struct pci_dev *dev)return PCI_CFG_SPACE_SIZE ; } -static void pci_release_bus_bridge_dev (struct device *dev) +static void pci_release_host_bridge_dev (struct device *dev) {struct pci_host_bridge *bridge =to_pci_host_bridge (dev);
@@ -1660,7 +1660,7 @@ struct pci_bus *pci_create_root_bus(struct device *parent, int bus, goto err_out; bridge->dev.parent = parent; - bridge->dev.release = pci_release_bus_bridge_dev; + bridge->dev.release = pci_release_host_bridge_dev;dev_set_name (&bridge->dev,"pci%04x:%02x" ,pci_domain_nr (b), bus); error =device_register (&bridge->dev);if (error)
Signature · 1 line
1.7.7
PATCH 6/29 PCI: Add dummy bus_type for pci_host_bridge
In reply to Yinghai Lu--- drivers/pci/pci-driver.c | 11 ++++++++++- drivers/pci/probe.c | 1 + include/linux/pci.h | 1 + 3 files changed, 12 insertions(+), 1 deletions(-)
drivers/pci/pci-driver.c +10 -1
@@ -1268,11 +1268,20 @@ struct bus_type pci_bus_type = { .pm = PCI_PM_OPS_PTR, }; +struct bus_type pci_host_bridge_bus_type = { + .name ="pci_host_bridge" , +}; + +static int __init pci_host_bridge_driver_init (void ) +{ +return bus_register (&pci_host_bridge_bus_type); +} +postcore_initcall (pci_host_bridge_driver_init); +static int __init pci_driver_init (void ) {return bus_register (&pci_bus_type); } -postcore_initcall (pci_driver_init);EXPORT_SYMBOL_GPL (pci_add_dynid);
drivers/pci/probe.c +1 -0
@@ -1660,6 +1660,7 @@ struct pci_bus *pci_create_root_bus(struct device *parent, int bus, goto err_out; bridge->dev.parent = parent; + bridge->dev.bus = &pci_host_bridge_bus_type; bridge->dev.release = pci_release_host_bridge_dev;dev_set_name (&bridge->dev,"pci%04x:%02x" ,pci_domain_nr (b), bus); error =device_register (&bridge->dev);
include/linux/pci.h +1 -0
@@ -668,6 +668,7 @@ enum pcie_bus_config_types {extern enum pcie_bus_config_types pcie_bus_config; +extern struct bus_type pci_host_bridge_bus_type;extern struct bus_type pci_bus_type;/* Do NOT directly access these two variables, unless you are arch specific pci
Signature · 1 line
1.7.7
PATCH 7/29 PCI, ACPI: add acpi_bus_type for host bridge
In reply to Yinghai LuInstead of abusing of acp_bus_type for pci device and checking device name tricks
--- drivers/acpi/glue.c | 4 ++-- drivers/pci/pci-acpi.c | 13 +++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-)
drivers/acpi/glue.c +2 -2
@@ -210,8 +210,8 @@ static int acpi_platform_notify(struct device *dev)acpi_handle handle;int ret = -EINVAL ; -if (!dev->bus || !dev->parent) { -/* bridge devices genernally haven't bus or parent */ +if (!dev->bus) { +/* bridge devices genernally haven't bus */ ret =acpi_find_bridge_device (dev, &handle); goto end; }
drivers/pci/pci-acpi.c +11 -2
@@ -360,7 +360,8 @@ static int acpi_pci_find_device(struct device *dev, acpi_handle *handle)return 0 ; } -static int acpi_pci_find_root_bridge (struct device *dev,acpi_handle *handle) +static int acpi_pci_host_bridge_find_device (struct device *dev, +acpi_handle *handle) {int num;unsigned int seg, bus;
@@ -378,10 +379,14 @@ static int acpi_pci_find_root_bridge(struct device *dev, acpi_handle *handle)return 0 ; } +static struct acpi_bus_type acpi_pci_host_bridge_bus = { + .bus = &pci_host_bridge_bus_type, + .find_device = acpi_pci_host_bridge_find_device, +}; +static struct acpi_bus_type acpi_pci_bus = { .bus = &pci_bus_type, .find_device = acpi_pci_find_device, - .find_bridge = acpi_pci_find_root_bridge, };static int __init acpi_pci_init (void )
@@ -398,6 +403,10 @@ static int __init acpi_pci_init(void)pcie_no_aspm (); } + ret =register_acpi_bus_type (&acpi_pci_host_bridge_bus); +if (ret) +return 0 ; + ret =register_acpi_bus_type (&acpi_pci_bus);if (ret)return 0 ;
Signature · 1 line
1.7.7
PATCH 8/29 PCI, ACPI: Remove acpi_find_bridge_device for acpi_bus_type
In reply to Yinghai LuNow all acpi_bus_typs definitions have bus assigned, so remove not needed code.
--- drivers/acpi/glue.c | 20 ++------------------ 1 files changed, 2 insertions(+), 18 deletions(-)
drivers/acpi/glue.c +2 -18
@@ -72,22 +72,6 @@ static struct acpi_bus_type *acpi_get_bus_type(struct bus_type *type)return ret; } -static int acpi_find_bridge_device (struct device *dev,acpi_handle * handle) -{ -struct acpi_bus_type *tmp; -int ret = -ENODEV ; - -down_read (&bus_type_sem); -list_for_each_entry (tmp, &bus_type_list, list) { -if (tmp->find_bridge && !tmp->find_bridge (dev, handle)) { - ret =0 ; -break ; - } - } -up_read (&bus_type_sem); -return ret; -} -/* Get device's handler per its address under its parent */ struct acpi_find_child {acpi_handle handle;
@@ -211,10 +195,10 @@ static int acpi_platform_notify(struct device *dev)int ret = -EINVAL ;if (!dev->bus) { -/* bridge devices genernally haven't bus */ - ret =acpi_find_bridge_device (dev, &handle); +DBG ("No bus is set for %s\n" ,dev_name (dev)); goto end; } + type =acpi_get_bus_type (dev->bus);if (!type) {DBG ("No ACPI bus support for %s\n" ,dev_name (dev));
Signature · 1 line
1.7.7
PATCH 9/29 PCI, libata: remove find_bridge in acpi_bus_type
In reply to Yinghai LuThe struct member is not used anymore, remove it.
--- drivers/ata/libata-acpi.c | 6 ------ 1 files changed, 0 insertions(+), 6 deletions(-)
drivers/ata/libata-acpi.c +0 -6
@@ -1168,13 +1168,7 @@ static int ata_acpi_find_device(struct device *dev, acpi_handle *handle)return -ENODEV ; } -static int ata_acpi_find_dummy (struct device *dev,acpi_handle *handle) -{ -return -ENODEV ; -} -static struct acpi_bus_type ata_acpi_bus = { - .find_bridge = ata_acpi_find_dummy, .find_device = ata_acpi_find_device, };
Signature · 1 line
1.7.7
Re: [PATCH 09/29] PCI, libata: remove find_bridge in acpi_bus_type
Quoted 8 lines · Yinghai Lu
The struct member is not used anymore, remove it.
--- drivers/ata/libata-acpi.c | 6 ------ 1 files changed, 0 insertions(+), 6 deletions(-)
PATCH 10/29 PCI, USB: remove find_bridge in acpi_bus_type
In reply to Yinghai LuThe struct member is not used anymore, remove it.
--- drivers/usb/core/usb-acpi.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/usb/core/usb-acpi.c +0 -1
@@ -102,7 +102,6 @@ static int usb_acpi_find_device(struct device *dev, acpi_handle *handle)static struct acpi_bus_type usb_acpi_bus = { .bus = &usb_bus_type, - .find_bridge =NULL , .find_device = usb_acpi_find_device, };
Signature · 1 line
1.7.7
Re: [PATCH 10/29] PCI, USB: remove find_bridge in acpi_bus_type
2012/9/25 Yinghai Lu <[email protected]>:
Quoted 14 lines
The struct member is not used anymore, remove it.
Signed-off-by Yinghai Lu <[email protected]>Cc Greg Kroah-Hartman <[email protected]>--- drivers/usb/core/usb-acpi.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)drivers/usb/core/usb-acpi.c +0
-0
drivers/usb/core/usb-acpi.c static int usb_acpi_find_device(struct device *dev, acpi_handle *handle) · line 107
Quoted 7 lines
drivers/usb/core/usb-acpi.c +0
-1@@ -102,7 +102,6 @@ static int usb_acpi_find_device(struct device *dev, acpi_handle *handle)static struct acpi_bus_type usb_acpi_bus = { .bus = &usb_bus_type, - .find_bridge =NULL , .find_device = usb_acpi_find_device, };
HI Yinghai:
This member has been populated in the usb-next tree.
Quoted 7 lines
--
1.7.7--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Best regards
Tianyu Lan
Re: [PATCH 10/29] PCI, USB: remove find_bridge in acpi_bus_type
Quoted 25 lines · Lan Tianyu
2012/9/25 Yinghai Lu <[email protected]>:
Quoted 14 lines
The struct member is not used anymore, remove it.
Signed-off-by Yinghai Lu <[email protected]>Cc Greg Kroah-Hartman <[email protected]>--- drivers/usb/core/usb-acpi.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)drivers/usb/core/usb-acpi.c +0
-0drivers/usb/core/usb-acpi.c static int usb_acpi_find_device(struct device *dev, acpi_handle *handle) · line 107
Quoted 7 lines
drivers/usb/core/usb-acpi.c +0
-1@@ -102,7 +102,6 @@ static int usb_acpi_find_device(struct device *dev, acpi_handle *handle)static struct acpi_bus_type usb_acpi_bus = { .bus = &usb_bus_type, - .find_bridge =NULL , .find_device = usb_acpi_find_device, };HI Yinghai:
This member has been populated in the usb-next tree.
Quoted 1 line
Thanks for pointing that out.
Looks that following change is not needed in that commit.
@@ -102,7 +139,7 @@ static int usb_acpi_find_device(struct device *dev, acpi_handle *handle)
static struct acpi_bus_type usb_acpi_bus = {
.bus = &usb_bus_type,- .find_bridge = NULL,
+ .find_bridge = usb_acpi_find_device,
.find_device = usb_acpi_find_device,
};
Can you double check if it will work without that line change?
-Yinghai
Re: [PATCH 10/29] PCI, USB: remove find_bridge in acpi_bus_type
Quoted 34 lines · Yinghai Lu
Quoted 25 lines · Lan Tianyu
2012/9/25 Yinghai Lu <[email protected]>:
Quoted 14 lines
The struct member is not used anymore, remove it.
Signed-off-by Yinghai Lu <[email protected]>Cc Greg Kroah-Hartman <[email protected]>--- drivers/usb/core/usb-acpi.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)drivers/usb/core/usb-acpi.c +0
-0drivers/usb/core/usb-acpi.c static int usb_acpi_find_device(struct device *dev, acpi_handle *handle) · line 107
Quoted 7 lines
drivers/usb/core/usb-acpi.c +0
-1@@ -102,7 +102,6 @@ static int usb_acpi_find_device(struct device *dev, acpi_handle *handle)static struct acpi_bus_type usb_acpi_bus = { .bus = &usb_bus_type, - .find_bridge =NULL , .find_device = usb_acpi_find_device, };HI Yinghai:
This member has been populated in the usb-next tree.Quoted 1 line
Thanks for pointing that out.
Looks that following change is not needed in that commit.
Review static int usb_acpi_find_device(struct device · line 145
Quoted 8 lines
(quoted diff) +1
-1@@ -102,7 +139,7 @@ static int usb_acpi_find_device(struct device *dev, acpi_handle *handle) static struct acpi_bus_type usb_acpi_bus = { .bus = &usb_bus_type, - .find_bridge = NULL, + .find_bridge = usb_acpi_find_device, .find_device = usb_acpi_find_device, };
after looking your code closely, that find_bridge is still needed. that usb_port does not have usb_bus_type.
but mixing find bridge and find device cause confusing.
Please check attached patch that will separate find_bridge out.
-Yinghai
Subject: [PATCH] usb, ACPI: Separate out usb_acpi_find_bridge
usb_acpi_find_device is for usb_device and it has usb_device_type and usb_bus_type. So could remove not needed is_usb_device checking.
usb_acpi_find_bridge is for usb_port, and it has usb_port_device_type only.
--- drivers/usb/core/usb-acpi.c | 137 +++++++++++++++++++++++--------------------- 1 file changed, 72 insertions(+), 65 deletions(-)
drivers/usb/core/usb-acpi.c +72 -65
@@ -125,93 +125,100 @@ out:return ret; } -static int usb_acpi_find_device (struct device *dev,acpi_handle *handle) +/* +* In the ACPI DSDT table, only usb root hub and usb ports are +* acpi device nodes. The hierarchy like following. +* Device (EHC1) +* Device (HUBN) +* Device (PR01) +* Device (PR11) +* Device (PR12) +* Device (PR13) +* ... +* So all binding process is divided into two parts. binding +* root hub and usb ports. +*/ + +static int usb_acpi_find_bridge (struct device *dev,acpi_handle *handle) {struct usb_device *udev;acpi_handle *parent_handle;int port_num; +if (!is_usb_port (dev)) +return -ENODEV ; + +sscanf (dev_name (dev),"port%d" , &port_num); +/* Get the struct usb_device point of port's hub */ + udev =to_usb_device (dev->parent->parent); +/* -* In the ACPI DSDT table, only usb root hub and usb ports are -* acpi device nodes. The hierarchy like following. -* Device (EHC1) -* Device (HUBN) -* Device (PR01) -* Device (PR11) -* Device (PR12) -* Device (PR13) -* ... -* So all binding process is divided into two parts. binding -* root hub and usb ports. +* The root hub ports' parent is the root hub. The non-root-hub +* ports' parent is the parent hub port which the hub is +* connected to. */ -if (is_usb_device (dev)) { - udev =to_usb_device (dev); -if (udev->parent) { -enum usb_port_connect_type type; - -/* -* According usb port's connect type to set usb device's -* removability. -*/ - type =usb_get_hub_port_connect_type (udev->parent, - udev->portnum); -switch (type) { -case USB_PORT_CONNECT_TYPE_HOT_PLUG : - udev->removable =USB_DEVICE_REMOVABLE ; -break ; -case USB_PORT_CONNECT_TYPE_HARD_WIRED : - udev->removable =USB_DEVICE_FIXED ; -break ; -default : - udev->removable =USB_DEVICE_REMOVABLE_UNKNOWN ; -break ; - } - +if (!udev->parent) { + *handle =acpi_get_child (DEVICE_ACPI_HANDLE (&udev->dev), + port_num); +if (!*handle) +return -ENODEV ; + }else { + parent_handle = +usb_get_hub_port_acpi_handle (udev->parent, + udev->portnum); +if (!parent_handle)return -ENODEV ; - } -/* root hub's parent is the usb hcd. */ - parent_handle =DEVICE_ACPI_HANDLE (dev->parent); - *handle =acpi_get_child (parent_handle, udev->portnum); + *handle =acpi_get_child (parent_handle, port_num);if (!*handle)return -ENODEV ; -return 0 ; - }else if (is_usb_port (dev)) { -sscanf (dev_name (dev),"port%d" , &port_num); -/* Get the struct usb_device point of port's hub */ - udev =to_usb_device (dev->parent->parent); + } +usb_acpi_check_port_connect_type (udev, *handle, port_num); + +return 0 ; +} + +static int usb_acpi_find_device (struct device *dev,acpi_handle *handle) +{ +struct usb_device *udev; +acpi_handle *parent_handle; + + udev =to_usb_device (dev); +if (udev->parent) { +enum usb_port_connect_type type;/* -* The root hub ports' parent is the root hub. The non-root-hub -* ports' parent is the parent hub port which the hub is -* connected to. +* According usb port's connect type to set usb device's +* removability. */ -if (!udev->parent) { - *handle =acpi_get_child (DEVICE_ACPI_HANDLE (&udev->dev), - port_num); -if (!*handle) -return -ENODEV ; - }else { - parent_handle = -usb_get_hub_port_acpi_handle (udev->parent, - udev->portnum); -if (!parent_handle) -return -ENODEV ; - - *handle =acpi_get_child (parent_handle, port_num); -if (!*handle) -return -ENODEV ; + type =usb_get_hub_port_connect_type (udev->parent, + udev->portnum); +switch (type) { +case USB_PORT_CONNECT_TYPE_HOT_PLUG : + udev->removable =USB_DEVICE_REMOVABLE ; +break ; +case USB_PORT_CONNECT_TYPE_HARD_WIRED : + udev->removable =USB_DEVICE_FIXED ; +break ; +default : + udev->removable =USB_DEVICE_REMOVABLE_UNKNOWN ; +break ; } -usb_acpi_check_port_connect_type (udev, *handle, port_num); - }else +return -ENODEV ; + } +/* root hub's parent is the usb hcd. */ + parent_handle =DEVICE_ACPI_HANDLE (dev->parent); + *handle =acpi_get_child (parent_handle, udev->portnum); +if (!*handle) +return -ENODEV ;return 0 ; }static struct acpi_bus_type usb_acpi_bus = { .bus = &usb_bus_type, - .find_bridge = usb_acpi_find_device, + .find_bridge = usb_acpi_find_bridge, .find_device = usb_acpi_find_device, };
Re: [PATCH 10/29] PCI, USB: remove find_bridge in acpi_bus_type
2012/9/28 Yinghai Lu <[email protected]>:
Quoted 36 lines · Yinghai Lu
Quoted 35 lines · Lan Tianyu
Quoted 25 lines
2012/9/25 Yinghai Lu <[email protected]>:
Quoted 14 lines
The struct member is not used anymore, remove it.
Signed-off-by Yinghai Lu <[email protected]>Cc Greg Kroah-Hartman <[email protected]>--- drivers/usb/core/usb-acpi.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)drivers/usb/core/usb-acpi.c +0
-0drivers/usb/core/usb-acpi.c static int usb_acpi_find_device(struct device *dev, acpi_handle *handle) · line 107
Quoted 7 lines
drivers/usb/core/usb-acpi.c +0
-1@@ -102,7 +102,6 @@ static int usb_acpi_find_device(struct device *dev, acpi_handle *handle)static struct acpi_bus_type usb_acpi_bus = { .bus = &usb_bus_type, - .find_bridge =NULL , .find_device = usb_acpi_find_device, };HI Yinghai:
This member has been populated in the usb-next tree.Quoted 1 line
Thanks for pointing that out.
Looks that following change is not needed in that commit.
(quoted diff) +0
-0@@ -102,7 +139,7 @@ static int usb_acpi_find_device(struct device *dev, acpi_handle *handle)
Quoted 10 lines
drivers/usb/core/usb-acpi.c out: · line 223
Quoted 7 lines
drivers/usb/core/usb-acpi.c +1
-1static struct acpi_bus_type usb_acpi_bus = { .bus = &usb_bus_type, - .find_bridge =NULL , + .find_bridge = usb_acpi_find_device, .find_device = usb_acpi_find_device, };after looking your code closely, that
find_bridgeis still needed. thatusb_portdoes not haveusb_bus_type.
hi Yinghai:
Sorry for late reply. You are right.
Quoted 4 lines
but mixing find bridge and find device cause confusing.
Please check attached patch that will separate
find_bridgeout.
Ok. Find one indention error.
- return 0;
- } else if (is_usb_port(dev)) {
- sscanf(dev_name(dev), "port%d", &port_num);
- /* Get the struct usb_device point of port's hub */
- udev = to_usb_device(dev->parent->parent);
+ }
+ usb_acpi_check_port_connect_type(udev, *handle, port_num); <== one more tab.
+
+ return 0;
+}
+
Quoted 2 lines
-Yinghai
--
Best regards
Tianyu Lan
PATCH 11/29 PCI, ACPI: remove find_bridge in acpi_bus_type
In reply to Yinghai LuThe struct member is not used anymore, remove it.
--- include/acpi/acpi_bus.h | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
include/acpi/acpi_bus.h +0 -2
@@ -389,8 +389,6 @@ struct acpi_bus_type {struct bus_type *bus;/* For general devices under the bus */ int (*find_device) (struct device *,acpi_handle *); -/* For bridges, such as PCI root bridge, IDE controller */ -int (*find_bridge) (struct device *,acpi_handle *); };int register_acpi_bus_type (struct acpi_bus_type *);int unregister_acpi_bus_type (struct acpi_bus_type *);
Signature · 1 line
1.7.7
PATCH 12/29 PCI: Add for_each_pci_host_bridge() and pci_get_next_host_bridge
In reply to Yinghai Luuse bus_find_device to loop host_bridges.
--- drivers/pci/search.c | 23 +++++++++++++++++++++++ include/linux/pci.h | 3 +++ 2 files changed, 26 insertions(+), 0 deletions(-)
drivers/pci/search.c +23 -0
@@ -178,6 +178,29 @@ struct pci_dev *pci_get_domain_bus_and_slot(int domain, unsigned int bus, }EXPORT_SYMBOL (pci_get_domain_bus_and_slot); +static int match_pci_host_bridge (struct device *dev,void *data) +{ +return 1 ; +} + +struct pci_host_bridge *pci_get_next_host_bridge (struct pci_host_bridge *from) +{ +struct device *dev; +struct device *dev_start =NULL ; +struct pci_host_bridge *bridge =NULL ; + +WARN_ON (in_interrupt ()); +if (from) + dev_start = &from->dev; + dev =bus_find_device (&pci_host_bridge_bus_type, dev_start,NULL , + match_pci_host_bridge); +if (dev) + bridge =to_pci_host_bridge (dev); +if (from) +put_device (&from->dev); +return bridge; +} +static int match_pci_dev_by_id (struct device *dev,void *data) {struct pci_dev *pdev =to_pci_dev (dev);
include/linux/pci.h +3 -0
@@ -394,6 +394,8 @@ struct pci_host_bridge { };#define to_pci_host_bridge (n) container_of(n, struct pci_host_bridge, dev) +#define for_each_pci_host_bridge (d) while (d = pci_get_next_host_bridge(d)) +void pci_set_host_bridge_release (struct pci_host_bridge *bridge,void (*release_fn)(struct pci_host_bridge *),void *release_data);
@@ -758,6 +760,7 @@ int pci_find_ht_capability(struct pci_dev *dev, int ht_cap);int pci_find_next_ht_capability (struct pci_dev *dev,int pos,int ht_cap);struct pci_bus *pci_find_next_bus (const struct pci_bus *from); +struct pci_host_bridge *pci_get_next_host_bridge (struct pci_host_bridge *from);struct pci_dev *pci_get_device (unsigned int vendor,unsigned int device,struct pci_dev *from); struct pci_dev *pci_get_subsys(unsigned int vendor, unsigned int device,
Signature · 1 line
1.7.7
Re: [PATCH 12/29] PCI: Add for_each_pci_host_bridge() and pci_get_next_host_bridge
Quoted 57 lines · Yinghai Lu
use
bus_find_deviceto loophost_bridges.Signed-off-by Yinghai Lu <[email protected]>--- drivers/pci/search.c | 23 +++++++++++++++++++++++ include/linux/pci.h | 3 +++ 2 files changed, 26 insertions(+), 0 deletions(-)drivers/pci/search.c +23
-0@@ -178,6 +178,29 @@ struct pci_dev *pci_get_domain_bus_and_slot(int domain, unsigned int bus, }EXPORT_SYMBOL (pci_get_domain_bus_and_slot); +static int match_pci_host_bridge (struct device *dev,void *data) +{ +return 1 ; +} + +struct pci_host_bridge *pci_get_next_host_bridge (struct pci_host_bridge *from) +{ +struct device *dev; +struct device *dev_start =NULL ; +struct pci_host_bridge *bridge =NULL ; + +WARN_ON (in_interrupt ()); +if (from) + dev_start = &from->dev; + dev =bus_find_device (&pci_host_bridge_bus_type, dev_start,NULL , + match_pci_host_bridge); +if (dev) + bridge =to_pci_host_bridge (dev); +if (from) +put_device (&from->dev); +return bridge; +} +static int match_pci_dev_by_id (struct device *dev,void *data) {struct pci_dev *pdev =to_pci_dev (dev);include/linux/pci.h +2
-0@@ -394,6 +394,8 @@ struct pci_host_bridge { };#define to_pci_host_bridge (n) container_of(n, struct pci_host_bridge, dev) +#define for_each_pci_host_bridge (d) while (d = pci_get_next_host_bridge(d)) +void pci_set_host_bridge_release (struct pci_host_bridge *bridge,void (*release_fn)(struct pci_host_bridge *),void *release_data);
include/linux/pci.h int pci_find_ht_capability(struct pci_dev *dev, int ht_cap); · line 766
Quoted 7 lines
include/linux/pci.h +1
-0@@ -758,6 +760,7 @@ int pci_find_ht_capability(struct pci_dev *dev, int ht_cap);int pci_find_next_ht_capability (struct pci_dev *dev,int pos,int ht_cap);struct pci_bus *pci_find_next_bus (const struct pci_bus *from); +struct pci_host_bridge *pci_get_next_host_bridge (struct pci_host_bridge *from);struct pci_dev *pci_get_device (unsigned int vendor,unsigned int device,struct pci_dev *from); struct pci_dev *pci_get_subsys(unsigned int vendor, unsigned int device,
Hi Yinghai,
I'm working on a patchset to get rid of pci_find_next_bus() by usingclass_for_each_device(&pcibus_class, xxx). I think your solution is better, which removes both pci_find_next_bus() and pci_root_buses list. So I will give up my version.
Thanks!
Gerry
Re: [PATCH 12/29] PCI: Add for_each_pci_host_bridge() and pci_get_next_host_bridge
Quoted 5 lines · Jiang Liu
Hi Yinghai,
I'm working on a patchset to get rid ofpci_find_next_bus()by usingclass_for_each_device(&pcibus_class, xxx). I think your solution is better, which removes bothpci_find_next_bus()andpci_root_buseslist. So I will give up my version.
Good.
updated version that fixes compiling problem that Fengguang found.
-Yinghai
Subject: [PATCH] PCI: Add for_each_pci_host_bridge() and pci_get_next_host_bridge
use bus_find_device to loop host_bridges.
-v2: fixes compiling error when CONFIG_PCI is not defined that Fengguang Wu found.
--- drivers/pci/search.c | 23 +++++++++++++++++++++++ include/linux/pci.h | 9 +++++++++ 2 files changed, 32 insertions(+)
include/linux/pci.h +9 -0
@@ -394,6 +394,8 @@ struct pci_host_bridge { };#define to_pci_host_bridge (n) container_of(n, struct pci_host_bridge, dev) +#define for_each_pci_host_bridge (d) while (d = pci_get_next_host_bridge(d)) +void pci_set_host_bridge_release (struct pci_host_bridge *bridge,void (*release_fn)(struct pci_host_bridge *),void *release_data);
@@ -759,6 +761,7 @@ int pci_find_ht_capability(struct pci_deint pci_find_next_ht_capability (struct pci_dev *dev,int pos,int ht_cap);struct pci_bus *pci_find_next_bus (const struct pci_bus *from); +struct pci_host_bridge *pci_get_next_host_bridge (struct pci_host_bridge *from);struct pci_dev *pci_get_device (unsigned int vendor,unsigned int device,struct pci_dev *from); struct pci_dev *pci_get_subsys(unsigned int vendor, unsigned int device,
@@ -1415,6 +1418,12 @@ static inline int pci_domain_nr(struct pstatic inline struct pci_dev *pci_dev_get (struct pci_dev *dev) {return NULL ; } +static inline struct pci_host_bridge *pci_get_next_host_bridge ( +struct pci_host_bridge *host_bridge) +{ +return NULL ; +} +#define dev_is_pci (d) (false)#define dev_is_pf (d) (false)#define dev_num_vf (d) (0)
drivers/pci/search.c +23 -0
@@ -178,6 +178,29 @@ struct pci_dev *pci_get_domain_bus_and_s }EXPORT_SYMBOL (pci_get_domain_bus_and_slot); +static int match_pci_host_bridge (struct device *dev,void *data) +{ +return 1 ; +} + +struct pci_host_bridge *pci_get_next_host_bridge (struct pci_host_bridge *from) +{ +struct device *dev; +struct device *dev_start =NULL ; +struct pci_host_bridge *bridge =NULL ; + +WARN_ON (in_interrupt ()); +if (from) + dev_start = &from->dev; + dev =bus_find_device (&pci_host_bridge_bus_type, dev_start,NULL , + match_pci_host_bridge); +if (dev) + bridge =to_pci_host_bridge (dev); +if (from) +put_device (&from->dev); +return bridge; +} +static int match_pci_dev_by_id (struct device *dev,void *data) {struct pci_dev *pdev =to_pci_dev (dev);
Re: [PATCH 12/29] PCI: Add for_each_pci_host_bridge() and pci_get_next_host_bridge
In reply to Yinghai LuHi Yinghai,
Seems it would be better to change pci_get_next_host_bridge()
to pci_get_next_root_bus(struct pci_bus *bus). Almost all caller of pci_get_next_host_bridge() has a pattern:
host_bridge = pci_get_next_host_bridge();xxx_func(host_brige->bus);
And you add:
Thanks
Gerry
Quoted 64 lines · Yinghai Lu
use
bus_find_deviceto loophost_bridges.Signed-off-by Yinghai Lu <[email protected]>--- drivers/pci/search.c | 23 +++++++++++++++++++++++ include/linux/pci.h | 3 +++ 2 files changed, 26 insertions(+), 0 deletions(-)drivers/pci/search.c +23
-0@@ -178,6 +178,29 @@ struct pci_dev *pci_get_domain_bus_and_slot(int domain, unsigned int bus, }EXPORT_SYMBOL (pci_get_domain_bus_and_slot); +static int match_pci_host_bridge (struct device *dev,void *data) +{ +return 1 ; +} + +struct pci_host_bridge *pci_get_next_host_bridge (struct pci_host_bridge *from) +{ +struct device *dev; +struct device *dev_start =NULL ; +struct pci_host_bridge *bridge =NULL ; + +WARN_ON (in_interrupt ()); +if (from) + dev_start = &from->dev; + dev =bus_find_device (&pci_host_bridge_bus_type, dev_start,NULL , + match_pci_host_bridge); +if (dev) + bridge =to_pci_host_bridge (dev); +if (from) +put_device (&from->dev); +return bridge; +} +static int match_pci_dev_by_id (struct device *dev,void *data) {struct pci_dev *pdev =to_pci_dev (dev);include/linux/pci.h +3
-0@@ -394,6 +394,8 @@ struct pci_host_bridge { };#define to_pci_host_bridge (n) container_of(n, struct pci_host_bridge, dev) +#define for_each_pci_host_bridge (d) while (d = pci_get_next_host_bridge(d)) +void pci_set_host_bridge_release (struct pci_host_bridge *bridge,void (*release_fn)(struct pci_host_bridge *),void *release_data);@@ -758,6 +760,7 @@ int pci_find_ht_capability(struct pci_dev *dev, int ht_cap);int pci_find_next_ht_capability (struct pci_dev *dev,int pos,int ht_cap);struct pci_bus *pci_find_next_bus (const struct pci_bus *from); +struct pci_host_bridge *pci_get_next_host_bridge (struct pci_host_bridge *from);struct pci_dev *pci_get_device (unsigned int vendor,unsigned int device,struct pci_dev *from); struct pci_dev *pci_get_subsys(unsigned int vendor, unsigned int device,
PATCH 1/1 PCI: Add for_each_pci_host_bridge() and pci_get_next_host_bridge
In reply to Yinghai LuFrom: Yinghai Lu <[email protected]>
use bus_find_device to loop host_bridges.
--- drivers/pci/search.c | 22 ++++++++++++++++++++++ include/linux/pci.h | 3 +++ 2 files changed, 25 insertions(+)
drivers/pci/search.c +22 -0
@@ -178,6 +178,28 @@ struct pci_dev *pci_get_domain_bus_and_slot(int domain, unsigned int bus, }EXPORT_SYMBOL (pci_get_domain_bus_and_slot); +static int match_pci_host_bridge (struct device *dev,void *data) +{ +return 1 ; +} + +struct pci_bus *pci_get_next_root_bus (struct pci_bus *bus) +{ +struct device *dev; + +WARN_ON (in_interrupt ()); + dev =bus_find_device (&pci_host_bridge_bus_type, + bus ? bus->bridge :NULL , +NULL , + match_pci_host_bridge); +if (bus) +put_device (bus->bridge); +if (dev) +return to_pci_host_bridge (dev)->bus; + +return NULL ; +} +static int match_pci_dev_by_id (struct device *dev,void *data) {struct pci_dev *pdev =to_pci_dev (dev);
include/linux/pci.h +3 -0
@@ -394,6 +394,8 @@ struct pci_host_bridge { };#define to_pci_host_bridge (n) container_of(n, struct pci_host_bridge, dev) +#define for_each_pci_root_bus (bus) while (bus = pci_get_next_root_bus(bus)) +void pci_set_host_bridge_release (struct pci_host_bridge *bridge,void (*release_fn)(struct pci_host_bridge *),void *release_data);
@@ -757,6 +759,7 @@ int pci_find_ht_capability(struct pci_dev *dev, int ht_cap);int pci_find_next_ht_capability (struct pci_dev *dev,int pos,int ht_cap);struct pci_bus *pci_find_next_bus (const struct pci_bus *from); +struct pci_bus *pci_get_next_root_bus (struct pci_bus *from);struct pci_dev *pci_get_device (unsigned int vendor,unsigned int device,struct pci_dev *from); struct pci_dev *pci_get_subsys(unsigned int vendor, unsigned int device,
Signature · 1 line
1.7.9.5
Re: [PATCH] PCI: Add for_each_pci_host_bridge() and pci_get_next_host_bridge
Quoted 29 lines · Jiang Liu
From: Yinghai Lu <[email protected]>
use
bus_find_deviceto loophost_bridges.Signed-off-by Yinghai Lu <[email protected]>--- drivers/pci/search.c | 22 ++++++++++++++++++++++ include/linux/pci.h | 3 +++ 2 files changed, 25 insertions(+)drivers/pci/search.c +11
-0@@ -178,6 +178,28 @@ struct pci_dev *pci_get_domain_bus_and_slot(int domain, unsigned int bus, }EXPORT_SYMBOL (pci_get_domain_bus_and_slot); +static int match_pci_host_bridge (struct device *dev,void *data) +{ +return 1 ; +} + +struct pci_bus *pci_get_next_root_bus (struct pci_bus *bus) +{ +struct device *dev; + +WARN_ON (in_interrupt ()); + dev = bus_find_device(&pci_host_bridge_bus_type,
drivers/pci/search.c struct pci_dev *pci_get_domain_bus_and_slot(int domain, unsigned int bus, · line 201
Quoted 10 lines
drivers/pci/search.c +10
-0+ bus ? bus->bridge :NULL , +NULL , + match_pci_host_bridge); +if (bus) +put_device (bus->bridge); +if (dev) +return to_pci_host_bridge (dev)->bus; + +return NULL ; +}
that interface is not good, bus could be not root bus.
Also now we still have chance to have root bridge is there, but root bus already get removed ?
Actually some root member should be in pci host bridge instead. So don't need to go deep to bus anymore.
hope we should get rid of pci_bus.
-Yinghai
PATCH 13/29 PCI, hotplug: kill pci_find_next_bus n sgi_hotplug
In reply to Yinghai Lu--- drivers/pci/hotplug/sgi_hotplug.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/pci/hotplug/sgi_hotplug.c +4 -2
@@ -678,7 +678,7 @@ alloc_err:static int __init sn_pci_hotplug_init (void ) { -struct pci_bus *pci_bus =NULL ; +struct pci_host_bridge *host_bridge =NULL ;int rc;int registered =0 ;
@@ -690,7 +690,9 @@ static int __init sn_pci_hotplug_init(void)INIT_LIST_HEAD (&sn_hp_list); -while ((pci_bus =pci_find_next_bus (pci_bus))) { +for_each_pci_host_bridge (host_bridge) { +struct pci_bus *pci_bus = host_bridge->bus; +if (!pci_bus->sysdata)continue ;
Signature · 1 line
1.7.7
PATCH 14/29 PCI: kill pci_find_next_bus in pci_sysfs
In reply to Yinghai Lu--- drivers/pci/pci-sysfs.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/pci/pci-sysfs.c +3 -3
@@ -290,15 +290,15 @@ static ssize_t bus_rescan_store(struct bus_type *bus, const char *buf, size_t count) {unsigned long val; -struct pci_bus *b =NULL ; +struct pci_host_bridge *host_bridge =NULL ;if (strict_strtoul (buf,0 , &val) <0 )return -EINVAL ;if (val) {mutex_lock (&pci_remove_rescan_mutex); -while ((b =pci_find_next_bus (b)) !=NULL ) -pci_rescan_bus (b); +for_each_pci_host_bridge (host_bridge) +pci_rescan_bus (host_bridge->bus);mutex_unlock (&pci_remove_rescan_mutex); }return count;
Signature · 1 line
1.7.7
PATCH 15/29 PCI, edac: kill pci_find_next_bus in edac
In reply to Yinghai Lu--- drivers/edac/i7core_edac.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/edac/i7core_edac.c +3 -3
@@ -1294,10 +1294,10 @@ static void __init i7core_xeon_pci_fixup(const struct pci_id_table *table)static unsigned i7core_pci_lastbus (void ) {int last_bus =0 , bus; -struct pci_bus *b =NULL ; +struct pci_host_bridge *host_bridge =NULL ; -while ((b =pci_find_next_bus (b)) !=NULL ) { - bus = b->number; +for_each_pci_host_bridge (host_bridge) { + bus = host_bridge->bus->number;edac_dbg (0 ,"Found bus %d\n" , bus);if (bus > last_bus) last_bus = bus;
Signature · 1 line
1.7.7
Re: [PATCH 15/29] PCI, edac: kill pci_find_next_bus in edac
Em Ter, 2012-09-25 às 01:26 -0700, Yinghai Lu escreveu:
Quoted 2 lines
Signed-off-by Yinghai Lu <[email protected]>Cc Mauro Carvalho Chehab <[email protected]>
Quoted 24 lines
Cc Doug Thompson <[email protected]>--- drivers/edac/i7core_edac.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)drivers/edac/i7core_edac.c +3
-3@@ -1294,10 +1294,10 @@ static void __init i7core_xeon_pci_fixup(const struct pci_id_table *table)static unsigned i7core_pci_lastbus (void ) {int last_bus =0 , bus; -struct pci_bus *b =NULL ; +struct pci_host_bridge *host_bridge =NULL ; -while ((b =pci_find_next_bus (b)) !=NULL ) { - bus = b->number; +for_each_pci_host_bridge (host_bridge) { + bus = host_bridge->bus->number;edac_dbg (0 ,"Found bus %d\n" , bus);if (bus > last_bus) last_bus = bus;
PATCH 16/29 PCI, x86: kill pci_find_next_bus in pcibios_scan_root
In reply to Yinghai Lu--- arch/x86/pci/common.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)
arch/x86/pci/common.c +6 -3
@@ -446,11 +446,14 @@ void __init dmi_check_pciprobe(void)struct pci_bus *__devinit pcibios_scan_root (int busnum) { -struct pci_bus *bus =NULL ; +struct pci_host_bridge *host_bridge =NULL ; +struct pci_bus *bus; -while ((bus =pci_find_next_bus (bus)) !=NULL ) { -if (bus->number == busnum) { +for_each_pci_host_bridge (host_bridge) { +if (host_bridge->bus->number == busnum) {/* Already scanned */ + bus = host_bridge->bus; +put_device (&host_bridge->dev);return bus; } }
Signature · 1 line
1.7.7
PATCH 17/29 PCI, x86: kill pci_root_buses in resources reservations
In reply to Yinghai Lu--- arch/x86/pci/i386.c | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-)
arch/x86/pci/i386.c +10 -10
@@ -332,11 +332,11 @@ static void __init pcibios_allocate_rom_resources(struct pci_bus *bus)static int __init pcibios_assign_resources (void ) { -struct pci_bus *bus; +struct pci_host_bridge *host_bridge =NULL ;if (!(pci_probe &PCI_ASSIGN_ROMS )) -list_for_each_entry (bus, &pci_root_buses, node) -pcibios_allocate_rom_resources (bus); +for_each_pci_host_bridge (host_bridge) +pcibios_allocate_rom_resources (host_bridge->bus);pci_assign_unassigned_resources ();pcibios_fw_addr_list_del ();
@@ -346,17 +346,17 @@ static int __init pcibios_assign_resources(void)void __init pcibios_resource_survey (void ) { -struct pci_bus *bus; +struct pci_host_bridge *host_bridge =NULL ;DBG ("PCI: Allocating resources\n" ); -list_for_each_entry (bus, &pci_root_buses, node) -pcibios_allocate_bus_resources (bus); +for_each_pci_host_bridge (host_bridge) +pcibios_allocate_bus_resources (host_bridge->bus); -list_for_each_entry (bus, &pci_root_buses, node) -pcibios_allocate_resources (bus,0 ); -list_for_each_entry (bus, &pci_root_buses, node) -pcibios_allocate_resources (bus,1 ); +for_each_pci_host_bridge (host_bridge) +pcibios_allocate_resources (host_bridge->bus,0 ); +for_each_pci_host_bridge (host_bridge) +pcibios_allocate_resources (host_bridge->bus,1 );e820_reserve_resources_late ();/*
Signature · 1 line
1.7.7
PATCH 18/29 PCI, drm: kill pci_root_buses in alpha hose setting
In reply to Yinghai Lu--- drivers/gpu/drm/drm_fops.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-)
drivers/gpu/drm/drm_fops.c +7 -3
@@ -340,9 +340,13 @@ static int drm_open_helper(struct inode *inode, struct file *filp, pci_dev_put(pci_dev); }if (!dev->hose) { -struct pci_bus *b =pci_bus_b (pci_root_buses.next); -if (b) - dev->hose = b->sysdata; +struct pci_host_bridge *host_bridge; + + host_bridge =pci_next_host_bridge (NULL ); +if (host_bridge) { + dev->hose = host_bridge->bus->sysdata; +put_device (&host_bridge->dev); + } } }#endif
Signature · 1 line
1.7.7
PATCH 19/29 PCI: kill pci_root_buses in setup-bus
In reply to Yinghai Lu--- drivers/pci/setup-bus.c | 24 +++++++++++++----------- 1 files changed, 13 insertions(+), 11 deletions(-)
drivers/pci/setup-bus.c +13 -11
@@ -1318,12 +1318,12 @@ static int __init pci_bus_get_depth(struct pci_bus *bus)static int __init pci_get_max_depth (void ) {int depth =0 ; -struct pci_bus *bus; +struct pci_host_bridge *host_bridge =NULL ; -list_for_each_entry (bus, &pci_root_buses, node) { +for_each_pci_host_bridge (host_bridge) {int ret; - ret =pci_bus_get_depth (bus); + ret =pci_bus_get_depth (host_bridge->bus);if (ret > depth) depth = ret; }
@@ -1393,6 +1393,7 @@ void __initpci_assign_unassigned_resources (void) {struct pci_bus *bus; +struct pci_host_bridge *host_bridge =NULL ;LIST_HEAD (realloc_head);/* list of resources that want additional resources */ struct list_head *add_list =NULL ;
@@ -1423,12 +1424,13 @@ again: add_list = &realloc_head;/* Depth first, calculate sizes and alignments of all subordinate buses. */ -list_for_each_entry (bus, &pci_root_buses, node) -__pci_bus_size_bridges (bus, add_list); +for_each_pci_host_bridge (host_bridge) +__pci_bus_size_bridges (host_bridge->bus, add_list);/* Depth last, allocate resources and update the hardware. */ -list_for_each_entry (bus, &pci_root_buses, node) -__pci_bus_assign_resources (bus, add_list, &fail_head); +for_each_pci_host_bridge (host_bridge) +__pci_bus_assign_resources (host_bridge->bus, add_list, + &fail_head);if (add_list)BUG_ON (!list_empty (add_list)); tried_times++;
@@ -1480,12 +1482,12 @@ again: enable_and_dump:/* Depth last, update the hardware. */ -list_for_each_entry (bus, &pci_root_buses, node) -pci_enable_bridges (bus); +for_each_pci_host_bridge (host_bridge) +pci_enable_bridges (host_bridge->bus);/* dump the resource on buses */ -list_for_each_entry (bus, &pci_root_buses, node) -pci_bus_dump_resources (bus); +for_each_pci_host_bridge (host_bridge) +pci_bus_dump_resources (host_bridge->bus); }void pci_assign_unassigned_bridge_resources (struct pci_dev *bridge)
Signature · 1 line
1.7.7
PATCH 20/29 PCI, sparc: kill pci_find_next_bus
In reply to Yinghai Lu--- arch/sparc/kernel/pci.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
arch/sparc/kernel/pci.c +4 -2
@@ -997,11 +997,13 @@ static void __devinit pci_bus_slot_names(struct device_node *node,static int __init of_pci_slot_init (void ) { -struct pci_bus *pbus =NULL ; +struct pci_host_bridge *host_bridge =NULL ; +struct pci_bus *pbus; -while ((pbus =pci_find_next_bus (pbus)) !=NULL ) { +for_each_pci_host_bridge (host_bridge) {struct device_node *node; + pbus = hot_bridge->bus;if (pbus->self) {/* PCI->PCI bridge */ node = pbus->self->dev.of_node;
Signature · 1 line
1.7.7
Re: [PATCH 20/29] PCI, sparc: kill pci_find_next_bus
Quoted 14 lines · Yinghai Lu
Signed-off-by Yinghai Lu <[email protected]>Cc "David S. Miller" <[email protected]>--- arch/sparc/kernel/pci.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)arch/sparc/kernel/pci.c +0
-0@@ -997,11 +997,13 @@ static void __devinit pci_bus_slot_names(struct device_node *node,static int __init of_pci_slot_init (void )
arch/sparc/kernel/pci.c static void __devinit pci_bus_slot_names(struct device_node *node, · line 1006
Quoted 10 lines
arch/sparc/kernel/pci.c +4
-2{ -struct pci_bus *pbus =NULL ; +struct pci_host_bridge *host_bridge =NULL ; +struct pci_bus *pbus; -while ((pbus =pci_find_next_bus (pbus)) !=NULL ) { +for_each_pci_host_bridge (host_bridge) {struct device_node *node; + pbus = hot_bridge->bus;
Should this be 'host_bridge' and not 'hot_bridge'?
Quoted 10 lines
arch/sparc/kernel/pci.c +0
-0if (pbus->self) {/* PCI->PCI bridge */ node = pbus->self->dev.of_node;Signature · 6 lines
1.7.7 -- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Jurij Smakov [email protected] Key: http://www.wooyd.org/pgpkey/ KeyID: C99E03CC
Re: [PATCH 20/29] PCI, sparc: kill pci_find_next_bus
Quoted 20 lines · Jurij Smakov
Quoted 19 lines · Yinghai Lu
Signed-off-by Yinghai Lu <[email protected]>Cc "David S. Miller" <[email protected]>--- arch/sparc/kernel/pci.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)arch/sparc/kernel/pci.c +2
-1@@ -997,11 +997,13 @@ static void __devinit pci_bus_slot_names(struct device_node *node,static int __init of_pci_slot_init (void ) { -struct pci_bus *pbus =NULL ; +struct pci_host_bridge *host_bridge =NULL ; +struct pci_bus *pbus;
Quoted 7 lines
arch/sparc/kernel/pci.c static void __devinit pci_bus_slot_names(struct device_node *node, · line 1006
Quoted 5 lines
arch/sparc/kernel/pci.c +2
-1-while ((pbus =pci_find_next_bus (pbus)) !=NULL ) { +for_each_pci_host_bridge (host_bridge) {struct device_node *node; + pbus = hot_bridge->bus;Should this be '
host_bridge' and not 'hot_bridge'?
fixed.
Thanks
Re: [PATCH 20/29] PCI, sparc: kill pci_find_next_bus
In reply to Yinghai LuFrom: Yinghai Lu <[email protected]>
Date: Tue, 25 Sep 2012 01:26:21 -0700
Quoted 1 line
Signed-off-by Yinghai Lu <[email protected]>
PATCH 21/29 PCI, ia64: kill pci_find_next_bus
In reply to Yinghai Lu--- arch/ia64/hp/common/sba_iommu.c | 7 ++++--- arch/ia64/sn/kernel/io_common.c | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-)
arch/ia64/hp/common/sba_iommu.c +4 -3
@@ -2155,9 +2155,10 @@ sba_init(void)#ifdef CONFIG_PCI { -struct pci_bus *b =NULL ; -while ((b =pci_find_next_bus (b)) !=NULL ) -sba_connect_bus (b); +struct pci_host_bridge *host_bridge =NULL ; + +for_each_pci_host_bridge (host_bridge) +sba_connect_bus (host_bridge->bus); }#endif
arch/ia64/sn/kernel/io_common.c +3 -2
@@ -516,6 +516,7 @@ arch_initcall(sn_io_early_init);int __init sn_io_late_init (void ) { +struct pci_host_bridge *host_bridge =NULL ;struct pci_bus *bus;struct pcibus_bussoft *bussoft;cnodeid_t cnode;
@@ -530,8 +531,8 @@ sn_io_late_init(void)* PIC, TIOCP, TIOCE (TIOCA does it during bus fixup using * info from the PROM). */ - bus =NULL ; -while ((bus =pci_find_next_bus (bus)) !=NULL ) { +for_each_pci_host_bridge (host_bridge) { + bus = host_bridge->bus; bussoft =SN_PCIBUS_BUSSOFT (bus); nasid =NASID_GET (bussoft->bs_base); cnode =nasid_to_cnodeid (nasid);
Signature · 1 line
1.7.7
PATCH 22/29 PCI, alpha: kill pci_root_buses
In reply to Yinghai Lu--- arch/alpha/kernel/pci.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
arch/alpha/kernel/pci.c +3 -3
@@ -305,10 +305,10 @@ pcibios_claim_one_bus(struct pci_bus *b)static void __init pcibios_claim_console_setup (void ) { -struct pci_bus *b; +struct pci_host_bridge *host_bridge =NULL ; -list_for_each_entry (b, &pci_root_buses, node) -pcibios_claim_one_bus (b); +for_each_pci_host_bridge (host_bridge) +pcibios_claim_one_bus (bridge->bus); }void __init
Signature · 1 line
1.7.7
PATCH 23/29 PCI, arm: kill pci_root_buses
In reply to Yinghai Lu--- arch/arm/kernel/bios32.c | 9 +++------ 1 files changed, 3 insertions(+), 6 deletions(-)
arch/arm/kernel/bios32.c +3 -6
@@ -56,13 +56,10 @@ static void pcibios_bus_report_status(struct pci_bus *bus, u_int status_mask, invoid pcibios_report_status (u_int status_mask,int warn) { -struct list_head *l; +struct pci_host_bridge *host_bridge =NULL ; -list_for_each (l, &pci_root_buses) { -struct pci_bus *bus =pci_bus_b (l); - -pcibios_bus_report_status (bus, status_mask, warn); - } +for_each_pci_host_bridge (host_bridge) +pcibios_bus_report_status (host_bridge->bus, status_mask, warn); }/*
Signature · 1 line
1.7.7
PATCH 24/29 PCI, frv: kill pci_root_buses in resources reservations
In reply to Yinghai Lu--- arch/frv/mb93090-mb00/pci-frv.c | 37 ++++++++++++++++++++----------------- 1 files changed, 20 insertions(+), 17 deletions(-)
arch/frv/mb93090-mb00/pci-frv.c +20 -17
@@ -78,27 +78,26 @@ pcibios_align_resource(void *data, const struct resource *res,* as well. */ -static void __init pcibios_allocate_bus_resources (struct list_head *bus_list) +static void __init pcibios_allocate_bridge_resources (struct pci_dev *dev) { -struct list_head *ln; -struct pci_bus *bus; -struct pci_dev *dev;int idx;struct resource *r; +for (idx =PCI_BRIDGE_RESOURCES ; idx <PCI_NUM_RESOURCES ; idx++) { + r = &dev->resource[idx]; +if (!r->start) +continue ; +pci_claim_resource (dev, idx); + } +} +static void __init pcibios_allocate_bus_resources (struct pci_bus *bus) +{ +struct pci_bus *child;/* Depth-First Search on bus tree */ -for (ln=bus_list->next; ln != bus_list; ln=ln->next) { - bus =pci_bus_b (ln); -if ((dev = bus->self)) { -for (idx =PCI_BRIDGE_RESOURCES ; idx <PCI_NUM_RESOURCES ; idx++) { - r = &dev->resource[idx]; -if (!r->start) -continue ; -pci_claim_resource (dev, idx); - } - } -pcibios_allocate_bus_resources (&bus->children); - } +if (bus->self) +pcibios_allocate_bridge_resources (bus->self); +list_for_each_entry (child, &bus->children, node) +pcibios_allocate_bus_resources (child); }static void __init pcibios_allocate_resources (int pass)
@@ -188,8 +187,12 @@ static void __init pcibios_assign_resources(void)void __init pcibios_resource_survey (void ) { +struct pci_host_bridge *host_bridge =NULL ; +DBG ("PCI: Allocating resources\n" ); -pcibios_allocate_bus_resources (&pci_root_buses); + +for_each_pci_host_bridge (host_bridge) +pcibios_allocate_bus_resources (host_bridge->bus);pcibios_allocate_resources (0 );pcibios_allocate_resources (1 );pcibios_assign_resources ();
Signature · 1 line
1.7.7
PATCH 25/29 PCI, microblaze: kill pci_root_buses in resources reservations
In reply to Yinghai Lu--- arch/microblaze/pci/pci-common.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
arch/microblaze/pci/pci-common.c +5 -5
@@ -1323,13 +1323,13 @@ static void __init pcibios_reserve_legacy_regions(struct pci_bus *bus)void __init pcibios_resource_survey (void ) { -struct pci_bus *b; +struct pci_host_bridge *host_bridge =NULL ;/* Allocate and assign resources. If we re-assign everything, then * we skip the allocate phase */ -list_for_each_entry (b, &pci_root_buses, node) -pcibios_allocate_bus_resources (b); +for_each_pci_host_bridge (host_bridge) +pcibios_allocate_bus_resources (host_bridge->bus);pcibios_allocate_resources (0 );pcibios_allocate_resources (1 );
@@ -1338,8 +1338,8 @@ void __init pcibios_resource_survey(void)* the low IO area and the VGA memory area if they intersect the * bus available resources to avoid allocating things on top of them */ -list_for_each_entry (b, &pci_root_buses, node) -pcibios_reserve_legacy_regions (b); +for_each_pci_host_bridge (host_bridge) +pcibios_reserve_legacy_regions (host_bridge->bus);/* Now proceed to assigning things that were left unassigned */ pr_debug ("PCI: Assigning unassigned resources...\n" );
Signature · 1 line
1.7.7
PATCH 26/29 PCI, mn10300: kill pci_root_buses in resources reservations
In reply to Yinghai Lu--- arch/mn10300/unit-asb2305/pci-asb2305.c | 62 ++++++++++++++++-------------- 1 files changed, 33 insertions(+), 29 deletions(-)
arch/mn10300/unit-asb2305/pci-asb2305.c +33 -29
@@ -88,42 +88,42 @@ resource_size_t pcibios_align_resource(void *data, const struct resource *res,* requested by the user, configure expansion ROM address * as well. */ -static void __init pcibios_allocate_bus_resources (struct list_head *bus_list) +static void __init pcibios_allocate_bridge_resources (struct pci_dev *dev) { -struct pci_bus *bus; -struct pci_dev *dev;int idx;struct resource *r; -/* Depth-First Search on bus tree */ -list_for_each_entry (bus, bus_list, node) { - dev = bus->self; -if (dev) { -for (idx =PCI_BRIDGE_RESOURCES ; - idx <PCI_NUM_RESOURCES ; - idx++) { - r = &dev->resource[idx]; -if (!r->flags) -continue ; -if (!r->start || -pci_claim_resource (dev, idx) <0 ) { -printk (KERN_ERR "PCI:" -" Cannot allocate resource" -" region %d of bridge %s\n" , - idx,pci_name (dev)); -/* Something is wrong with the region. -* Invalidate the resource to prevent -* child resource allocations in this -* range. */ - r->start = r->end =0 ; - r->flags =0 ; - } - } +for (idx =PCI_BRIDGE_RESOURCES ; + idx <PCI_NUM_RESOURCES ; + idx++) { + r = &dev->resource[idx]; +if (!r->flags) +continue ; +if (!r->start || +pci_claim_resource (dev, idx) <0 ) { +pr_err ("PCI: Cannot allocate resource region %d of bridge %s\n" , + idx,pci_name (dev)); +/* Something is wrong with the region. +* Invalidate the resource to prevent +* child resource allocations in this +* range. */ + r->start = r->end =0 ; + r->flags =0 ; } -pcibios_allocate_bus_resources (&bus->children); } } +static void pcibios_allocate_bus_resources (struct pci_bus *bus) +{ +struct pci_bus *child; + +/* Depth-First Search on bus tree */ +if (bus->self) +pcibios_allocate_bridge_resources (bus->self); +list_for_each_entry (child, &bus->children, node) +pcibios_allocate_bus_resources (child); +} +static void __init pcibios_allocate_resources (int pass) {struct pci_dev *dev =NULL ;
@@ -207,8 +207,12 @@ fs_initcall(pcibios_assign_resources);void __init pcibios_resource_survey (void ) { +struct pci_host_bridge *host_bridge =NULL ; +DBG ("PCI: Allocating resources\n" ); -pcibios_allocate_bus_resources (&pci_root_buses); + +for_each_pci_host_bridge (host_bridge) +pcibios_allocate_bus_resources (host_bridge->bus);pcibios_allocate_resources (0 );pcibios_allocate_resources (1 ); }
Signature · 1 line
1.7.7
PATCH 27/29 PCI, powerpc: kill pci_root_buses in resources reservations
In reply to Yinghai Lu--- arch/powerpc/kernel/pci-common.c | 13 ++++++------- arch/powerpc/kernel/pci_64.c | 7 ++++--- 2 files changed, 10 insertions(+), 10 deletions(-)
arch/powerpc/kernel/pci-common.c +6 -7
@@ -1390,11 +1390,11 @@ static void __init pcibios_reserve_legacy_regions(struct pci_bus *bus)void __init pcibios_resource_survey (void ) { -struct pci_bus *b; +struct pci_host_bridge *host_bridge =NULL ;/* Allocate and assign resources */ -list_for_each_entry (b, &pci_root_buses, node) -pcibios_allocate_bus_resources (b); +for_each_pci_host_bridge (host_bridge) +pcibios_allocate_bus_resources (host_bridge->bus);pcibios_allocate_resources (0 );pcibios_allocate_resources (1 );
@@ -1402,10 +1402,9 @@ void __init pcibios_resource_survey(void)* the low IO area and the VGA memory area if they intersect the * bus available resources to avoid allocating things on top of them */ -if (!pci_has_flag (PCI_PROBE_ONLY )) { -list_for_each_entry (b, &pci_root_buses, node) -pcibios_reserve_legacy_regions (b); - } +if (!pci_has_flag (PCI_PROBE_ONLY )) +for_each_pci_host_bridge (host_bridge) +pcibios_reserve_legacy_regions (host_bridge);/* Now, if the platform didn't decide to blindly trust the firmware, * we proceed to assigning things that were left unassigned
arch/powerpc/kernel/pci_64.c +4 -3
@@ -213,8 +213,9 @@ long sys_pciconfig_iobase(long which, unsigned long in_bus, {struct pci_controller * hose;struct list_head *ln; -struct pci_bus *bus =NULL ; +struct pci_bus *bus;struct device_node *hose_node; +struct pci_host_bridge *host_bridge =NULL ;/* Argh ! Please forgive me for that hack, but that's the * simplest way to get existing XFree to not lockup on some
@@ -234,8 +235,8 @@ long sys_pciconfig_iobase(long which, unsigned long in_bus,* used on pre-domains setup. We return the first match */ -for (ln = pci_root_buses.next; ln != &pci_root_buses; ln = ln->next) { - bus =pci_bus_b (ln); +for_each_pci_host_bridge (host_bridge) { + bus = host_bridge->bus;if (in_bus >= bus->number && in_bus <= bus->busn_res.end)break ; bus =NULL ;
Signature · 1 line
1.7.7
PATCH 28/29 PCI: kill pci_find_next_bus
In reply to Yinghai Lu--- drivers/pci/search.c | 37 +++++++------------------------------ include/linux/pci.h | 4 ---- 2 files changed, 7 insertions(+), 34 deletions(-)
drivers/pci/search.c +7 -30
@@ -79,44 +79,22 @@ static struct pci_bus *pci_do_find_bus(struct pci_bus *bus, unsigned char busnr)*/ struct pci_bus *pci_find_bus (int domain,int busnr) { -struct pci_bus *bus =NULL ; +struct pci_host_bridge *host_bridge =NULL ;struct pci_bus *tmp_bus; -while ((bus =pci_find_next_bus (bus)) !=NULL ) { -if (pci_domain_nr (bus) != domain) +for_each_pci_host_bridge (host_bridge) { +if (pci_domain_nr (host_bridge->bus) != domain)continue ; - tmp_bus =pci_do_find_bus (bus, busnr); -if (tmp_bus) + tmp_bus =pci_do_find_bus (host_bridge->bus, busnr); +if (tmp_bus) { +put_device (&host_bridge->dev);return tmp_bus; + } }return NULL ; }/** -* pci_find_next_bus - begin or continue searching for a PCI bus -* @from: Previous PCI bus found, or %NULL for new search. -* -* Iterates through the list of known PCI busses. A new search is -* initiated by passing %NULL as the @from argument. Otherwise if -* @from is not %NULL, searches continue from next device on the -* global list. -*/ -struct pci_bus * -pci_find_next_bus (const struct pci_bus *from) -{ -struct list_head *n; -struct pci_bus *b =NULL ; - -WARN_ON (in_interrupt ()); -down_read (&pci_bus_sem); - n = from ? from->node.next : pci_root_buses.next; -if (n != &pci_root_buses) - b =pci_bus_b (n); -up_read (&pci_bus_sem); -return b; -} - -/** * pci_get_slot - locate PCI device for a given PCI slot * @bus: PCI bus on which desired PCI device resides * @devfn: encodes number of PCI slot in which the desired PCI
@@ -355,7 +333,6 @@ EXPORT_SYMBOL(pci_dev_present);/* For boot time work */ EXPORT_SYMBOL (pci_find_bus); -EXPORT_SYMBOL (pci_find_next_bus);/* For everyone */ EXPORT_SYMBOL (pci_get_device);EXPORT_SYMBOL (pci_get_subsys);
include/linux/pci.h +0 -4
@@ -758,7 +758,6 @@ int pci_find_ext_capability(struct pci_dev *dev, int cap);int pci_find_next_ext_capability (struct pci_dev *dev,int pos,int cap);int pci_find_ht_capability (struct pci_dev *dev,int ht_cap);int pci_find_next_ht_capability (struct pci_dev *dev,int pos,int ht_cap); -struct pci_bus *pci_find_next_bus (const struct pci_bus *from);struct pci_host_bridge *pci_get_next_host_bridge (struct pci_host_bridge *from); struct pci_dev *pci_get_device(unsigned int vendor, unsigned int device,
@@ -1400,9 +1399,6 @@ static inline int pci_block_cfg_access_in_atomic(struct pci_dev *dev)static inline void pci_unblock_cfg_access (struct pci_dev *dev) { } -static inline struct pci_bus *pci_find_next_bus (const struct pci_bus *from) -{return NULL ; } -static inline struct pci_dev *pci_get_slot (struct pci_bus *bus,unsigned int devfn) {return NULL ; }
Signature · 1 line
1.7.7
PATCH 29/29 PCI: kill pci_root_buses
In reply to Yinghai Lu--- drivers/pci/probe.c | 8 -------- include/linux/pci.h | 3 --- 2 files changed, 0 insertions(+), 11 deletions(-)
drivers/pci/probe.c +0 -8
@@ -23,10 +23,6 @@ struct resource busn_resource = { .flags = IORESOURCE_BUS, }; -/* Ugh. Need to stop exporting this to modules. */ -LIST_HEAD (pci_root_buses); -EXPORT_SYMBOL (pci_root_buses); -static LIST_HEAD (pci_domain_busn_res_list);struct pci_domain_busn_res {
@@ -1712,10 +1708,6 @@ struct pci_bus *pci_create_root_bus(struct device *parent, int bus,dev_info (&b->dev,"root bus resource %pR%s\n" , res, bus_addr); } -down_write (&pci_bus_sem); -list_add_tail (&b->node, &pci_root_buses); -up_write (&pci_bus_sem); -return b; class_dev_reg_err:
include/linux/pci.h +0 -3
@@ -673,9 +673,6 @@ extern enum pcie_bus_config_types pcie_bus_config;extern struct bus_type pci_host_bridge_bus_type;extern struct bus_type pci_bus_type; -/* Do NOT directly access these two variables, unless you are arch specific pci -* code, or pci core code. */ -extern struct list_head pci_root_buses;/* list of all known PCI buses */ /* Some device drivers need know if pci is initiated */ extern int no_pci_devices (void );
Signature · 1 line
1.7.7
Bjorn Helgaas
maintainerQuoted 15 lines · Yinghai Lu
could remove
pci_root_buseslist.Yinghai Lu (29):
PCI, x86: Separate outpcibios_allocate_bridge_resources()PCI. x86: Separate outpcibios_allocate_dev_resources()PCI, x86: Letpcibios_allocate_bus_resources()take bus instead PCI, x86: Separate out rom resource claim
PCI: renamepci_release_bus_bridge_devtopci_release_host_bridge_dev
PCI: Add dummybus_typeforpci_host_bridge
PCI, ACPI: addacpi_bus_typefor host bridge
PCI, ACPI: Removeacpi_find_bridge_deviceforacpi_bus_typePCI, libata: removefind_bridgeinacpi_bus_type
PCI, USB: removefind_bridgeinacpi_bus_type
PCI, ACPI: removefind_bridgeinacpi_bus_type
PCI: Addfor_each_pci_host_bridge()andpci_get_next_host_bridge
I'm not thrilled about adding a new iterator for all host bridges.
The iterator design pattern does not work for collections that can change over time. In this case, it looks like you're adding a safer way to iterate through all host bridges we know about at this time. But we still have the problem of the host bridge that's added tomorrow.
I'd prefer a design where the PCI core provides an interface that means "call this function for every host bridge we know about now *and* for every one that's added in the future."
Quoted 49 lines
PCI, hotplug: kill
pci_find_next_busnsgi_hotplug
PCI: killpci_find_next_businpci_sysfs
PCI, edac: killpci_find_next_busin edac
PCI, x86: killpci_find_next_businpcibios_scan_rootPCI, x86: killpci_root_busesin resources reservations PCI, drm: killpci_root_busesin alpha hose setting
PCI: killpci_root_busesin setup-bus
PCI, sparc: killpci_find_next_bus
PCI, ia64: killpci_find_next_bus
PCI, alpha: killpci_root_buses
PCI, arm: killpci_root_buses
PCI, frv: killpci_root_busesin resources reservations PCI, microblaze: killpci_root_busesin resources reservations PCI, mn10300: killpci_root_busesin resources reservations PCI, powerpc: killpci_root_busesin resources reservations
PCI: killpci_find_next_bus
PCI: killpci_root_busesarch/alpha/kernel/pci.c | 6 +- arch/arm/kernel/bios32.c | 9 +- arch/frv/mb93090-mb00/pci-frv.c | 37 ++++--- arch/ia64/hp/common/sba_iommu.c | 7 +- arch/ia64/sn/kernel/io_common.c | 5 +- arch/microblaze/pci/pci-common.c | 10 +- arch/mn10300/unit-asb2305/pci-asb2305.c | 62 ++++++------ arch/powerpc/kernel/pci-common.c | 13 +-- arch/powerpc/kernel/pci_64.c | 7 +- arch/sparc/kernel/pci.c | 6 +- arch/x86/pci/common.c | 9 +- arch/x86/pci/i386.c | 162 +++++++++++++++++++------------ drivers/acpi/glue.c | 22 +---- drivers/ata/libata-acpi.c | 6 - drivers/edac/i7core_edac.c | 6 +- drivers/gpu/drm/drm_fops.c | 10 ++- drivers/pci/hotplug/sgi_hotplug.c | 6 +- drivers/pci/pci-acpi.c | 13 ++- drivers/pci/pci-driver.c | 11 ++- drivers/pci/pci-sysfs.c | 6 +- drivers/pci/probe.c | 13 +-- drivers/pci/search.c | 60 ++++++------ drivers/pci/setup-bus.c | 24 +++-- drivers/usb/core/usb-acpi.c | 1 - include/acpi/acpi_bus.h | 2 - include/linux/pci.h | 11 +-- 26 files changed, 281 insertions(+), 243 deletions(-)--
1.7.7
Quoted 3 lines · Bjorn Helgaas
Quoted 2 lines · Yinghai Lu
could remove
pci_root_buseslist.
...
Quoted 1 line
Quoted 1 line
PCI: Add dummy
bus_typeforpci_host_bridge
...
Quoted 10 lines
Quoted 1 line
PCI: Add
for_each_pci_host_bridge()andpci_get_next_host_bridgeI'm not thrilled about adding a new iterator for all host bridges.
The iterator design pattern does not work for collections that can change over time. In this case, it looks like you're adding a safer way to iterate through all host bridges we know about at this time. But we still have the problem of the host bridge that's added tomorrow.
Quoted 3 lines
I'd prefer a design where the PCI core provides an interface that means "call this function for every host bridge we know about now *and* for every one that's added in the future."
yes, that is the point to add pci_root_bridge_bus_type. We can register bus notifier on that.
-Yinghai
Bjorn Helgaas
maintainerQuoted 17 lines · Yinghai Lu
Quoted 3 lines · Bjorn Helgaas
Quoted 2 lines · Yinghai Lu
could remove
pci_root_buseslist....
Quoted 1 line
Quoted 1 line
PCI: Add dummy
bus_typeforpci_host_bridge...
Quoted 10 lines
Quoted 1 line
PCI: Add
for_each_pci_host_bridge()andpci_get_next_host_bridgeI'm not thrilled about adding a new iterator for all host bridges.
The iterator design pattern does not work for collections that can change over time. In this case, it looks like you're adding a safer way to iterate through all host bridges we know about at this time. But we still have the problem of the host bridge that's added tomorrow.
Quoted 6 lines
Quoted 3 lines
I'd prefer a design where the PCI core provides an interface that means "call this function for every host bridge we know about now *and* for every one that's added in the future."
yes, that is the point to add
pci_root_bridge_bus_type. We can register bus notifier on that.
I guess I missed your point. In the patch below (20/29 from your series), you're still iterating through all the host bridges, so there would have to be something else to handle hot-added host bridges.
Are you saying you plan future patches to change this again to something using a bus notifier?
arch/sparc/kernel/pci.c +0 -0
@@ -997,11 +997,13 @@ static void __devinit pci_bus_slot_names(struct
device_node *node,
static int __init of_pci_slot_init(void)
{
- struct pci_bus *pbus = NULL; + struct pci_host_bridge *host_bridge = NULL; + struct pci_bus *pbus;
- while ((pbus = pci_find_next_bus(pbus)) != NULL) {
+ for_each_pci_host_bridge(host_bridge) {
struct device_node *node;+ pbus = hot_bridge->bus;
if (pbus->self) {
/* PCI->PCI bridge */
node = pbus->self->dev.of_node;Quoted 34 lines · Bjorn Helgaas
Quoted 7 lines · Yinghai Lu
Quoted 4 lines
I'd prefer a design where the PCI core provides an interface that means "call this function for every host bridge we know about now *and* for every one that's added in the future."
yes, that is the point to add
pci_root_bridge_bus_type. We can register bus notifier on that.I guess I missed your point. In the patch below (20/29 from your series), you're still iterating through all the host bridges, so there would have to be something else to handle hot-added host bridges.
Are you saying you plan future patches to change this again to something using a bus notifier?
arch/sparc/kernel/pci.c +4
-2@@ -997,11 +997,13 @@ static void __devinit pci_bus_slot_names(structdevice_node *node, static int __init of_pci_slot_init(void) { - struct pci_bus *pbus = NULL; + struct pci_host_bridge *host_bridge = NULL; +struct pci_bus *pbus; -while ((pbus =pci_find_next_bus (pbus)) !=NULL ) { +for_each_pci_host_bridge (host_bridge) {struct device_node *node; + pbus = hot_bridge->bus;if (pbus->self) {/* PCI->PCI bridge */
Quoted 1 line
node = pbus->self->dev.of_node;
that is for initial booting path.
for hot add/remove notifier add need to be done case by case.
-Yinghai
Bjorn Helgaas
maintainerQuoted 32 lines · Yinghai Lu
Quoted 31 lines · Bjorn Helgaas
Quoted 7 lines · Yinghai Lu
Quoted 4 lines
I'd prefer a design where the PCI core provides an interface that means "call this function for every host bridge we know about now *and* for every one that's added in the future."
yes, that is the point to add
pci_root_bridge_bus_type. We can register bus notifier on that.I guess I missed your point. In the patch below (20/29 from your series), you're still iterating through all the host bridges, so there would have to be something else to handle hot-added host bridges.
Are you saying you plan future patches to change this again to something using a bus notifier?
arch/sparc/kernel/pci.c +3
-2@@ -997,11 +997,13 @@ static void __devinit pci_bus_slot_names(structdevice_node *node, static int __init of_pci_slot_init(void) { - struct pci_bus *pbus = NULL; + struct pci_host_bridge *host_bridge = NULL; +struct pci_bus *pbus; -while ((pbus =pci_find_next_bus (pbus)) !=NULL ) { +for_each_pci_host_bridge (host_bridge) {struct device_node *node;
Quoted 8 lines
Quoted 4 lines
arch/sparc/kernel/pci.c +1
-0+ pbus = hot_bridge->bus;if (pbus->self) {/* PCI->PCI bridge */ node = pbus->self->dev.of_node;that is for initial booting path.
for hot add/remove notifier add need to be done case by case.
Can initial boot be done the same as hot-add? If we add interfaces like for_each_pci_host_bridge(), people will just copy that for use at run-time. So it would be better to have the same interfaces for use at boot-time and at hot add-time.
Quoted 10 lines · Bjorn Helgaas
Quoted 3 lines · Yinghai Lu
that is for initial booting path.
for hot add/remove notifier add need to be done case by case.
Can initial boot be done the same as hot-add? If we add interfaces like
for_each_pci_host_bridge(), people will just copy that for use at run-time. So it would be better to have the same interfaces for use at boot-time and at hot add-time.
still need to check them case by case. some function may be too early to be called in work_fn in notifier. that need to find out when to get that bus notifier get
register.
I have one draft patch that will delay bridge enabling to BUS_ADD for pci bridge...
that will need to get that register rather later otherwise that bridge can not be enabled because resources are not reserved/allocated for initial booting path.
please refer to the attached patch. you should notice that fs_initcall is used for registration until boot path already have that pci bridges before.
+static struct notifier_block pci_hp_nb = {
+ .notifier_call = &pci_hp_notifier,
+};
+
+static int __init pci_hp_init(void)
+{
+ return bus_register_notifier(&pci_bus_type, &pci_hp_nb);
+}
+
+fs_initcall(pci_hp_init);
Also using that for_each_pci_host_bridge in run-time is still safe.
-Yinghai
Subject: [PATCH] PCI, hotplug: Use pci bus notifier to enable bridges
pci_configure_slot will need to use DEVICE_ACPI_HANDLE to get pci device acpi handle, and use handle to get needed hpp parameter.
but dev->archdata.acpi_handle is not during hotplug path until pci device is added to devices tree.
Need to pci_bus_type notifier to config bridge just after dev->archdata.acpi_handle get set.
But bridge need to be enabled after configuring, So first step the patch will move enabling bridge down at first.
--- drivers/acpi/pci_root.c | 4 --- drivers/pci/hotplug.c | 40 +++++++++++++++++++++++++++++++++++++ drivers/pci/hotplug/acpiphp_glue.c | 2 - drivers/pci/setup-bus.c | 3 -- 4 files changed, 40 insertions(+), 9 deletions(-)
drivers/acpi/pci_root.c +0 -4
@@ -666,10 +666,6 @@ static int acpi_pci_root_start(struct ac driver->add (root);mutex_unlock (&acpi_pci_root_lock); -/* need to after hot-added ioapic is registered */ -if (root->hot_added) -pci_enable_bridges (root->bus); -pci_bus_add_devices (root->bus);return 0 ;
drivers/pci/setup-bus.c +0 -3
@@ -1546,7 +1546,6 @@ again: enable_all: retval =pci_reenable_device (bridge);pci_set_master (bridge); -pci_enable_bridges (parent); }EXPORT_SYMBOL_GPL (pci_assign_unassigned_bridge_resources);
@@ -1566,6 +1565,4 @@ void pci_assign_unassigned_bus_resourcesup_read (&pci_bus_sem);__pci_bus_assign_resources (bus, &add_list,NULL );BUG_ON (!list_empty (&add_list)); - -pci_enable_bridges (bus); }
drivers/pci/hotplug/acpiphp_glue.c +0 -2
@@ -857,7 +857,6 @@ static int __ref enable_device(struct acacpiphp_sanitize_bus (bus);acpiphp_set_hpp_values (bus);acpiphp_set_acpi_region (slot); -pci_enable_bridges (bus);list_for_each_entry (dev, &bus->devices, bus_list) {/* Assume that newly added devices are powered on already. */
@@ -1128,7 +1127,6 @@ static int acpiphp_configure_bridge (acppci_bus_assign_resources (bus);acpiphp_sanitize_bus (bus);acpiphp_set_hpp_values (bus); -pci_enable_bridges (bus);return 0 ; }
drivers/pci/hotplug.c +40 -0
@@ -1,5 +1,6 @@#include <linux/kernel.h> #include <linux/pci.h> +#include <linux/pci_hotplug.h> #include <linux/module.h> #include "pci.h"
@@ -35,3 +36,42 @@ int pci_uevent(struct device *dev, strucreturn -ENOMEM ;return 0 ; } + +static void pci_hp_conf_add (struct pci_dev *dev) +{ +/* enable bridge at last*/ +if (dev->subordinate && !pci_is_enabled (dev)) { +int retval =pci_enable_device (dev); + +if (retval) +dev_err (&dev->dev, +"Error enabling bridge (%d), continuing\n" , + retval); +pci_set_master (dev); + } +} + +static int pci_hp_notifier (struct notifier_block *nb, +unsigned long event,void *data) +{ +struct device *dev = data; + +switch (event) { +case BUS_NOTIFY_ADD_DEVICE : +pci_hp_conf_add (to_pci_dev (dev)); +break ; + } + +return NOTIFY_OK ; +} + +static struct notifier_block pci_hp_nb = { + .notifier_call = &pci_hp_notifier, +}; + +static int __init pci_hp_init (void ) +{ +return bus_register_notifier (&pci_bus_type, &pci_hp_nb); +} + +fs_initcall (pci_hp_init);
Bjorn Helgaas
maintainerQuoted 37 lines · Yinghai Lu
Quoted 10 lines · Bjorn Helgaas
Quoted 3 lines · Yinghai Lu
that is for initial booting path.
for hot add/remove notifier add need to be done case by case.
Can initial boot be done the same as hot-add? If we add interfaces like
for_each_pci_host_bridge(), people will just copy that for use at run-time. So it would be better to have the same interfaces for use at boot-time and at hot add-time.still need to check them case by case. some function may be too early to be called in
work_fnin notifier. that need to find out when to get that bus notifier get
register.I have one draft patch that will delay bridge enabling to
BUS_ADDfor pci bridge...
that will need to get that register rather later otherwise that bridge can not be enabled because resources are not reserved/allocated for initial booting path.
please refer to the attached patch. you should notice thatfs_initcallis used for registration until boot path already have that pci bridges before.drivers/pci/hotplug.c +10
-0+static struct notifier_block pci_hp_nb = { + .notifier_call = &pci_hp_notifier, +}; + +static int __init pci_hp_init (void ) +{ +return bus_register_notifier (&pci_bus_type, &pci_hp_nb); +} + +fs_initcall (pci_hp_init);
Quoted 1 line
Also using that
for_each_pci_host_bridgein run-time is still safe.
Sure, it might be *safe*. But it's not *sufficient*. If you use for_each_pci_host_bridge(), you also need to do something else to deal with hot-added host bridges. It's hard to make sure that every caller does both parts correctly:
1) for_each_pci_host_bridge() for things we've already seen and
2) some sort of notifier for hot-added bridges
That's why I'd prefer a single interface.
Quoted 7 lines · Bjorn Helgaas
Sure, it might be *safe*. But it's not *sufficient*. If you use
for_each_pci_host_bridge(), you also need to do something else to deal with hot-added host bridges. It's hard to make sure that every caller does both parts correctly:1)
for_each_pci_host_bridge()for things we've already seen and
2) some sort of notifier for hot-added bridges
yes.
Quoted 2 lines
That's why I'd prefer a single interface.
that will have draw backs too:
1. too much changes to the code of current caller.
2. have to checking system_state back and forth.
3. some variable function call may only need for _init path could not be freed. or add annoying _ref_ok etc.
-Yinghai
Bjorn Helgaas
maintainerQuoted 13 lines · Yinghai Lu
Quoted 7 lines · Bjorn Helgaas
Sure, it might be *safe*. But it's not *sufficient*. If you use
for_each_pci_host_bridge(), you also need to do something else to deal with hot-added host bridges. It's hard to make sure that every caller does both parts correctly:1)
for_each_pci_host_bridge()for things we've already seen and
2) some sort of notifier for hot-added bridgesyes.
Quoted 1 line
Quoted 7 lines
Quoted 1 line
That's why I'd prefer a single interface.
that will have draw backs too:
1. too much changes to the code of current caller.
2. have to checkingsystem_stateback and forth.
3. some variable function call may only need for_initpath could not be freed. or add annoying_ref_oketc.
We already have to make significant changes to the callers. Your changes only address part 1. More changes will be needed for part 2, and they will look very much like the approach I'm suggesting.
I'm frankly dubious about your fears of system_state and __init complexity. PCI enumeration and driver binding already happens late enough that the system is almost completely initialized. But I guess we won't know for sure until we try out both ideas.
Quoted 22 lines · Bjorn Helgaas
Quoted 13 lines · Yinghai Lu
Quoted 7 lines · Bjorn Helgaas
Sure, it might be *safe*. But it's not *sufficient*. If you use
for_each_pci_host_bridge(), you also need to do something else to deal with hot-added host bridges. It's hard to make sure that every caller does both parts correctly:1)
for_each_pci_host_bridge()for things we've already seen and
2) some sort of notifier for hot-added bridgesyes.
Quoted 1 line
Quoted 7 lines
Quoted 1 line
That's why I'd prefer a single interface.
that will have draw backs too:
1. too much changes to the code of current caller.
2. have to checkingsystem_stateback and forth.
3. some variable function call may only need for_initpath could not be freed. or add annoying_ref_oketc.
Quoted 3 lines
We already have to make significant changes to the callers. Your changes only address part 1. More changes will be needed for part 2, and they will look very much like the approach I'm suggesting.
not that much, We just update the loop function from the caller.
Quoted 5 lines
I'm frankly dubious about your fears of
system_stateand__initcomplexity. PCI enumeration and driver binding already happens late enough that the system is almost completely initialized. But I guess we won't know for sure until we try out both ideas.
it is all up to the caller to decide it initial path for_ loop is enough, or they still need
part 2, or later they could even remove part1 and only keep part2 if the those function can survive the initial boot path.
-Yinghai
Quoted 1 line · Yinghai Lu
could remove
pci_root_buseslist.
updated brach: two typo fixing and two Acked-by.
git://git.kernel.org/pub/scm/linux/kernel/git/yinghai/linux-yinghai.git
for-pci-kill-pci-root-buses