aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-12-11 15:18:16 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-11 15:18:16 -0500
commit11bd04f6f35621193311c32e0721142b073a7794 (patch)
tree00979740582bb26e8d3756bf3526c85f19f66a46 /drivers/pnp
parent4e2ccdb0409146f8cf64a11b6ef82a9c928ced2a (diff)
parent9e0b5b2c447ad0caa075a5cfef86def62e1782ff (diff)
Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6
* 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6: (109 commits) PCI: fix coding style issue in pci_save_state() PCI: add pci_request_acs PCI: fix BUG_ON triggered by logical PCIe root port removal PCI: remove ifdefed pci_cleanup_aer_correct_error_status PCI: unconditionally clear AER uncorr status register during cleanup x86/PCI: claim SR-IOV BARs in pcibios_allocate_resource PCI: portdrv: remove redundant definitions PCI: portdrv: remove unnecessary struct pcie_port_data PCI: portdrv: minor cleanup for pcie_port_device_register PCI: portdrv: add missing irq cleanup PCI: portdrv: enable device before irq initialization PCI: portdrv: cleanup service irqs initialization PCI: portdrv: check capabilities first PCI: portdrv: move PME capability check PCI: portdrv: remove redundant pcie type calculation PCI: portdrv: cleanup pcie_device registration PCI: portdrv: remove redundant pcie_port_device_probe PCI: Always set prefetchable base/limit upper32 registers PCI: read-modify-write the pcie device control register when initiating pcie flr PCI: show dma_mask bits in /sys ... Fixed up conflicts in: arch/x86/kernel/amd_iommu_init.c drivers/pci/dmar.c drivers/pci/hotplug/acpiphp_glue.c
Diffstat (limited to 'drivers/pnp')
-rw-r--r--drivers/pnp/quirks.c13
-rw-r--r--drivers/pnp/resource.c10
-rw-r--r--drivers/pnp/support.c43
-rw-r--r--drivers/pnp/system.c14
4 files changed, 19 insertions, 61 deletions
diff --git a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c
index 8473fe5ed7ff..dfbd5a6cc58b 100644
--- a/drivers/pnp/quirks.c
+++ b/drivers/pnp/quirks.c
@@ -285,15 +285,10 @@ static void quirk_system_pci_resources(struct pnp_dev *dev)
285 * the PCI region, and that might prevent a PCI 285 * the PCI region, and that might prevent a PCI
286 * driver from requesting its resources. 286 * driver from requesting its resources.
287 */ 287 */
288 dev_warn(&dev->dev, "%s resource " 288 dev_warn(&dev->dev,
289 "(0x%llx-0x%llx) overlaps %s BAR %d " 289 "disabling %pR because it overlaps "
290 "(0x%llx-0x%llx), disabling\n", 290 "%s BAR %d %pR\n", res,
291 pnp_resource_type_name(res), 291 pci_name(pdev), i, &pdev->resource[i]);
292 (unsigned long long) pnp_start,
293 (unsigned long long) pnp_end,
294 pci_name(pdev), i,
295 (unsigned long long) pci_start,
296 (unsigned long long) pci_end);
297 res->flags |= IORESOURCE_DISABLED; 292 res->flags |= IORESOURCE_DISABLED;
298 } 293 }
299 } 294 }
diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c
index ba9765427886..64d0596bafb5 100644
--- a/drivers/pnp/resource.c
+++ b/drivers/pnp/resource.c
@@ -517,7 +517,7 @@ struct pnp_resource *pnp_add_irq_resource(struct pnp_dev *dev, int irq,
517 res->start = irq; 517 res->start = irq;
518 res->end = irq; 518 res->end = irq;
519 519
520 pnp_dbg(&dev->dev, " add irq %d flags %#x\n", irq, flags); 520 pnp_dbg(&dev->dev, " add %pr\n", res);
521 return pnp_res; 521 return pnp_res;
522} 522}
523 523
@@ -538,7 +538,7 @@ struct pnp_resource *pnp_add_dma_resource(struct pnp_dev *dev, int dma,
538 res->start = dma; 538 res->start = dma;
539 res->end = dma; 539 res->end = dma;
540 540
541 pnp_dbg(&dev->dev, " add dma %d flags %#x\n", dma, flags); 541 pnp_dbg(&dev->dev, " add %pr\n", res);
542 return pnp_res; 542 return pnp_res;
543} 543}
544 544
@@ -562,8 +562,7 @@ struct pnp_resource *pnp_add_io_resource(struct pnp_dev *dev,
562 res->start = start; 562 res->start = start;
563 res->end = end; 563 res->end = end;
564 564
565 pnp_dbg(&dev->dev, " add io %#llx-%#llx flags %#x\n", 565 pnp_dbg(&dev->dev, " add %pr\n", res);
566 (unsigned long long) start, (unsigned long long) end, flags);
567 return pnp_res; 566 return pnp_res;
568} 567}
569 568
@@ -587,8 +586,7 @@ struct pnp_resource *pnp_add_mem_resource(struct pnp_dev *dev,
587 res->start = start; 586 res->start = start;
588 res->end = end; 587 res->end = end;
589 588
590 pnp_dbg(&dev->dev, " add mem %#llx-%#llx flags %#x\n", 589 pnp_dbg(&dev->dev, " add %pr\n", res);
591 (unsigned long long) start, (unsigned long long) end, flags);
592 return pnp_res; 590 return pnp_res;
593} 591}
594 592
diff --git a/drivers/pnp/support.c b/drivers/pnp/support.c
index 63087d5ce609..9585c1c1cc36 100644
--- a/drivers/pnp/support.c
+++ b/drivers/pnp/support.c
@@ -75,47 +75,14 @@ char *pnp_resource_type_name(struct resource *res)
75 75
76void dbg_pnp_show_resources(struct pnp_dev *dev, char *desc) 76void dbg_pnp_show_resources(struct pnp_dev *dev, char *desc)
77{ 77{
78 char buf[128];
79 int len;
80 struct pnp_resource *pnp_res; 78 struct pnp_resource *pnp_res;
81 struct resource *res;
82 79
83 if (list_empty(&dev->resources)) { 80 if (list_empty(&dev->resources))
84 pnp_dbg(&dev->dev, "%s: no current resources\n", desc); 81 pnp_dbg(&dev->dev, "%s: no current resources\n", desc);
85 return; 82 else {
86 } 83 pnp_dbg(&dev->dev, "%s: current resources:\n", desc);
87 84 list_for_each_entry(pnp_res, &dev->resources, list)
88 pnp_dbg(&dev->dev, "%s: current resources:\n", desc); 85 pnp_dbg(&dev->dev, "%pr\n", &pnp_res->res);
89 list_for_each_entry(pnp_res, &dev->resources, list) {
90 res = &pnp_res->res;
91 len = 0;
92
93 len += scnprintf(buf + len, sizeof(buf) - len, " %-3s ",
94 pnp_resource_type_name(res));
95
96 if (res->flags & IORESOURCE_DISABLED) {
97 pnp_dbg(&dev->dev, "%sdisabled\n", buf);
98 continue;
99 }
100
101 switch (pnp_resource_type(res)) {
102 case IORESOURCE_IO:
103 case IORESOURCE_MEM:
104 len += scnprintf(buf + len, sizeof(buf) - len,
105 "%#llx-%#llx flags %#lx",
106 (unsigned long long) res->start,
107 (unsigned long long) res->end,
108 res->flags);
109 break;
110 case IORESOURCE_IRQ:
111 case IORESOURCE_DMA:
112 len += scnprintf(buf + len, sizeof(buf) - len,
113 "%lld flags %#lx",
114 (unsigned long long) res->start,
115 res->flags);
116 break;
117 }
118 pnp_dbg(&dev->dev, "%s\n", buf);
119 } 86 }
120} 87}
121 88
diff --git a/drivers/pnp/system.c b/drivers/pnp/system.c
index 59b90922da8c..49c1720df59a 100644
--- a/drivers/pnp/system.c
+++ b/drivers/pnp/system.c
@@ -22,11 +22,11 @@ static const struct pnp_device_id pnp_dev_table[] = {
22 {"", 0} 22 {"", 0}
23}; 23};
24 24
25static void reserve_range(struct pnp_dev *dev, resource_size_t start, 25static void reserve_range(struct pnp_dev *dev, struct resource *r, int port)
26 resource_size_t end, int port)
27{ 26{
28 char *regionid; 27 char *regionid;
29 const char *pnpid = dev_name(&dev->dev); 28 const char *pnpid = dev_name(&dev->dev);
29 resource_size_t start = r->start, end = r->end;
30 struct resource *res; 30 struct resource *res;
31 31
32 regionid = kmalloc(16, GFP_KERNEL); 32 regionid = kmalloc(16, GFP_KERNEL);
@@ -48,10 +48,8 @@ static void reserve_range(struct pnp_dev *dev, resource_size_t start,
48 * example do reserve stuff they know about too, so we may well 48 * example do reserve stuff they know about too, so we may well
49 * have double reservations. 49 * have double reservations.
50 */ 50 */
51 dev_info(&dev->dev, "%s range 0x%llx-0x%llx %s reserved\n", 51 dev_info(&dev->dev, "%pR %s reserved\n", r,
52 port ? "ioport" : "iomem", 52 res ? "has been" : "could not be");
53 (unsigned long long) start, (unsigned long long) end,
54 res ? "has been" : "could not be");
55} 53}
56 54
57static void reserve_resources_of_dev(struct pnp_dev *dev) 55static void reserve_resources_of_dev(struct pnp_dev *dev)
@@ -77,14 +75,14 @@ static void reserve_resources_of_dev(struct pnp_dev *dev)
77 if (res->end < res->start) 75 if (res->end < res->start)
78 continue; /* invalid */ 76 continue; /* invalid */
79 77
80 reserve_range(dev, res->start, res->end, 1); 78 reserve_range(dev, res, 1);
81 } 79 }
82 80
83 for (i = 0; (res = pnp_get_resource(dev, IORESOURCE_MEM, i)); i++) { 81 for (i = 0; (res = pnp_get_resource(dev, IORESOURCE_MEM, i)); i++) {
84 if (res->flags & IORESOURCE_DISABLED) 82 if (res->flags & IORESOURCE_DISABLED)
85 continue; 83 continue;
86 84
87 reserve_range(dev, res->start, res->end, 0); 85 reserve_range(dev, res, 0);
88 } 86 }
89} 87}
90 88