Skip to content

Commit 30aa80d

Browse files
Yinghai Lubjorn-helgaas
authored andcommitted
parisc/PCI: register busn_res for root buses
Add the host bridge bus number aperture to the resource list. Like the MMIO and I/O port apertures, this is used when assigning resources to hot-added devices or in the case of conflicts. [bhelgaas: changelog, set flags directly, at LBA bus_num init] CC: Kyle McMartin <kyle@mcmartin.ca> CC: Helge Deller <deller@gmx.de> CC: linux-parisc@vger.kernel.org Signed-off-by: Yinghai Lu <yinghai@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
1 parent be8e60d commit 30aa80d

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

‎drivers/parisc/dino.c‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,7 @@ static int __init dino_probe(struct parisc_device *dev)
898898
LIST_HEAD(resources);
899899
struct pci_bus *bus;
900900
unsigned long hpa = dev->hpa.start;
901+
int max;
901902

902903
name = "Dino";
903904
if (is_card_dino(&dev->id)) {
@@ -983,6 +984,10 @@ static int __init dino_probe(struct parisc_device *dev)
983984
if (dino_dev->hba.gmmio_space.flags)
984985
pci_add_resource(&resources, &dino_dev->hba.gmmio_space);
985986

987+
dino_dev->hba.bus_num.start = dino_current_bus;
988+
dino_dev->hba.bus_num.end = 255;
989+
dino_dev->hba.bus_num.flags = IORESOURCE_BUS;
990+
pci_add_resource(&resources, &dino_dev->hba.bus_num);
986991
/*
987992
** It's not used to avoid chicken/egg problems
988993
** with configuration accessor functions.
@@ -998,12 +1003,13 @@ static int __init dino_probe(struct parisc_device *dev)
9981003
return 0;
9991004
}
10001005

1001-
bus->busn_res.end = pci_scan_child_bus(bus);
1006+
max = pci_scan_child_bus(bus);
1007+
pci_bus_update_busn_res_end(bus, max);
10021008

10031009
/* This code *depends* on scanning being single threaded
10041010
* if it isn't, this global bus number count will fail
10051011
*/
1006-
dino_current_bus = bus->busn_res.end + 1;
1012+
dino_current_bus = max + 1;
10071013
pci_bus_assign_resources(bus);
10081014
pci_bus_add_devices(bus);
10091015
return 0;

‎drivers/parisc/lba_pci.c‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,7 @@ lba_pat_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev)
989989
case PAT_PBNUM:
990990
lba_dev->hba.bus_num.start = p->start;
991991
lba_dev->hba.bus_num.end = p->end;
992+
lba_dev->hba.bus_num.flags = IORESOURCE_BUS;
992993
break;
993994

994995
case PAT_LMMIO:
@@ -1366,6 +1367,7 @@ lba_driver_probe(struct parisc_device *dev)
13661367
void *tmp_obj;
13671368
char *version;
13681369
void __iomem *addr = ioremap_nocache(dev->hpa.start, 4096);
1370+
int max;
13691371

13701372
/* Read HW Rev First */
13711373
func_class = READ_REG32(addr + LBA_FCLASS);
@@ -1502,6 +1504,8 @@ lba_driver_probe(struct parisc_device *dev)
15021504
if (lba_dev->hba.gmmio_space.flags)
15031505
pci_add_resource(&resources, &lba_dev->hba.gmmio_space);
15041506

1507+
pci_add_resource(&resources, &lba_dev->hba.bus_num);
1508+
15051509
dev->dev.platform_data = lba_dev;
15061510
lba_bus = lba_dev->hba.hba_bus =
15071511
pci_create_root_bus(&dev->dev, lba_dev->hba.bus_num.start,
@@ -1511,7 +1515,7 @@ lba_driver_probe(struct parisc_device *dev)
15111515
return 0;
15121516
}
15131517

1514-
lba_bus->busn_res.end = pci_scan_child_bus(lba_bus);
1518+
max = pci_scan_child_bus(lba_bus);
15151519

15161520
/* This is in lieu of calling pci_assign_unassigned_resources() */
15171521
if (is_pdc_pat()) {
@@ -1541,7 +1545,7 @@ lba_driver_probe(struct parisc_device *dev)
15411545
lba_dev->flags |= LBA_FLAG_SKIP_PROBE;
15421546
}
15431547

1544-
lba_next_bus = lba_res->busn_res.end + 1;
1548+
lba_next_bus = max + 1;
15451549
pci_bus_add_devices(lba_bus);
15461550

15471551
/* Whew! Finally done! Tell services we got this one covered. */

0 commit comments

Comments
 (0)