aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--arch/sparc/kernel/pcic.c5
-rw-r--r--drivers/pci/hotplug/acpiphp_glue.c13
-rw-r--r--drivers/pci/hotplug/shpchp_ctrl.c3
-rw-r--r--drivers/pci/pci-sysfs.c2
-rw-r--r--drivers/pci/pci.c15
-rw-r--r--drivers/pci/probe.c18
-rw-r--r--drivers/pci/setup-bus.c2
7 files changed, 28 insertions, 30 deletions
diff --git a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c
index ded3f6090c3..46ba84998f1 100644
--- a/arch/sparc/kernel/pcic.c
+++ b/arch/sparc/kernel/pcic.c
@@ -884,11 +884,6 @@ void __init sun4m_pci_init_IRQ(void)
884 sparc_config.load_profile_irq = pcic_load_profile_irq; 884 sparc_config.load_profile_irq = pcic_load_profile_irq;
885} 885}
886 886
887int pcibios_assign_resource(struct pci_dev *pdev, int resource)
888{
889 return -ENXIO;
890}
891
892/* 887/*
893 * This probably belongs here rather than ioport.c because 888 * This probably belongs here rather than ioport.c because
894 * we do not want this crud linked into SBus kernels. 889 * we do not want this crud linked into SBus kernels.
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index 73af3374e91..395c67d3d29 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -132,6 +132,15 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
132 if (!acpi_pci_check_ejectable(pbus, handle) && !is_dock_device(handle)) 132 if (!acpi_pci_check_ejectable(pbus, handle) && !is_dock_device(handle))
133 return AE_OK; 133 return AE_OK;
134 134
135 status = acpi_evaluate_integer(handle, "_ADR", NULL, &adr);
136 if (ACPI_FAILURE(status)) {
137 warn("can't evaluate _ADR (%#x)\n", status);
138 return AE_OK;
139 }
140
141 device = (adr >> 16) & 0xffff;
142 function = adr & 0xffff;
143
135 pdev = pbus->self; 144 pdev = pbus->self;
136 if (pdev && pci_is_pcie(pdev)) { 145 if (pdev && pci_is_pcie(pdev)) {
137 tmp = acpi_find_root_bridge_handle(pdev); 146 tmp = acpi_find_root_bridge_handle(pdev);
@@ -144,10 +153,6 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
144 } 153 }
145 } 154 }
146 155
147 acpi_evaluate_integer(handle, "_ADR", NULL, &adr);
148 device = (adr >> 16) & 0xffff;
149 function = adr & 0xffff;
150
151 newfunc = kzalloc(sizeof(struct acpiphp_func), GFP_KERNEL); 156 newfunc = kzalloc(sizeof(struct acpiphp_func), GFP_KERNEL);
152 if (!newfunc) 157 if (!newfunc)
153 return AE_NO_MEMORY; 158 return AE_NO_MEMORY;
diff --git a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c
index b00b09bdd38..f9b5a52e411 100644
--- a/drivers/pci/hotplug/shpchp_ctrl.c
+++ b/drivers/pci/hotplug/shpchp_ctrl.c
@@ -262,9 +262,6 @@ static int board_added(struct slot *p_slot)
262 } 262 }
263 263
264 if ((ctrl->pci_dev->vendor == 0x8086) && (ctrl->pci_dev->device == 0x0332)) { 264 if ((ctrl->pci_dev->vendor == 0x8086) && (ctrl->pci_dev->device == 0x0332)) {
265 if (slots_not_empty)
266 return WRONG_BUS_FREQUENCY;
267
268 if ((rc = p_slot->hpc_ops->set_bus_speed_mode(p_slot, PCI_SPEED_33MHz))) { 265 if ((rc = p_slot->hpc_ops->set_bus_speed_mode(p_slot, PCI_SPEED_33MHz))) {
269 ctrl_err(ctrl, "%s: Issue of set bus speed mode command" 266 ctrl_err(ctrl, "%s: Issue of set bus speed mode command"
270 " failed\n", __func__); 267 " failed\n", __func__);
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 86c63fe45d1..a0b435f20bd 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -1112,7 +1112,7 @@ static struct bin_attribute pcie_config_attr = {
1112 .write = pci_write_config, 1112 .write = pci_write_config,
1113}; 1113};
1114 1114
1115int __attribute__ ((weak)) pcibios_add_platform_entries(struct pci_dev *dev) 1115int __weak pcibios_add_platform_entries(struct pci_dev *dev)
1116{ 1116{
1117 return 0; 1117 return 0;
1118} 1118}
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index d4d758d7b72..87928fde77b 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1311,7 +1311,7 @@ void pcim_pin_device(struct pci_dev *pdev)
1311 * is the default implementation. Architecture implementations can 1311 * is the default implementation. Architecture implementations can
1312 * override this. 1312 * override this.
1313 */ 1313 */
1314void __attribute__ ((weak)) pcibios_disable_device (struct pci_dev *dev) {} 1314void __weak pcibios_disable_device (struct pci_dev *dev) {}
1315 1315
1316static void do_pci_disable_device(struct pci_dev *dev) 1316static void do_pci_disable_device(struct pci_dev *dev)
1317{ 1317{
@@ -1375,8 +1375,8 @@ pci_disable_device(struct pci_dev *dev)
1375 * Sets the PCIe reset state for the device. This is the default 1375 * Sets the PCIe reset state for the device. This is the default
1376 * implementation. Architecture implementations can override this. 1376 * implementation. Architecture implementations can override this.
1377 */ 1377 */
1378int __attribute__ ((weak)) pcibios_set_pcie_reset_state(struct pci_dev *dev, 1378int __weak pcibios_set_pcie_reset_state(struct pci_dev *dev,
1379 enum pcie_reset_state state) 1379 enum pcie_reset_state state)
1380{ 1380{
1381 return -EINVAL; 1381 return -EINVAL;
1382} 1382}
@@ -2063,7 +2063,7 @@ int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type type)
2063 return -ENOTSUPP; /* no OBFF support at all */ 2063 return -ENOTSUPP; /* no OBFF support at all */
2064 2064
2065 /* Make sure the topology supports OBFF as well */ 2065 /* Make sure the topology supports OBFF as well */
2066 if (dev->bus) { 2066 if (dev->bus->self) {
2067 ret = pci_enable_obff(dev->bus->self, type); 2067 ret = pci_enable_obff(dev->bus->self, type);
2068 if (ret) 2068 if (ret)
2069 return ret; 2069 return ret;
@@ -2166,7 +2166,7 @@ int pci_enable_ltr(struct pci_dev *dev)
2166 return -EINVAL; 2166 return -EINVAL;
2167 2167
2168 /* Enable upstream ports first */ 2168 /* Enable upstream ports first */
2169 if (dev->bus) { 2169 if (dev->bus->self) {
2170 ret = pci_enable_ltr(dev->bus->self); 2170 ret = pci_enable_ltr(dev->bus->self);
2171 if (ret) 2171 if (ret)
2172 return ret; 2172 return ret;
@@ -3419,8 +3419,7 @@ int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc)
3419 3419
3420 o = (cmd & PCI_X_CMD_MAX_READ) >> 2; 3420 o = (cmd & PCI_X_CMD_MAX_READ) >> 2;
3421 if (o != v) { 3421 if (o != v) {
3422 if (v > o && dev->bus && 3422 if (v > o && (dev->bus->bus_flags & PCI_BUS_FLAGS_NO_MMRBC))
3423 (dev->bus->bus_flags & PCI_BUS_FLAGS_NO_MMRBC))
3424 return -EIO; 3423 return -EIO;
3425 3424
3426 cmd &= ~PCI_X_CMD_MAX_READ; 3425 cmd &= ~PCI_X_CMD_MAX_READ;
@@ -3875,7 +3874,7 @@ static void __devinit pci_no_domains(void)
3875 * greater than 0xff). This is the default implementation. Architecture 3874 * greater than 0xff). This is the default implementation. Architecture
3876 * implementations can override this. 3875 * implementations can override this.
3877 */ 3876 */
3878int __attribute__ ((weak)) pci_ext_cfg_avail(struct pci_dev *dev) 3877int __weak pci_ext_cfg_avail(struct pci_dev *dev)
3879{ 3878{
3880 return 1; 3879 return 1;
3881} 3880}
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 08404098080..cd06c847826 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 "
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 192172c87b7..561e41cf102 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -265,7 +265,7 @@ out:
265 * assign_requested_resources_sorted() - satisfy resource requests 265 * assign_requested_resources_sorted() - satisfy resource requests
266 * 266 *
267 * @head : head of the list tracking requests for resources 267 * @head : head of the list tracking requests for resources
268 * @failed_list : head of the list tracking requests that could 268 * @fail_head : head of the list tracking requests that could
269 * not be allocated 269 * not be allocated
270 * 270 *
271 * Satisfy resource requests of each element in the list. Add 271 * Satisfy resource requests of each element in the list. Add