aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/probe.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/probe.c')
-rw-r--r--drivers/pci/probe.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 26a55d08b506..005786416bb5 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -165,7 +165,7 @@ static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom)
165 if (l == 0xffffffff) 165 if (l == 0xffffffff)
166 l = 0; 166 l = 0;
167 if ((l & PCI_BASE_ADDRESS_SPACE) == PCI_BASE_ADDRESS_SPACE_MEMORY) { 167 if ((l & PCI_BASE_ADDRESS_SPACE) == PCI_BASE_ADDRESS_SPACE_MEMORY) {
168 sz = pci_size(l, sz, PCI_BASE_ADDRESS_MEM_MASK); 168 sz = pci_size(l, sz, (u32)PCI_BASE_ADDRESS_MEM_MASK);
169 if (!sz) 169 if (!sz)
170 continue; 170 continue;
171 res->start = l & PCI_BASE_ADDRESS_MEM_MASK; 171 res->start = l & PCI_BASE_ADDRESS_MEM_MASK;
@@ -215,7 +215,7 @@ static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom)
215 if (l == 0xffffffff) 215 if (l == 0xffffffff)
216 l = 0; 216 l = 0;
217 if (sz && sz != 0xffffffff) { 217 if (sz && sz != 0xffffffff) {
218 sz = pci_size(l, sz, PCI_ROM_ADDRESS_MASK); 218 sz = pci_size(l, sz, (u32)PCI_ROM_ADDRESS_MASK);
219 if (sz) { 219 if (sz) {
220 res->flags = (l & IORESOURCE_ROM_ENABLE) | 220 res->flags = (l & IORESOURCE_ROM_ENABLE) |
221 IORESOURCE_MEM | IORESOURCE_PREFETCH | 221 IORESOURCE_MEM | IORESOURCE_PREFETCH |
@@ -402,6 +402,12 @@ static void pci_enable_crs(struct pci_dev *dev)
402static void __devinit pci_fixup_parent_subordinate_busnr(struct pci_bus *child, int max) 402static void __devinit pci_fixup_parent_subordinate_busnr(struct pci_bus *child, int max)
403{ 403{
404 struct pci_bus *parent = child->parent; 404 struct pci_bus *parent = child->parent;
405
406 /* Attempts to fix that up are really dangerous unless
407 we're going to re-assign all bus numbers. */
408 if (!pcibios_assign_all_busses())
409 return;
410
405 while (parent->parent && parent->subordinate < max) { 411 while (parent->parent && parent->subordinate < max) {
406 parent->subordinate = max; 412 parent->subordinate = max;
407 pci_write_config_byte(parent->self, PCI_SUBORDINATE_BUS, max); 413 pci_write_config_byte(parent->self, PCI_SUBORDINATE_BUS, max);
@@ -478,8 +484,18 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max
478 * We need to assign a number to this bus which we always 484 * We need to assign a number to this bus which we always
479 * do in the second pass. 485 * do in the second pass.
480 */ 486 */
481 if (!pass) 487 if (!pass) {
488 if (pcibios_assign_all_busses())
489 /* Temporarily disable forwarding of the
490 configuration cycles on all bridges in
491 this bus segment to avoid possible
492 conflicts in the second pass between two
493 bridges programmed with overlapping
494 bus ranges. */
495 pci_write_config_dword(dev, PCI_PRIMARY_BUS,
496 buses & ~0xffffff);
482 return max; 497 return max;
498 }
483 499
484 /* Clear errors */ 500 /* Clear errors */
485 pci_write_config_word(dev, PCI_STATUS, 0xffff); 501 pci_write_config_word(dev, PCI_STATUS, 0xffff);