diff options
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/hotplug/acpiphp.h | 2 | ||||
-rw-r--r-- | drivers/pci/hotplug/acpiphp_core.c | 2 | ||||
-rw-r--r-- | drivers/pci/hotplug/acpiphp_glue.c | 4 | ||||
-rw-r--r-- | drivers/pci/hotplug/ibmphp_core.c | 5 | ||||
-rw-r--r-- | drivers/pci/hotplug/pciehp_core.c | 23 | ||||
-rw-r--r-- | drivers/pci/intel-iommu.c | 6 | ||||
-rw-r--r-- | drivers/pci/pci-acpi.c | 15 | ||||
-rw-r--r-- | drivers/pci/pci.c | 6 | ||||
-rw-r--r-- | drivers/pci/pcie/aer/aerdrv_core.c | 2 | ||||
-rw-r--r-- | drivers/pci/pcie/aspm.c | 29 | ||||
-rw-r--r-- | drivers/pci/quirks.c | 187 | ||||
-rw-r--r-- | drivers/pci/slot.c | 1 |
12 files changed, 225 insertions, 57 deletions
diff --git a/drivers/pci/hotplug/acpiphp.h b/drivers/pci/hotplug/acpiphp.h index f9e244da30ae..9bcb6cbd5aa9 100644 --- a/drivers/pci/hotplug/acpiphp.h +++ b/drivers/pci/hotplug/acpiphp.h | |||
@@ -113,7 +113,7 @@ struct acpiphp_slot { | |||
113 | 113 | ||
114 | u8 device; /* pci device# */ | 114 | u8 device; /* pci device# */ |
115 | 115 | ||
116 | u32 sun; /* ACPI _SUN (slot unique number) */ | 116 | unsigned long long sun; /* ACPI _SUN (slot unique number) */ |
117 | u32 flags; /* see below */ | 117 | u32 flags; /* see below */ |
118 | }; | 118 | }; |
119 | 119 | ||
diff --git a/drivers/pci/hotplug/acpiphp_core.c b/drivers/pci/hotplug/acpiphp_core.c index 95b536a23d25..43c10bd261b4 100644 --- a/drivers/pci/hotplug/acpiphp_core.c +++ b/drivers/pci/hotplug/acpiphp_core.c | |||
@@ -337,7 +337,7 @@ int acpiphp_register_hotplug_slot(struct acpiphp_slot *acpiphp_slot) | |||
337 | slot->hotplug_slot->info->cur_bus_speed = PCI_SPEED_UNKNOWN; | 337 | slot->hotplug_slot->info->cur_bus_speed = PCI_SPEED_UNKNOWN; |
338 | 338 | ||
339 | acpiphp_slot->slot = slot; | 339 | acpiphp_slot->slot = slot; |
340 | snprintf(name, SLOT_NAME_SIZE, "%u", slot->acpi_slot->sun); | 340 | snprintf(name, SLOT_NAME_SIZE, "%llu", slot->acpi_slot->sun); |
341 | 341 | ||
342 | retval = pci_hp_register(slot->hotplug_slot, | 342 | retval = pci_hp_register(slot->hotplug_slot, |
343 | acpiphp_slot->bridge->pci_bus, | 343 | acpiphp_slot->bridge->pci_bus, |
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index 955aae4071f7..3affc6472e65 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c | |||
@@ -255,13 +255,13 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv) | |||
255 | 255 | ||
256 | bridge->nr_slots++; | 256 | bridge->nr_slots++; |
257 | 257 | ||
258 | dbg("found ACPI PCI Hotplug slot %d at PCI %04x:%02x:%02x\n", | 258 | dbg("found ACPI PCI Hotplug slot %llu at PCI %04x:%02x:%02x\n", |
259 | slot->sun, pci_domain_nr(bridge->pci_bus), | 259 | slot->sun, pci_domain_nr(bridge->pci_bus), |
260 | bridge->pci_bus->number, slot->device); | 260 | bridge->pci_bus->number, slot->device); |
261 | retval = acpiphp_register_hotplug_slot(slot); | 261 | retval = acpiphp_register_hotplug_slot(slot); |
262 | if (retval) { | 262 | if (retval) { |
263 | if (retval == -EBUSY) | 263 | if (retval == -EBUSY) |
264 | warn("Slot %d already registered by another " | 264 | warn("Slot %llu already registered by another " |
265 | "hotplug driver\n", slot->sun); | 265 | "hotplug driver\n", slot->sun); |
266 | else | 266 | else |
267 | warn("acpiphp_register_hotplug_slot failed " | 267 | warn("acpiphp_register_hotplug_slot failed " |
diff --git a/drivers/pci/hotplug/ibmphp_core.c b/drivers/pci/hotplug/ibmphp_core.c index c892daae74d6..633e743442ac 100644 --- a/drivers/pci/hotplug/ibmphp_core.c +++ b/drivers/pci/hotplug/ibmphp_core.c | |||
@@ -1402,10 +1402,6 @@ static int __init ibmphp_init(void) | |||
1402 | goto error; | 1402 | goto error; |
1403 | } | 1403 | } |
1404 | 1404 | ||
1405 | /* lock ourselves into memory with a module | ||
1406 | * count of -1 so that no one can unload us. */ | ||
1407 | module_put(THIS_MODULE); | ||
1408 | |||
1409 | exit: | 1405 | exit: |
1410 | return rc; | 1406 | return rc; |
1411 | 1407 | ||
@@ -1423,4 +1419,3 @@ static void __exit ibmphp_exit(void) | |||
1423 | } | 1419 | } |
1424 | 1420 | ||
1425 | module_init(ibmphp_init); | 1421 | module_init(ibmphp_init); |
1426 | module_exit(ibmphp_exit); | ||
diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c index 4b23bc39b11e..39cf248d24e3 100644 --- a/drivers/pci/hotplug/pciehp_core.c +++ b/drivers/pci/hotplug/pciehp_core.c | |||
@@ -432,18 +432,19 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_ | |||
432 | goto err_out_release_ctlr; | 432 | goto err_out_release_ctlr; |
433 | } | 433 | } |
434 | 434 | ||
435 | /* Check if slot is occupied */ | ||
435 | t_slot = pciehp_find_slot(ctrl, ctrl->slot_device_offset); | 436 | t_slot = pciehp_find_slot(ctrl, ctrl->slot_device_offset); |
436 | 437 | t_slot->hpc_ops->get_adapter_status(t_slot, &value); | |
437 | t_slot->hpc_ops->get_adapter_status(t_slot, &value); /* Check if slot is occupied */ | 438 | if (value) { |
438 | if (value && pciehp_force) { | 439 | if (pciehp_force) |
439 | rc = pciehp_enable_slot(t_slot); | 440 | pciehp_enable_slot(t_slot); |
440 | if (rc) /* -ENODEV: shouldn't happen, but deal with it */ | 441 | } else { |
441 | value = 0; | 442 | /* Power off slot if not occupied */ |
442 | } | 443 | if (POWER_CTRL(ctrl)) { |
443 | if ((POWER_CTRL(ctrl)) && !value) { | 444 | rc = t_slot->hpc_ops->power_off_slot(t_slot); |
444 | rc = t_slot->hpc_ops->power_off_slot(t_slot); /* Power off slot if not occupied*/ | 445 | if (rc) |
445 | if (rc) | 446 | goto err_out_free_ctrl_slot; |
446 | goto err_out_free_ctrl_slot; | 447 | } |
447 | } | 448 | } |
448 | 449 | ||
449 | return 0; | 450 | return 0; |
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c index a2692724b68f..5c8baa43ac9c 100644 --- a/drivers/pci/intel-iommu.c +++ b/drivers/pci/intel-iommu.c | |||
@@ -1655,12 +1655,14 @@ int __init init_dmars(void) | |||
1655 | iommu->flush.flush_context = __iommu_flush_context; | 1655 | iommu->flush.flush_context = __iommu_flush_context; |
1656 | iommu->flush.flush_iotlb = __iommu_flush_iotlb; | 1656 | iommu->flush.flush_iotlb = __iommu_flush_iotlb; |
1657 | printk(KERN_INFO "IOMMU 0x%Lx: using Register based " | 1657 | printk(KERN_INFO "IOMMU 0x%Lx: using Register based " |
1658 | "invalidation\n", drhd->reg_base_addr); | 1658 | "invalidation\n", |
1659 | (unsigned long long)drhd->reg_base_addr); | ||
1659 | } else { | 1660 | } else { |
1660 | iommu->flush.flush_context = qi_flush_context; | 1661 | iommu->flush.flush_context = qi_flush_context; |
1661 | iommu->flush.flush_iotlb = qi_flush_iotlb; | 1662 | iommu->flush.flush_iotlb = qi_flush_iotlb; |
1662 | printk(KERN_INFO "IOMMU 0x%Lx: using Queued " | 1663 | printk(KERN_INFO "IOMMU 0x%Lx: using Queued " |
1663 | "invalidation\n", drhd->reg_base_addr); | 1664 | "invalidation\n", |
1665 | (unsigned long long)drhd->reg_base_addr); | ||
1664 | } | 1666 | } |
1665 | } | 1667 | } |
1666 | 1668 | ||
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index b3a63edb6901..ae5ec76dca77 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c | |||
@@ -63,7 +63,7 @@ static acpi_status acpi_run_osc(acpi_handle handle, | |||
63 | union acpi_object in_params[4]; | 63 | union acpi_object in_params[4]; |
64 | struct acpi_buffer output = {ACPI_ALLOCATE_BUFFER, NULL}; | 64 | struct acpi_buffer output = {ACPI_ALLOCATE_BUFFER, NULL}; |
65 | union acpi_object *out_obj; | 65 | union acpi_object *out_obj; |
66 | u32 osc_dw0, flags = osc_args->capbuf[OSC_QUERY_TYPE]; | 66 | u32 errors, flags = osc_args->capbuf[OSC_QUERY_TYPE]; |
67 | 67 | ||
68 | /* Setting up input parameters */ | 68 | /* Setting up input parameters */ |
69 | input.count = 4; | 69 | input.count = 4; |
@@ -92,15 +92,16 @@ static acpi_status acpi_run_osc(acpi_handle handle, | |||
92 | status = AE_TYPE; | 92 | status = AE_TYPE; |
93 | goto out_kfree; | 93 | goto out_kfree; |
94 | } | 94 | } |
95 | osc_dw0 = *((u32 *)out_obj->buffer.pointer); | 95 | /* Need to ignore the bit0 in result code */ |
96 | if (osc_dw0) { | 96 | errors = *((u32 *)out_obj->buffer.pointer) & ~(1 << 0); |
97 | if (osc_dw0 & OSC_REQUEST_ERROR) | 97 | if (errors) { |
98 | if (errors & OSC_REQUEST_ERROR) | ||
98 | printk(KERN_DEBUG "_OSC request fails\n"); | 99 | printk(KERN_DEBUG "_OSC request fails\n"); |
99 | if (osc_dw0 & OSC_INVALID_UUID_ERROR) | 100 | if (errors & OSC_INVALID_UUID_ERROR) |
100 | printk(KERN_DEBUG "_OSC invalid UUID\n"); | 101 | printk(KERN_DEBUG "_OSC invalid UUID\n"); |
101 | if (osc_dw0 & OSC_INVALID_REVISION_ERROR) | 102 | if (errors & OSC_INVALID_REVISION_ERROR) |
102 | printk(KERN_DEBUG "_OSC invalid revision\n"); | 103 | printk(KERN_DEBUG "_OSC invalid revision\n"); |
103 | if (osc_dw0 & OSC_CAPABILITIES_MASK_ERROR) { | 104 | if (errors & OSC_CAPABILITIES_MASK_ERROR) { |
104 | if (flags & OSC_QUERY_ENABLE) | 105 | if (flags & OSC_QUERY_ENABLE) |
105 | goto out_success; | 106 | goto out_success; |
106 | printk(KERN_DEBUG "_OSC FW not grant req. control\n"); | 107 | printk(KERN_DEBUG "_OSC FW not grant req. control\n"); |
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 21f2ac639cab..061d1ee0046a 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -1832,7 +1832,7 @@ int pci_reset_function(struct pci_dev *dev) | |||
1832 | if (!(cap & PCI_EXP_DEVCAP_FLR)) | 1832 | if (!(cap & PCI_EXP_DEVCAP_FLR)) |
1833 | return -ENOTTY; | 1833 | return -ENOTTY; |
1834 | 1834 | ||
1835 | if (!dev->msi_enabled && !dev->msix_enabled) | 1835 | if (!dev->msi_enabled && !dev->msix_enabled && dev->irq != 0) |
1836 | disable_irq(dev->irq); | 1836 | disable_irq(dev->irq); |
1837 | pci_save_state(dev); | 1837 | pci_save_state(dev); |
1838 | 1838 | ||
@@ -1841,7 +1841,7 @@ int pci_reset_function(struct pci_dev *dev) | |||
1841 | r = pci_execute_reset_function(dev); | 1841 | r = pci_execute_reset_function(dev); |
1842 | 1842 | ||
1843 | pci_restore_state(dev); | 1843 | pci_restore_state(dev); |
1844 | if (!dev->msi_enabled && !dev->msix_enabled) | 1844 | if (!dev->msi_enabled && !dev->msix_enabled && dev->irq != 0) |
1845 | enable_irq(dev->irq); | 1845 | enable_irq(dev->irq); |
1846 | 1846 | ||
1847 | return r; | 1847 | return r; |
@@ -2042,7 +2042,7 @@ static int __devinit pci_init(void) | |||
2042 | return 0; | 2042 | return 0; |
2043 | } | 2043 | } |
2044 | 2044 | ||
2045 | static int __devinit pci_setup(char *str) | 2045 | static int __init pci_setup(char *str) |
2046 | { | 2046 | { |
2047 | while (str) { | 2047 | while (str) { |
2048 | char *k = strchr(str, ','); | 2048 | char *k = strchr(str, ','); |
diff --git a/drivers/pci/pcie/aer/aerdrv_core.c b/drivers/pci/pcie/aer/aerdrv_core.c index dfc63d01f20a..aac7006949f1 100644 --- a/drivers/pci/pcie/aer/aerdrv_core.c +++ b/drivers/pci/pcie/aer/aerdrv_core.c | |||
@@ -252,7 +252,7 @@ static void report_resume(struct pci_dev *dev, void *data) | |||
252 | 252 | ||
253 | if (!dev->driver || | 253 | if (!dev->driver || |
254 | !dev->driver->err_handler || | 254 | !dev->driver->err_handler || |
255 | !dev->driver->err_handler->slot_reset) | 255 | !dev->driver->err_handler->resume) |
256 | return; | 256 | return; |
257 | 257 | ||
258 | err_handler = dev->driver->err_handler; | 258 | err_handler = dev->driver->err_handler; |
diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c index 8f63f4c6b85f..9aad608bcf3f 100644 --- a/drivers/pci/pcie/aspm.c +++ b/drivers/pci/pcie/aspm.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/pm.h> | 16 | #include <linux/pm.h> |
17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
18 | #include <linux/slab.h> | 18 | #include <linux/slab.h> |
19 | #include <linux/jiffies.h> | ||
19 | #include <linux/pci-aspm.h> | 20 | #include <linux/pci-aspm.h> |
20 | #include "../pci.h" | 21 | #include "../pci.h" |
21 | 22 | ||
@@ -161,11 +162,12 @@ static void pcie_check_clock_pm(struct pci_dev *pdev) | |||
161 | */ | 162 | */ |
162 | static void pcie_aspm_configure_common_clock(struct pci_dev *pdev) | 163 | static void pcie_aspm_configure_common_clock(struct pci_dev *pdev) |
163 | { | 164 | { |
164 | int pos, child_pos; | 165 | int pos, child_pos, i = 0; |
165 | u16 reg16 = 0; | 166 | u16 reg16 = 0; |
166 | struct pci_dev *child_dev; | 167 | struct pci_dev *child_dev; |
167 | int same_clock = 1; | 168 | int same_clock = 1; |
168 | 169 | unsigned long start_jiffies; | |
170 | u16 child_regs[8], parent_reg; | ||
169 | /* | 171 | /* |
170 | * all functions of a slot should have the same Slot Clock | 172 | * all functions of a slot should have the same Slot Clock |
171 | * Configuration, so just check one function | 173 | * Configuration, so just check one function |
@@ -191,16 +193,19 @@ static void pcie_aspm_configure_common_clock(struct pci_dev *pdev) | |||
191 | child_pos = pci_find_capability(child_dev, PCI_CAP_ID_EXP); | 193 | child_pos = pci_find_capability(child_dev, PCI_CAP_ID_EXP); |
192 | pci_read_config_word(child_dev, child_pos + PCI_EXP_LNKCTL, | 194 | pci_read_config_word(child_dev, child_pos + PCI_EXP_LNKCTL, |
193 | ®16); | 195 | ®16); |
196 | child_regs[i] = reg16; | ||
194 | if (same_clock) | 197 | if (same_clock) |
195 | reg16 |= PCI_EXP_LNKCTL_CCC; | 198 | reg16 |= PCI_EXP_LNKCTL_CCC; |
196 | else | 199 | else |
197 | reg16 &= ~PCI_EXP_LNKCTL_CCC; | 200 | reg16 &= ~PCI_EXP_LNKCTL_CCC; |
198 | pci_write_config_word(child_dev, child_pos + PCI_EXP_LNKCTL, | 201 | pci_write_config_word(child_dev, child_pos + PCI_EXP_LNKCTL, |
199 | reg16); | 202 | reg16); |
203 | i++; | ||
200 | } | 204 | } |
201 | 205 | ||
202 | /* Configure upstream component */ | 206 | /* Configure upstream component */ |
203 | pci_read_config_word(pdev, pos + PCI_EXP_LNKCTL, ®16); | 207 | pci_read_config_word(pdev, pos + PCI_EXP_LNKCTL, ®16); |
208 | parent_reg = reg16; | ||
204 | if (same_clock) | 209 | if (same_clock) |
205 | reg16 |= PCI_EXP_LNKCTL_CCC; | 210 | reg16 |= PCI_EXP_LNKCTL_CCC; |
206 | else | 211 | else |
@@ -212,12 +217,30 @@ static void pcie_aspm_configure_common_clock(struct pci_dev *pdev) | |||
212 | pci_write_config_word(pdev, pos + PCI_EXP_LNKCTL, reg16); | 217 | pci_write_config_word(pdev, pos + PCI_EXP_LNKCTL, reg16); |
213 | 218 | ||
214 | /* Wait for link training end */ | 219 | /* Wait for link training end */ |
215 | while (1) { | 220 | /* break out after waiting for 1 second */ |
221 | start_jiffies = jiffies; | ||
222 | while ((jiffies - start_jiffies) < HZ) { | ||
216 | pci_read_config_word(pdev, pos + PCI_EXP_LNKSTA, ®16); | 223 | pci_read_config_word(pdev, pos + PCI_EXP_LNKSTA, ®16); |
217 | if (!(reg16 & PCI_EXP_LNKSTA_LT)) | 224 | if (!(reg16 & PCI_EXP_LNKSTA_LT)) |
218 | break; | 225 | break; |
219 | cpu_relax(); | 226 | cpu_relax(); |
220 | } | 227 | } |
228 | /* training failed -> recover */ | ||
229 | if ((jiffies - start_jiffies) >= HZ) { | ||
230 | dev_printk (KERN_ERR, &pdev->dev, "ASPM: Could not configure" | ||
231 | " common clock\n"); | ||
232 | i = 0; | ||
233 | list_for_each_entry(child_dev, &pdev->subordinate->devices, | ||
234 | bus_list) { | ||
235 | child_pos = pci_find_capability(child_dev, | ||
236 | PCI_CAP_ID_EXP); | ||
237 | pci_write_config_word(child_dev, | ||
238 | child_pos + PCI_EXP_LNKCTL, | ||
239 | child_regs[i]); | ||
240 | i++; | ||
241 | } | ||
242 | pci_write_config_word(pdev, pos + PCI_EXP_LNKCTL, parent_reg); | ||
243 | } | ||
221 | } | 244 | } |
222 | 245 | ||
223 | /* | 246 | /* |
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 5049a47030ac..ce0985615133 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/delay.h> | 22 | #include <linux/delay.h> |
23 | #include <linux/acpi.h> | 23 | #include <linux/acpi.h> |
24 | #include <linux/kallsyms.h> | 24 | #include <linux/kallsyms.h> |
25 | #include <linux/dmi.h> | ||
25 | #include "pci.h" | 26 | #include "pci.h" |
26 | 27 | ||
27 | int isa_dma_bridge_buggy; | 28 | int isa_dma_bridge_buggy; |
@@ -605,27 +606,6 @@ static void __init quirk_ioapic_rmw(struct pci_dev *dev) | |||
605 | sis_apic_bug = 1; | 606 | sis_apic_bug = 1; |
606 | } | 607 | } |
607 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SI, PCI_ANY_ID, quirk_ioapic_rmw); | 608 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SI, PCI_ANY_ID, quirk_ioapic_rmw); |
608 | |||
609 | #define AMD8131_revA0 0x01 | ||
610 | #define AMD8131_revB0 0x11 | ||
611 | #define AMD8131_MISC 0x40 | ||
612 | #define AMD8131_NIOAMODE_BIT 0 | ||
613 | static void quirk_amd_8131_ioapic(struct pci_dev *dev) | ||
614 | { | ||
615 | unsigned char tmp; | ||
616 | |||
617 | if (nr_ioapics == 0) | ||
618 | return; | ||
619 | |||
620 | if (dev->revision == AMD8131_revA0 || dev->revision == AMD8131_revB0) { | ||
621 | dev_info(&dev->dev, "Fixing up AMD8131 IOAPIC mode\n"); | ||
622 | pci_read_config_byte( dev, AMD8131_MISC, &tmp); | ||
623 | tmp &= ~(1 << AMD8131_NIOAMODE_BIT); | ||
624 | pci_write_config_byte( dev, AMD8131_MISC, tmp); | ||
625 | } | ||
626 | } | ||
627 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8131_BRIDGE, quirk_amd_8131_ioapic); | ||
628 | DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8131_BRIDGE, quirk_amd_8131_ioapic); | ||
629 | #endif /* CONFIG_X86_IO_APIC */ | 609 | #endif /* CONFIG_X86_IO_APIC */ |
630 | 610 | ||
631 | /* | 611 | /* |
@@ -1422,6 +1402,155 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2609, quirk_intel_pcie_pm); | |||
1422 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260a, quirk_intel_pcie_pm); | 1402 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260a, quirk_intel_pcie_pm); |
1423 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260b, quirk_intel_pcie_pm); | 1403 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260b, quirk_intel_pcie_pm); |
1424 | 1404 | ||
1405 | #ifdef CONFIG_X86_IO_APIC | ||
1406 | /* | ||
1407 | * Boot interrupts on some chipsets cannot be turned off. For these chipsets, | ||
1408 | * remap the original interrupt in the linux kernel to the boot interrupt, so | ||
1409 | * that a PCI device's interrupt handler is installed on the boot interrupt | ||
1410 | * line instead. | ||
1411 | */ | ||
1412 | static void quirk_reroute_to_boot_interrupts_intel(struct pci_dev *dev) | ||
1413 | { | ||
1414 | if (noioapicquirk || noioapicreroute) | ||
1415 | return; | ||
1416 | |||
1417 | dev->irq_reroute_variant = INTEL_IRQ_REROUTE_VARIANT; | ||
1418 | |||
1419 | printk(KERN_INFO "PCI quirk: reroute interrupts for 0x%04x:0x%04x\n", | ||
1420 | dev->vendor, dev->device); | ||
1421 | return; | ||
1422 | } | ||
1423 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80333_0, quirk_reroute_to_boot_interrupts_intel); | ||
1424 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80333_1, quirk_reroute_to_boot_interrupts_intel); | ||
1425 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB2_0, quirk_reroute_to_boot_interrupts_intel); | ||
1426 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_0, quirk_reroute_to_boot_interrupts_intel); | ||
1427 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_1, quirk_reroute_to_boot_interrupts_intel); | ||
1428 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXHV, quirk_reroute_to_boot_interrupts_intel); | ||
1429 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80332_0, quirk_reroute_to_boot_interrupts_intel); | ||
1430 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80332_1, quirk_reroute_to_boot_interrupts_intel); | ||
1431 | DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80333_0, quirk_reroute_to_boot_interrupts_intel); | ||
1432 | DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80333_1, quirk_reroute_to_boot_interrupts_intel); | ||
1433 | DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB2_0, quirk_reroute_to_boot_interrupts_intel); | ||
1434 | DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_0, quirk_reroute_to_boot_interrupts_intel); | ||
1435 | DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_1, quirk_reroute_to_boot_interrupts_intel); | ||
1436 | DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXHV, quirk_reroute_to_boot_interrupts_intel); | ||
1437 | DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80332_0, quirk_reroute_to_boot_interrupts_intel); | ||
1438 | DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80332_1, quirk_reroute_to_boot_interrupts_intel); | ||
1439 | |||
1440 | /* | ||
1441 | * On some chipsets we can disable the generation of legacy INTx boot | ||
1442 | * interrupts. | ||
1443 | */ | ||
1444 | |||
1445 | /* | ||
1446 | * IO-APIC1 on 6300ESB generates boot interrupts, see intel order no | ||
1447 | * 300641-004US, section 5.7.3. | ||
1448 | */ | ||
1449 | #define INTEL_6300_IOAPIC_ABAR 0x40 | ||
1450 | #define INTEL_6300_DISABLE_BOOT_IRQ (1<<14) | ||
1451 | |||
1452 | static void quirk_disable_intel_boot_interrupt(struct pci_dev *dev) | ||
1453 | { | ||
1454 | u16 pci_config_word; | ||
1455 | |||
1456 | if (noioapicquirk) | ||
1457 | return; | ||
1458 | |||
1459 | pci_read_config_word(dev, INTEL_6300_IOAPIC_ABAR, &pci_config_word); | ||
1460 | pci_config_word |= INTEL_6300_DISABLE_BOOT_IRQ; | ||
1461 | pci_write_config_word(dev, INTEL_6300_IOAPIC_ABAR, pci_config_word); | ||
1462 | |||
1463 | printk(KERN_INFO "disabled boot interrupt on device 0x%04x:0x%04x\n", | ||
1464 | dev->vendor, dev->device); | ||
1465 | } | ||
1466 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB_10, quirk_disable_intel_boot_interrupt); | ||
1467 | DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB_10, quirk_disable_intel_boot_interrupt); | ||
1468 | |||
1469 | /* | ||
1470 | * disable boot interrupts on HT-1000 | ||
1471 | */ | ||
1472 | #define BC_HT1000_FEATURE_REG 0x64 | ||
1473 | #define BC_HT1000_PIC_REGS_ENABLE (1<<0) | ||
1474 | #define BC_HT1000_MAP_IDX 0xC00 | ||
1475 | #define BC_HT1000_MAP_DATA 0xC01 | ||
1476 | |||
1477 | static void quirk_disable_broadcom_boot_interrupt(struct pci_dev *dev) | ||
1478 | { | ||
1479 | u32 pci_config_dword; | ||
1480 | u8 irq; | ||
1481 | |||
1482 | if (noioapicquirk) | ||
1483 | return; | ||
1484 | |||
1485 | pci_read_config_dword(dev, BC_HT1000_FEATURE_REG, &pci_config_dword); | ||
1486 | pci_write_config_dword(dev, BC_HT1000_FEATURE_REG, pci_config_dword | | ||
1487 | BC_HT1000_PIC_REGS_ENABLE); | ||
1488 | |||
1489 | for (irq = 0x10; irq < 0x10 + 32; irq++) { | ||
1490 | outb(irq, BC_HT1000_MAP_IDX); | ||
1491 | outb(0x00, BC_HT1000_MAP_DATA); | ||
1492 | } | ||
1493 | |||
1494 | pci_write_config_dword(dev, BC_HT1000_FEATURE_REG, pci_config_dword); | ||
1495 | |||
1496 | printk(KERN_INFO "disabled boot interrupts on PCI device" | ||
1497 | "0x%04x:0x%04x\n", dev->vendor, dev->device); | ||
1498 | } | ||
1499 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_HT1000SB, quirk_disable_broadcom_boot_interrupt); | ||
1500 | DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_HT1000SB, quirk_disable_broadcom_boot_interrupt); | ||
1501 | |||
1502 | /* | ||
1503 | * disable boot interrupts on AMD and ATI chipsets | ||
1504 | */ | ||
1505 | /* | ||
1506 | * NOIOAMODE needs to be disabled to disable "boot interrupts". For AMD 8131 | ||
1507 | * rev. A0 and B0, NOIOAMODE needs to be disabled anyway to fix IO-APIC mode | ||
1508 | * (due to an erratum). | ||
1509 | */ | ||
1510 | #define AMD_813X_MISC 0x40 | ||
1511 | #define AMD_813X_NOIOAMODE (1<<0) | ||
1512 | |||
1513 | static void quirk_disable_amd_813x_boot_interrupt(struct pci_dev *dev) | ||
1514 | { | ||
1515 | u32 pci_config_dword; | ||
1516 | |||
1517 | if (noioapicquirk) | ||
1518 | return; | ||
1519 | |||
1520 | pci_read_config_dword(dev, AMD_813X_MISC, &pci_config_dword); | ||
1521 | pci_config_dword &= ~AMD_813X_NOIOAMODE; | ||
1522 | pci_write_config_dword(dev, AMD_813X_MISC, pci_config_dword); | ||
1523 | |||
1524 | printk(KERN_INFO "disabled boot interrupts on PCI device " | ||
1525 | "0x%04x:0x%04x\n", dev->vendor, dev->device); | ||
1526 | } | ||
1527 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8131_BRIDGE, quirk_disable_amd_813x_boot_interrupt); | ||
1528 | DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8132_BRIDGE, quirk_disable_amd_813x_boot_interrupt); | ||
1529 | |||
1530 | #define AMD_8111_PCI_IRQ_ROUTING 0x56 | ||
1531 | |||
1532 | static void quirk_disable_amd_8111_boot_interrupt(struct pci_dev *dev) | ||
1533 | { | ||
1534 | u16 pci_config_word; | ||
1535 | |||
1536 | if (noioapicquirk) | ||
1537 | return; | ||
1538 | |||
1539 | pci_read_config_word(dev, AMD_8111_PCI_IRQ_ROUTING, &pci_config_word); | ||
1540 | if (!pci_config_word) { | ||
1541 | printk(KERN_INFO "boot interrupts on PCI device 0x%04x:0x%04x " | ||
1542 | "already disabled\n", | ||
1543 | dev->vendor, dev->device); | ||
1544 | return; | ||
1545 | } | ||
1546 | pci_write_config_word(dev, AMD_8111_PCI_IRQ_ROUTING, 0); | ||
1547 | printk(KERN_INFO "disabled boot interrupts on PCI device " | ||
1548 | "0x%04x:0x%04x\n", dev->vendor, dev->device); | ||
1549 | } | ||
1550 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8111_SMBUS, quirk_disable_amd_8111_boot_interrupt); | ||
1551 | DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8111_SMBUS, quirk_disable_amd_8111_boot_interrupt); | ||
1552 | #endif /* CONFIG_X86_IO_APIC */ | ||
1553 | |||
1425 | /* | 1554 | /* |
1426 | * Toshiba TC86C001 IDE controller reports the standard 8-byte BAR0 size | 1555 | * Toshiba TC86C001 IDE controller reports the standard 8-byte BAR0 size |
1427 | * but the PIO transfers won't work if BAR0 falls at the odd 8 bytes. | 1556 | * but the PIO transfers won't work if BAR0 falls at the odd 8 bytes. |
@@ -1828,6 +1957,22 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SERVERWORKS, | |||
1828 | PCI_DEVICE_ID_SERVERWORKS_HT1000_PXB, | 1957 | PCI_DEVICE_ID_SERVERWORKS_HT1000_PXB, |
1829 | ht_enable_msi_mapping); | 1958 | ht_enable_msi_mapping); |
1830 | 1959 | ||
1960 | /* The P5N32-SLI Premium motherboard from Asus has a problem with msi | ||
1961 | * for the MCP55 NIC. It is not yet determined whether the msi problem | ||
1962 | * also affects other devices. As for now, turn off msi for this device. | ||
1963 | */ | ||
1964 | static void __devinit nvenet_msi_disable(struct pci_dev *dev) | ||
1965 | { | ||
1966 | if (dmi_name_in_vendors("P5N32-SLI PREMIUM")) { | ||
1967 | dev_info(&dev->dev, | ||
1968 | "Disabling msi for MCP55 NIC on P5N32-SLI Premium\n"); | ||
1969 | dev->no_msi = 1; | ||
1970 | } | ||
1971 | } | ||
1972 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_NVIDIA, | ||
1973 | PCI_DEVICE_ID_NVIDIA_NVENET_15, | ||
1974 | nvenet_msi_disable); | ||
1975 | |||
1831 | static void __devinit nv_msi_ht_cap_quirk(struct pci_dev *dev) | 1976 | static void __devinit nv_msi_ht_cap_quirk(struct pci_dev *dev) |
1832 | { | 1977 | { |
1833 | struct pci_dev *host_bridge; | 1978 | struct pci_dev *host_bridge; |
diff --git a/drivers/pci/slot.c b/drivers/pci/slot.c index 4dd1c3e157ae..5a8ccb4f604d 100644 --- a/drivers/pci/slot.c +++ b/drivers/pci/slot.c | |||
@@ -253,6 +253,7 @@ placeholder: | |||
253 | __func__, pci_domain_nr(parent), parent->number, slot_nr); | 253 | __func__, pci_domain_nr(parent), parent->number, slot_nr); |
254 | 254 | ||
255 | out: | 255 | out: |
256 | kfree(slot_name); | ||
256 | up_write(&pci_bus_sem); | 257 | up_write(&pci_bus_sem); |
257 | return slot; | 258 | return slot; |
258 | err: | 259 | err: |