Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 3843
b: refs/heads/master
c: cc57450
h: refs/heads/master
i:
  3841: a84e82d
  3839: 8badf56
v: v3
  • Loading branch information
Rajesh Shah authored and Greg Kroah-Hartman committed Jun 28, 2005
1 parent 5c55a53 commit c6a9a17
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 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: 71c3511c22e8e0648094672abec898b3bf84c18b
refs/heads/master: cc57450f5c044270d2cf1dd437c1850422262109
12 changes: 10 additions & 2 deletions trunk/drivers/pci/probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max
{
struct pci_bus *child;
int is_cardbus = (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS);
u32 buses;
u32 buses, i;
u16 bctl;

pci_read_config_dword(dev, PCI_PRIMARY_BUS, &buses);
Expand Down Expand Up @@ -470,6 +470,10 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max
/* Clear errors */
pci_write_config_word(dev, PCI_STATUS, 0xffff);

/* Prevent assigning a bus number that already exists.
* This can happen when a bridge is hot-plugged */
if (pci_find_bus(pci_domain_nr(bus), max+1))
return max;
child = pci_alloc_child_bus(bus, dev, ++max);
buses = (buses & 0xff000000)
| ((unsigned int)(child->primary) << 0)
Expand Down Expand Up @@ -501,7 +505,11 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max
* as cards with a PCI-to-PCI bridge can be
* inserted later.
*/
max += CARDBUS_RESERVE_BUSNR;
for (i=0; i<CARDBUS_RESERVE_BUSNR; i++)
if (pci_find_bus(pci_domain_nr(bus),
max+i+1))
break;
max += i;
}
/*
* Set the subordinate bus number to its real value.
Expand Down

0 comments on commit c6a9a17

Please sign in to comment.