Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 316462
b: refs/heads/master
c: 12ea6ca
h: refs/heads/master
v: v3
  • Loading branch information
Alex Williamson authored and Bjorn Helgaas committed Jun 12, 2012
1 parent a461063 commit 7a055b1
Show file tree
Hide file tree
Showing 48 changed files with 385 additions and 404 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 10c480933d0ad2ea27630cbaa723a5d33dbece00
refs/heads/master: 12ea6cad1c7d046e21decc18b0e2170c6794dc51
2 changes: 1 addition & 1 deletion trunk/arch/alpha/kernel/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ common_init_pci(void)
hose, &resources);
hose->bus = bus;
hose->need_domain_info = need_domain_info;
next_busno = bus->busn_res.end + 1;
next_busno = bus->subordinate + 1;
/* Don't allow 8-bit bus number overflow inside the hose -
reserve some space for bridges. */
if (next_busno > 224) {
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/kernel/bios32.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ static void __init pcibios_init_hw(struct hw_pci *hw, struct list_head *head)
if (!sys->bus)
panic("PCI: unable to scan bus!");

busnr = sys->bus->busn_res.end + 1;
busnr = sys->bus->subordinate + 1;

list_add(&sys->node, head);
} else {
Expand Down
4 changes: 1 addition & 3 deletions trunk/arch/ia64/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,6 @@ pci_acpi_scan_root(struct acpi_pci_root *root)
#endif

INIT_LIST_HEAD(&info.resources);
/* insert busn resource at first */
pci_add_resource(&info.resources, &root->secondary);
acpi_walk_resources(device->handle, METHOD_NAME__CRS, count_window,
&windows);
if (windows) {
Expand Down Expand Up @@ -386,7 +384,7 @@ pci_acpi_scan_root(struct acpi_pci_root *root)
return NULL;
}

pci_scan_child_bus(pbus);
pbus->subordinate = pci_scan_child_bus(pbus);
return pbus;

out3:
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/microblaze/pci/pci-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1506,10 +1506,10 @@ static void __devinit pcibios_scan_phb(struct pci_controller *hose)
pci_free_resource_list(&resources);
return;
}
bus->busn_res.start = hose->first_busno;
bus->secondary = hose->first_busno;
hose->bus = bus;

hose->last_busno = bus->busn_res.end;
hose->last_busno = bus->subordinate;
}

static int __init pcibios_init(void)
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/mips/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ static void __devinit pcibios_scanbus(struct pci_controller *hose)
need_domain_info = need_domain_info || hose->index;
hose->need_domain_info = need_domain_info;
if (bus) {
next_busno = bus->busn_res.end + 1;
next_busno = bus->subordinate + 1;
/* Don't allow 8-bit bus number overflow inside the hose -
reserve some space for bridges. */
if (next_busno > 224) {
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/powerpc/include/asm/pci-bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ struct pci_controller {
int first_busno;
int last_busno;
int self_busno;
struct resource busn;

void __iomem *io_base_virt;
#ifdef CONFIG_PPC64
Expand Down
17 changes: 6 additions & 11 deletions trunk/arch/powerpc/kernel/pci-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1637,11 +1637,6 @@ void __devinit pcibios_scan_phb(struct pci_controller *hose)
/* Wire up PHB bus resources */
pcibios_setup_phb_resources(hose, &resources);

hose->busn.start = hose->first_busno;
hose->busn.end = hose->last_busno;
hose->busn.flags = IORESOURCE_BUS;
pci_add_resource(&resources, &hose->busn);

/* Create an empty bus for the toplevel */
bus = pci_create_root_bus(hose->parent, hose->first_busno,
hose->ops, hose, &resources);
Expand All @@ -1651,22 +1646,22 @@ void __devinit pcibios_scan_phb(struct pci_controller *hose)
pci_free_resource_list(&resources);
return;
}
bus->secondary = hose->first_busno;
hose->bus = bus;

/* Get probe mode and perform scan */
mode = PCI_PROBE_NORMAL;
if (node && ppc_md.pci_probe_mode)
mode = ppc_md.pci_probe_mode(bus);
pr_debug(" probe mode: %d\n", mode);
if (mode == PCI_PROBE_DEVTREE)
if (mode == PCI_PROBE_DEVTREE) {
bus->subordinate = hose->last_busno;
of_scan_bus(node, bus);

if (mode == PCI_PROBE_NORMAL) {
pci_bus_update_busn_res_end(bus, 255);
hose->last_busno = pci_scan_child_bus(bus);
pci_bus_update_busn_res_end(bus, hose->last_busno);
}

if (mode == PCI_PROBE_NORMAL)
hose->last_busno = bus->subordinate = pci_scan_child_bus(bus);

/* Platform gets a chance to do some global fixups before
* we proceed to resource allocation
*/
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/kernel/pci_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ long sys_pciconfig_iobase(long which, unsigned long in_bus,

for (ln = pci_root_buses.next; ln != &pci_root_buses; ln = ln->next) {
bus = pci_bus_b(ln);
if (in_bus >= bus->number && in_bus <= bus->busn_res.end)
if (in_bus >= bus->number && in_bus <= bus->subordinate)
break;
bus = NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/kernel/pci_of_scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ void __devinit of_scan_pci_bridge(struct pci_dev *dev)
}

bus->primary = dev->bus->number;
pci_bus_insert_busn_res(bus, busrange[0], busrange[1]);
bus->subordinate = busrange[1];
bus->bridge_ctl = 0;

/* parse ranges property */
Expand Down
8 changes: 4 additions & 4 deletions trunk/arch/powerpc/platforms/powernv/pci-ioda.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ static int __devinit pnv_ioda_configure_pe(struct pnv_phb *phb,
dcomp = OPAL_IGNORE_RID_DEVICE_NUMBER;
fcomp = OPAL_IGNORE_RID_FUNCTION_NUMBER;
parent = pe->pbus->self;
count = pe->pbus->busn_res.end - pe->pbus->busn_res.start + 1;
count = pe->pbus->subordinate - pe->pbus->secondary + 1;
switch(count) {
case 1: bcomp = OpalPciBusAll; break;
case 2: bcomp = OpalPciBus7Bits; break;
Expand Down Expand Up @@ -816,11 +816,11 @@ static void __devinit pnv_ioda_setup_bus_PE(struct pci_dev *dev,
pe->pdev = NULL;
pe->tce32_seg = -1;
pe->mve_number = -1;
pe->rid = bus->busn_res.start << 8;
pe->rid = bus->secondary << 8;
pe->dma_weight = 0;

pe_info(pe, "Secondary busses %pR associated with PE\n",
&bus->busn_res);
pe_info(pe, "Secondary busses %d..%d associated with PE\n",
bus->secondary, bus->subordinate);

if (pnv_ioda_configure_pe(phb, pe)) {
/* XXX What do we do here ? */
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/platforms/pseries/pci_dlpar.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ void pcibios_add_pci_devices(struct pci_bus * bus)
if (!num)
return;
pcibios_setup_bus_devices(bus);
max = bus->busn_res.start;
max = bus->secondary;
for (pass=0; pass < 2; pass++)
list_for_each_entry(dev, &bus->devices, bus_list) {
if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/sh/drivers/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static void __devinit pcibios_scanbus(struct pci_channel *hose)
need_domain_info = need_domain_info || hose->index;
hose->need_domain_info = need_domain_info;
if (bus) {
next_busno = bus->busn_res.end + 1;
next_busno = bus->subordinate + 1;
/* Don't allow 8-bit bus number overflow inside the hose -
reserve some space for bridges. */
if (next_busno > 224) {
Expand Down
8 changes: 3 additions & 5 deletions trunk/arch/sparc/kernel/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ static void __devinit of_scan_pci_bridge(struct pci_pbm_info *pbm,
}

bus->primary = dev->bus->number;
pci_bus_insert_busn_res(bus, busrange[0], busrange[1]);
bus->subordinate = busrange[1];
bus->bridge_ctl = 0;

/* parse ranges property, or cook one up by hand for Simba */
Expand Down Expand Up @@ -685,10 +685,6 @@ struct pci_bus * __devinit pci_scan_one_pbm(struct pci_pbm_info *pbm,
pbm->io_space.start);
pci_add_resource_offset(&resources, &pbm->mem_space,
pbm->mem_space.start);
pbm->busn.start = pbm->pci_first_busno;
pbm->busn.end = pbm->pci_last_busno;
pbm->busn.flags = IORESOURCE_BUS;
pci_add_resource(&resources, &pbm->busn);
bus = pci_create_root_bus(parent, pbm->pci_first_busno, pbm->pci_ops,
pbm, &resources);
if (!bus) {
Expand All @@ -697,6 +693,8 @@ struct pci_bus * __devinit pci_scan_one_pbm(struct pci_pbm_info *pbm,
pci_free_resource_list(&resources);
return NULL;
}
bus->secondary = pbm->pci_first_busno;
bus->subordinate = pbm->pci_last_busno;

pci_of_scan_bus(pbm, node, bus);
pci_bus_add_devices(bus);
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/sparc/kernel/pci_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ struct pci_pbm_info {
/* PBM I/O and Memory space resources. */
struct resource io_space;
struct resource mem_space;
struct resource busn;

/* Base of PCI Config space, can be per-PBM or shared. */
unsigned long config_space;
Expand Down
9 changes: 3 additions & 6 deletions trunk/arch/tile/kernel/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@ int __init pcibios_init(void)
if (pci_scan_flags[i] == 0 && controllers[i].ops != NULL) {
struct pci_controller *controller = &controllers[i];
struct pci_bus *bus;
LIST_HEAD(resources);

if (tile_init_irqs(i, controller)) {
pr_err("PCI: Could not initialize IRQs\n");
Expand All @@ -328,11 +327,9 @@ int __init pcibios_init(void)
* This is inlined in linux/pci.h and calls into
* pci_scan_bus_parented() in probe.c.
*/
pci_add_resource(&resources, &ioport_resource);
pci_add_resource(&resources, &iomem_resource);
bus = pci_scan_root_bus(NULL, 0, controller->ops, controller, &resources);
bus = pci_scan_bus(0, controller->ops, controller);
controller->root_bus = bus;
controller->last_busno = bus->busn_res.end;
controller->last_busno = bus->subordinate;
}
}

Expand Down Expand Up @@ -369,7 +366,7 @@ int __init pcibios_init(void)
*/
if ((dev->class >> 8) == PCI_CLASS_BRIDGE_PCI &&
(PCI_SLOT(dev->devfn) == 0)) {
next_bus = dev->busn_res.end;
next_bus = dev->subordinate;
controllers[i].mem_resources[0] =
*next_bus->resource[0];
controllers[i].mem_resources[1] =
Expand Down
9 changes: 4 additions & 5 deletions trunk/arch/x86/pci/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ struct pci_root_info {
char name[16];
unsigned int res_num;
struct resource *res;
int busnum;
struct pci_sysdata sd;
};

Expand Down Expand Up @@ -346,9 +347,7 @@ probe_pci_root_info(struct pci_root_info *info, struct acpi_device *device,
{
size_t size;

sprintf(info->name, "PCI Bus %04x:%02x", domain, busnum);
info->bridge = device;

info->res_num = 0;
acpi_walk_resources(device->handle, METHOD_NAME__CRS, count_resource,
info);
Expand All @@ -361,6 +360,8 @@ probe_pci_root_info(struct pci_root_info *info, struct acpi_device *device,
if (!info->res)
return;

sprintf(info->name, "PCI Bus %04x:%02x", domain, busnum);

acpi_walk_resources(device->handle, METHOD_NAME__CRS, setup_resource,
info);
}
Expand Down Expand Up @@ -425,8 +426,6 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_pci_root *root)
} else {
probe_pci_root_info(info, device, busnum, domain);

/* insert busn res at first */
pci_add_resource(&resources, &root->secondary);
/*
* _CRS with no apertures is normal, so only fall back to
* defaults or native bridge info if we're ignoring _CRS.
Expand All @@ -441,7 +440,7 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_pci_root *root)
bus = pci_create_root_bus(NULL, busnum, &pci_root_ops, sd,
&resources);
if (bus) {
pci_scan_child_bus(bus);
bus->subordinate = pci_scan_child_bus(bus);
pci_set_host_bridge_release(
to_pci_host_bridge(bus->bridge),
release_pci_root_info, info);
Expand Down
7 changes: 4 additions & 3 deletions trunk/arch/x86/pci/amd_bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ static int __init early_fill_mp_bus_info(void)
link = (reg >> 8) & 0x03;

info = alloc_pci_root_info(min_bus, max_bus, node, link);
sprintf(info->name, "PCI Bus #%02x", min_bus);
}

/* get the default node and link for left over res */
Expand Down Expand Up @@ -299,9 +300,9 @@ static int __init early_fill_mp_bus_info(void)
int busnum;
struct pci_root_res *root_res;

busnum = info->busn.start;
printk(KERN_DEBUG "bus: %pR on node %x link %x\n",
&info->busn, info->node, info->link);
busnum = info->bus_min;
printk(KERN_DEBUG "bus: [%02x, %02x] on node %x link %x\n",
info->bus_min, info->bus_max, info->node, info->link);
list_for_each_entry(root_res, &info->resources, list)
printk(KERN_DEBUG "bus: %02x %pR\n",
busnum, &root_res->res);
Expand Down
22 changes: 3 additions & 19 deletions trunk/arch/x86/pci/bus_numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ static struct pci_root_info *x86_find_pci_root_info(int bus)
return NULL;

list_for_each_entry(info, &pci_root_infos, list)
if (info->busn.start == bus)
if (info->bus_min == bus)
return info;

return NULL;
Expand All @@ -24,25 +24,13 @@ void x86_pci_root_bus_resources(int bus, struct list_head *resources)
{
struct pci_root_info *info = x86_find_pci_root_info(bus);
struct pci_root_res *root_res;
struct pci_host_bridge_window *window;
bool found = false;

if (!info)
goto default_resources;

printk(KERN_DEBUG "PCI: root bus %02x: hardware-probed resources\n",
bus);

/* already added by acpi ? */
list_for_each_entry(window, resources, list)
if (window->res->flags & IORESOURCE_BUS) {
found = true;
break;
}

if (!found)
pci_add_resource(resources, &info->busn);

list_for_each_entry(root_res, &info->resources, list) {
struct resource *res;
struct resource *root;
Expand Down Expand Up @@ -78,13 +66,9 @@ struct pci_root_info __init *alloc_pci_root_info(int bus_min, int bus_max,
if (!info)
return info;

sprintf(info->name, "PCI Bus #%02x", bus_min);

INIT_LIST_HEAD(&info->resources);
info->busn.name = info->name;
info->busn.start = bus_min;
info->busn.end = bus_max;
info->busn.flags = IORESOURCE_BUS;
info->bus_min = bus_min;
info->bus_max = bus_max;
info->node = node;
info->link = link;

Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/x86/pci/bus_numa.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ struct pci_root_info {
struct list_head list;
char name[12];
struct list_head resources;
struct resource busn;
int bus_min;
int bus_max;
int node;
int link;
};
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/xtensa/kernel/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ static int __init pcibios_init(void)
bus = pci_scan_root_bus(NULL, pci_ctrl->first_busno,
pci_ctrl->ops, pci_ctrl, &resources);
pci_ctrl->bus = bus;
pci_ctrl->last_busno = bus->busn_res.end;
pci_ctrl->last_busno = bus->subordinate;
if (next_busno <= pci_ctrl->last_busno)
next_busno = pci_ctrl->last_busno+1;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/iommu/intel-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ static struct intel_iommu *device_to_iommu(int segment, u8 bus, u8 devfn)
if (drhd->devices[i] &&
drhd->devices[i]->subordinate &&
drhd->devices[i]->subordinate->number <= bus &&
drhd->devices[i]->subordinate->busn_res.end >= bus)
drhd->devices[i]->subordinate->subordinate >= bus)
return drhd->iommu;
}

Expand Down
Loading

0 comments on commit 7a055b1

Please sign in to comment.