Commit 0086de6f authored by Jesse Barnes's avatar Jesse Barnes Committed by David Mosberger

[PATCH] ia64: only scan SN2 PCI busses that exist

sn_pci_init was unconditionally scanning 255 PCI busses, even though
only a few are actually present on most systems.  This patch adds a
check to make sure a given bus exists before doing the scan, which
saves a little memory and also makes /sys/devices reflect reality a
bit more closely.
parent 66c88342
...@@ -811,7 +811,6 @@ sn_pci_init (void) ...@@ -811,7 +811,6 @@ sn_pci_init (void)
/* /*
* set pci_raw_ops, etc. * set pci_raw_ops, etc.
*/ */
sgi_master_io_infr_init(); sgi_master_io_infr_init();
for (cnode = 0; cnode < numnodes; cnode++) { for (cnode = 0; cnode < numnodes; cnode++) {
...@@ -826,16 +825,16 @@ sn_pci_init (void) ...@@ -826,16 +825,16 @@ sn_pci_init (void)
#endif #endif
controller = kmalloc(sizeof(struct pci_controller), GFP_KERNEL); controller = kmalloc(sizeof(struct pci_controller), GFP_KERNEL);
if (controller) { if (!controller) {
memset(controller, 0, sizeof(struct pci_controller)); printk(KERN_WARNING "cannot allocate PCI controller\n");
/* just allocate some devices and fill in the pci_dev structs */ return 0;
for (i = 0; i < PCI_BUSES_TO_SCAN; i++)
pci_scan_bus(i, &sn_pci_ops, controller);
} }
/* memset(controller, 0, sizeof(struct pci_controller));
* actually find devices and fill in hwgraph structs
*/ for (i = 0; i < PCI_BUSES_TO_SCAN; i++)
if (pci_bus_to_vertex(i))
pci_scan_bus(i, &sn_pci_ops, controller);
done_probing = 1; done_probing = 1;
...@@ -857,13 +856,8 @@ sn_pci_init (void) ...@@ -857,13 +856,8 @@ sn_pci_init (void)
* set the root start and end so that drivers calling check_region() * set the root start and end so that drivers calling check_region()
* won't see a conflict * won't see a conflict
*/ */
ioport_resource.start = 0xc000000000000000;
#ifdef CONFIG_IA64_SGI_SN_SIM ioport_resource.end = 0xcfffffffffffffff;
if (! IS_RUNNING_ON_SIMULATOR()) {
ioport_resource.start = 0xc000000000000000;
ioport_resource.end = 0xcfffffffffffffff;
}
#endif
/* /*
* Set the root start and end for Mem Resource. * Set the root start and end for Mem Resource.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment