Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 63873
b: refs/heads/master
c: 73c59af
h: refs/heads/master
i:
  63871: 831dcce
v: v3
  • Loading branch information
Muli Ben-Yehuda authored and Linus Torvalds committed Aug 11, 2007
1 parent 5024a76 commit 323d0ce
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 15 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: f0b85c0cfdad8977d82fed88e846fc2245585d0e
refs/heads/master: 73c59afc65cfa50c3362b9ce1ec151a79c41dd8e
23 changes: 23 additions & 0 deletions trunk/arch/i386/pci/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,3 +455,26 @@ void pcibios_disable_device (struct pci_dev *dev)
if (!dev->msi_enabled && pcibios_disable_irq)
pcibios_disable_irq(dev);
}

struct pci_bus *pci_scan_bus_with_sysdata(int busno)
{
struct pci_bus *bus = NULL;
struct pci_sysdata *sd;

/*
* Allocate per-root-bus (not per bus) arch-specific data.
* TODO: leak; this memory is never freed.
* It's arguable whether it's worth the trouble to care.
*/
sd = kzalloc(sizeof(*sd), GFP_KERNEL);
if (!sd) {
printk(KERN_ERR "PCI: OOM, skipping PCI bus %02x\n", busno);
return NULL;
}
sd->node = -1;
bus = pci_scan_bus(busno, &pci_root_ops, sd);
if (!bus)
kfree(sd);

return bus;
}
6 changes: 3 additions & 3 deletions trunk/arch/i386/pci/fixup.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ static void __devinit pci_fixup_i450nx(struct pci_dev *d)
pci_read_config_byte(d, reg++, &subb);
DBG("i450NX PXB %d: %02x/%02x/%02x\n", pxb, busno, suba, subb);
if (busno)
pci_scan_bus(busno, &pci_root_ops, NULL); /* Bus A */
pci_scan_bus_with_sysdata(busno); /* Bus A */
if (suba < subb)
pci_scan_bus(suba+1, &pci_root_ops, NULL); /* Bus B */
pci_scan_bus_with_sysdata(suba+1); /* Bus B */
}
pcibios_last_bus = -1;
}
Expand All @@ -42,7 +42,7 @@ static void __devinit pci_fixup_i450gx(struct pci_dev *d)
u8 busno;
pci_read_config_byte(d, 0x4a, &busno);
printk(KERN_INFO "PCI: i440KX/GX host bridge %s: secondary bus %02x\n", pci_name(d), busno);
pci_scan_bus(busno, &pci_root_ops, NULL);
pci_scan_bus_with_sysdata(busno);
pcibios_last_bus = -1;
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454GX, pci_fixup_i450gx);
Expand Down
5 changes: 3 additions & 2 deletions trunk/arch/i386/pci/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,9 @@ static void __init pirq_peer_trick(void)
for(i = 1; i < 256; i++) {
if (!busmap[i] || pci_find_bus(0, i))
continue;
if (pci_scan_bus(i, &pci_root_ops, NULL))
printk(KERN_INFO "PCI: Discovered primary peer bus %02x [IRQ]\n", i);
if (pci_scan_bus_with_sysdata(i))
printk(KERN_INFO "PCI: Discovered primary peer "
"bus %02x [IRQ]\n", i);
}
pcibios_last_bus = -1;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/i386/pci/legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static void __devinit pcibios_fixup_peer_bridges(void)
l != 0x0000 && l != 0xffff) {
DBG("Found device at %02x:%02x [%04x]\n", n, devfn, l);
printk(KERN_INFO "PCI: Discovered peer bus %02x\n", n);
pci_scan_bus(n, &pci_root_ops, NULL);
pci_scan_bus_with_sysdata(n);
break;
}
}
Expand Down
15 changes: 9 additions & 6 deletions trunk/arch/i386/pci/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,14 @@ static void __devinit pci_fixup_i450nx(struct pci_dev *d)
pci_read_config_byte(d, reg++, &suba);
pci_read_config_byte(d, reg++, &subb);
DBG("i450NX PXB %d: %02x/%02x/%02x\n", pxb, busno, suba, subb);
if (busno)
pci_scan_bus(QUADLOCAL2BUS(quad,busno), &pci_root_ops, NULL); /* Bus A */
if (suba < subb)
pci_scan_bus(QUADLOCAL2BUS(quad,suba+1), &pci_root_ops, NULL); /* Bus B */
if (busno) {
/* Bus A */
pci_scan_bus_with_sysdata(QUADLOCAL2BUS(quad, busno));
}
if (suba < subb) {
/* Bus B */
pci_scan_bus_with_sysdata(QUADLOCAL2BUS(quad, suba+1));
}
}
pcibios_last_bus = -1;
}
Expand All @@ -123,8 +127,7 @@ static int __init pci_numa_init(void)
continue;
printk("Scanning PCI bus %d for quad %d\n",
QUADLOCAL2BUS(quad,0), quad);
pci_scan_bus(QUADLOCAL2BUS(quad,0),
&pci_root_ops, NULL);
pci_scan_bus_with_sysdata(QUADLOCAL2BUS(quad, 0));
}
return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/i386/pci/visws.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ static int __init pcibios_init(void)
"bridge B (PIIX4) bus: %u\n", pci_bus1, pci_bus0);

raw_pci_ops = &pci_direct_conf1;
pci_scan_bus(pci_bus0, &pci_root_ops, NULL);
pci_scan_bus(pci_bus1, &pci_root_ops, NULL);
pci_scan_bus_with_sysdata(pci_bus0);
pci_scan_bus_with_sysdata(pci_bus1);
pci_fixup_irqs(visws_swizzle, visws_map_irq);
pcibios_resource_survey();
return 0;
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/asm-i386/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ struct pci_sysdata {
int node; /* NUMA node */
};

/* scan a bus after allocating a pci_sysdata for it */
extern struct pci_bus *pci_scan_bus_with_sysdata(int busno);

#include <linux/mm.h> /* for struct page */

/* Can be used to override the logic in pci_scan_bus for skipping
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/asm-x86_64/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ struct pci_sysdata {
void* iommu; /* IOMMU private data */
};

extern struct pci_bus *pci_scan_bus_with_sysdata(int busno);

#ifdef CONFIG_CALGARY_IOMMU
static inline void* pci_iommu(struct pci_bus *bus)
{
Expand Down

0 comments on commit 323d0ce

Please sign in to comment.