aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/probe.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2012-06-22 17:32:50 -0400
committerBjorn Helgaas <bhelgaas@google.com>2012-06-22 17:32:50 -0400
commit0f6662a49bf1b5a163ed4e6321c382d2390c817b (patch)
treef52d6d047c37ce78af25a0db7e4f54737d023fe4 /drivers/pci/probe.c
parent1693c4276d768464058f191998e035e09ceb9e65 (diff)
parent809a3bf9f34cb6d0c0383b31b3495fa1ed3508a6 (diff)
Merge branch 'topic/bjorn-trivial' into next
* topic/bjorn-trivial: PCI: remove useless pcix_set_mmrbc() dev->bus check PCI: acpiphp: check whether _ADR evaluation succeeded PCI: shpchp: remove dead code PCI: fix P2P bridge I/O port window sign extension PCI: fix upstream P2P bridge checks when enabling OBFF and LTR PCI: use __weak consistently PCI: cleanup assign_requested_resources_sorted() kernel-doc warning sparc/PCI: remove unused pcibios_assign_resource() definition
Diffstat (limited to 'drivers/pci/probe.c')
-rw-r--r--drivers/pci/probe.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 08404098080b..cd06c8478267 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -318,10 +318,11 @@ static void __devinit pci_read_bridge_io(struct pci_bus *child)
318 318
319 if ((io_base_lo & PCI_IO_RANGE_TYPE_MASK) == PCI_IO_RANGE_TYPE_32) { 319 if ((io_base_lo & PCI_IO_RANGE_TYPE_MASK) == PCI_IO_RANGE_TYPE_32) {
320 u16 io_base_hi, io_limit_hi; 320 u16 io_base_hi, io_limit_hi;
321
321 pci_read_config_word(dev, PCI_IO_BASE_UPPER16, &io_base_hi); 322 pci_read_config_word(dev, PCI_IO_BASE_UPPER16, &io_base_hi);
322 pci_read_config_word(dev, PCI_IO_LIMIT_UPPER16, &io_limit_hi); 323 pci_read_config_word(dev, PCI_IO_LIMIT_UPPER16, &io_limit_hi);
323 base |= (io_base_hi << 16); 324 base |= ((unsigned long) io_base_hi << 16);
324 limit |= (io_limit_hi << 16); 325 limit |= ((unsigned long) io_limit_hi << 16);
325 } 326 }
326 327
327 if (base && base <= limit) { 328 if (base && base <= limit) {
@@ -349,8 +350,8 @@ static void __devinit pci_read_bridge_mmio(struct pci_bus *child)
349 res = child->resource[1]; 350 res = child->resource[1];
350 pci_read_config_word(dev, PCI_MEMORY_BASE, &mem_base_lo); 351 pci_read_config_word(dev, PCI_MEMORY_BASE, &mem_base_lo);
351 pci_read_config_word(dev, PCI_MEMORY_LIMIT, &mem_limit_lo); 352 pci_read_config_word(dev, PCI_MEMORY_LIMIT, &mem_limit_lo);
352 base = (mem_base_lo & PCI_MEMORY_RANGE_MASK) << 16; 353 base = ((unsigned long) mem_base_lo & PCI_MEMORY_RANGE_MASK) << 16;
353 limit = (mem_limit_lo & PCI_MEMORY_RANGE_MASK) << 16; 354 limit = ((unsigned long) mem_limit_lo & PCI_MEMORY_RANGE_MASK) << 16;
354 if (base && base <= limit) { 355 if (base && base <= limit) {
355 res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM; 356 res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM;
356 region.start = base; 357 region.start = base;
@@ -371,11 +372,12 @@ static void __devinit pci_read_bridge_mmio_pref(struct pci_bus *child)
371 res = child->resource[2]; 372 res = child->resource[2];
372 pci_read_config_word(dev, PCI_PREF_MEMORY_BASE, &mem_base_lo); 373 pci_read_config_word(dev, PCI_PREF_MEMORY_BASE, &mem_base_lo);
373 pci_read_config_word(dev, PCI_PREF_MEMORY_LIMIT, &mem_limit_lo); 374 pci_read_config_word(dev, PCI_PREF_MEMORY_LIMIT, &mem_limit_lo);
374 base = (mem_base_lo & PCI_PREF_RANGE_MASK) << 16; 375 base = ((unsigned long) mem_base_lo & PCI_PREF_RANGE_MASK) << 16;
375 limit = (mem_limit_lo & PCI_PREF_RANGE_MASK) << 16; 376 limit = ((unsigned long) mem_limit_lo & PCI_PREF_RANGE_MASK) << 16;
376 377
377 if ((mem_base_lo & PCI_PREF_RANGE_TYPE_MASK) == PCI_PREF_RANGE_TYPE_64) { 378 if ((mem_base_lo & PCI_PREF_RANGE_TYPE_MASK) == PCI_PREF_RANGE_TYPE_64) {
378 u32 mem_base_hi, mem_limit_hi; 379 u32 mem_base_hi, mem_limit_hi;
380
379 pci_read_config_dword(dev, PCI_PREF_BASE_UPPER32, &mem_base_hi); 381 pci_read_config_dword(dev, PCI_PREF_BASE_UPPER32, &mem_base_hi);
380 pci_read_config_dword(dev, PCI_PREF_LIMIT_UPPER32, &mem_limit_hi); 382 pci_read_config_dword(dev, PCI_PREF_LIMIT_UPPER32, &mem_limit_hi);
381 383
@@ -386,8 +388,8 @@ static void __devinit pci_read_bridge_mmio_pref(struct pci_bus *child)
386 */ 388 */
387 if (mem_base_hi <= mem_limit_hi) { 389 if (mem_base_hi <= mem_limit_hi) {
388#if BITS_PER_LONG == 64 390#if BITS_PER_LONG == 64
389 base |= ((long) mem_base_hi) << 32; 391 base |= ((unsigned long) mem_base_hi) << 32;
390 limit |= ((long) mem_limit_hi) << 32; 392 limit |= ((unsigned long) mem_limit_hi) << 32;
391#else 393#else
392 if (mem_base_hi || mem_limit_hi) { 394 if (mem_base_hi || mem_limit_hi) {
393 dev_err(&dev->dev, "can't handle 64-bit " 395 dev_err(&dev->dev, "can't handle 64-bit "