diff options
36 files changed, 259 insertions, 187 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 50aa81f2ffc4..47ae4a751a59 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
| @@ -1934,13 +1934,19 @@ config PCI_MMCONFIG | |||
| 1934 | depends on X86_64 && PCI && ACPI | 1934 | depends on X86_64 && PCI && ACPI |
| 1935 | 1935 | ||
| 1936 | config PCI_CNB20LE_QUIRK | 1936 | config PCI_CNB20LE_QUIRK |
| 1937 | bool "Read CNB20LE Host Bridge Windows" | 1937 | bool "Read CNB20LE Host Bridge Windows" if EMBEDDED |
| 1938 | depends on PCI | 1938 | default n |
| 1939 | depends on PCI && EXPERIMENTAL | ||
| 1939 | help | 1940 | help |
| 1940 | Read the PCI windows out of the CNB20LE host bridge. This allows | 1941 | Read the PCI windows out of the CNB20LE host bridge. This allows |
| 1941 | PCI hotplug to work on systems with the CNB20LE chipset which do | 1942 | PCI hotplug to work on systems with the CNB20LE chipset which do |
| 1942 | not have ACPI. | 1943 | not have ACPI. |
| 1943 | 1944 | ||
| 1945 | There's no public spec for this chipset, and this functionality | ||
| 1946 | is known to be incomplete. | ||
| 1947 | |||
| 1948 | You should say N unless you know you need this. | ||
| 1949 | |||
| 1944 | config DMAR | 1950 | config DMAR |
| 1945 | bool "Support for DMA Remapping Devices (EXPERIMENTAL)" | 1951 | bool "Support for DMA Remapping Devices (EXPERIMENTAL)" |
| 1946 | depends on PCI_MSI && ACPI && EXPERIMENTAL | 1952 | depends on PCI_MSI && ACPI && EXPERIMENTAL |
diff --git a/arch/x86/pci/broadcom_bus.c b/arch/x86/pci/broadcom_bus.c index 0846a5bbbfbd..ab8269b0da29 100644 --- a/arch/x86/pci/broadcom_bus.c +++ b/arch/x86/pci/broadcom_bus.c | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | * option) any later version. | 9 | * option) any later version. |
| 10 | */ | 10 | */ |
| 11 | 11 | ||
| 12 | #include <linux/acpi.h> | ||
| 12 | #include <linux/delay.h> | 13 | #include <linux/delay.h> |
| 13 | #include <linux/dmi.h> | 14 | #include <linux/dmi.h> |
| 14 | #include <linux/pci.h> | 15 | #include <linux/pci.h> |
| @@ -25,12 +26,14 @@ static void __devinit cnb20le_res(struct pci_dev *dev) | |||
| 25 | u8 fbus, lbus; | 26 | u8 fbus, lbus; |
| 26 | int i; | 27 | int i; |
| 27 | 28 | ||
| 29 | #ifdef CONFIG_ACPI | ||
| 28 | /* | 30 | /* |
| 29 | * The x86_pci_root_bus_res_quirks() function already refuses to use | 31 | * We should get host bridge information from ACPI unless the BIOS |
| 30 | * this information if ACPI _CRS was used. Therefore, we don't bother | 32 | * doesn't support it. |
| 31 | * checking if ACPI is enabled, and just generate the information | ||
| 32 | * for both the ACPI _CRS and no ACPI cases. | ||
| 33 | */ | 33 | */ |
| 34 | if (acpi_os_get_root_pointer()) | ||
| 35 | return; | ||
| 36 | #endif | ||
| 34 | 37 | ||
| 35 | info = &pci_root_info[pci_root_num]; | 38 | info = &pci_root_info[pci_root_num]; |
| 36 | pci_root_num++; | 39 | pci_root_num++; |
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c index f7c8a399978c..5fe75026ecc2 100644 --- a/arch/x86/pci/common.c +++ b/arch/x86/pci/common.c | |||
| @@ -22,6 +22,7 @@ unsigned int pci_probe = PCI_PROBE_BIOS | PCI_PROBE_CONF1 | PCI_PROBE_CONF2 | | |||
| 22 | 22 | ||
| 23 | unsigned int pci_early_dump_regs; | 23 | unsigned int pci_early_dump_regs; |
| 24 | static int pci_bf_sort; | 24 | static int pci_bf_sort; |
| 25 | static int smbios_type_b1_flag; | ||
| 25 | int pci_routeirq; | 26 | int pci_routeirq; |
| 26 | int noioapicquirk; | 27 | int noioapicquirk; |
| 27 | #ifdef CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS | 28 | #ifdef CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS |
| @@ -185,6 +186,39 @@ static int __devinit set_bf_sort(const struct dmi_system_id *d) | |||
| 185 | return 0; | 186 | return 0; |
| 186 | } | 187 | } |
| 187 | 188 | ||
| 189 | static void __devinit read_dmi_type_b1(const struct dmi_header *dm, | ||
| 190 | void *private_data) | ||
| 191 | { | ||
| 192 | u8 *d = (u8 *)dm + 4; | ||
| 193 | |||
| 194 | if (dm->type != 0xB1) | ||
| 195 | return; | ||
| 196 | switch (((*(u32 *)d) >> 9) & 0x03) { | ||
| 197 | case 0x00: | ||
| 198 | printk(KERN_INFO "dmi type 0xB1 record - unknown flag\n"); | ||
| 199 | break; | ||
| 200 | case 0x01: /* set pci=bfsort */ | ||
| 201 | smbios_type_b1_flag = 1; | ||
| 202 | break; | ||
| 203 | case 0x02: /* do not set pci=bfsort */ | ||
| 204 | smbios_type_b1_flag = 2; | ||
| 205 | break; | ||
| 206 | default: | ||
| 207 | break; | ||
| 208 | } | ||
| 209 | } | ||
| 210 | |||
| 211 | static int __devinit find_sort_method(const struct dmi_system_id *d) | ||
| 212 | { | ||
| 213 | dmi_walk(read_dmi_type_b1, NULL); | ||
| 214 | |||
| 215 | if (smbios_type_b1_flag == 1) { | ||
| 216 | set_bf_sort(d); | ||
| 217 | return 0; | ||
| 218 | } | ||
| 219 | return -1; | ||
| 220 | } | ||
| 221 | |||
| 188 | /* | 222 | /* |
| 189 | * Enable renumbering of PCI bus# ranges to reach all PCI busses (Cardbus) | 223 | * Enable renumbering of PCI bus# ranges to reach all PCI busses (Cardbus) |
| 190 | */ | 224 | */ |
| @@ -213,6 +247,13 @@ static const struct dmi_system_id __devinitconst pciprobe_dmi_table[] = { | |||
| 213 | }, | 247 | }, |
| 214 | #endif /* __i386__ */ | 248 | #endif /* __i386__ */ |
| 215 | { | 249 | { |
| 250 | .callback = find_sort_method, | ||
| 251 | .ident = "Dell System", | ||
| 252 | .matches = { | ||
| 253 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"), | ||
| 254 | }, | ||
| 255 | }, | ||
| 256 | { | ||
| 216 | .callback = set_bf_sort, | 257 | .callback = set_bf_sort, |
| 217 | .ident = "Dell PowerEdge 1950", | 258 | .ident = "Dell PowerEdge 1950", |
| 218 | .matches = { | 259 | .matches = { |
diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c index 9f9bfb705cf9..87e6c8323117 100644 --- a/arch/x86/pci/irq.c +++ b/arch/x86/pci/irq.c | |||
| @@ -589,7 +589,8 @@ static __init int intel_router_probe(struct irq_router *r, struct pci_dev *route | |||
| 589 | case PCI_DEVICE_ID_INTEL_ICH10_1: | 589 | case PCI_DEVICE_ID_INTEL_ICH10_1: |
| 590 | case PCI_DEVICE_ID_INTEL_ICH10_2: | 590 | case PCI_DEVICE_ID_INTEL_ICH10_2: |
| 591 | case PCI_DEVICE_ID_INTEL_ICH10_3: | 591 | case PCI_DEVICE_ID_INTEL_ICH10_3: |
| 592 | case PCI_DEVICE_ID_INTEL_PATSBURG_LPC: | 592 | case PCI_DEVICE_ID_INTEL_PATSBURG_LPC_0: |
| 593 | case PCI_DEVICE_ID_INTEL_PATSBURG_LPC_1: | ||
| 593 | r->name = "PIIX/ICH"; | 594 | r->name = "PIIX/ICH"; |
| 594 | r->get = pirq_piix_get; | 595 | r->get = pirq_piix_get; |
| 595 | r->set = pirq_piix_set; | 596 | r->set = pirq_piix_set; |
diff --git a/drivers/acpi/apei/hest.c b/drivers/acpi/apei/hest.c index daa7bc63f1d4..4ee58e72b730 100644 --- a/drivers/acpi/apei/hest.c +++ b/drivers/acpi/apei/hest.c | |||
| @@ -195,24 +195,24 @@ static int __init setup_hest_disable(char *str) | |||
| 195 | 195 | ||
| 196 | __setup("hest_disable", setup_hest_disable); | 196 | __setup("hest_disable", setup_hest_disable); |
| 197 | 197 | ||
| 198 | static int __init hest_init(void) | 198 | void __init acpi_hest_init(void) |
| 199 | { | 199 | { |
| 200 | acpi_status status; | 200 | acpi_status status; |
| 201 | int rc = -ENODEV; | 201 | int rc = -ENODEV; |
| 202 | unsigned int ghes_count = 0; | 202 | unsigned int ghes_count = 0; |
| 203 | 203 | ||
| 204 | if (acpi_disabled) | 204 | if (acpi_disabled) |
| 205 | goto err; | 205 | return; |
| 206 | 206 | ||
| 207 | if (hest_disable) { | 207 | if (hest_disable) { |
| 208 | pr_info(HEST_PFX "HEST tabling parsing is disabled.\n"); | 208 | pr_info(HEST_PFX "Table parsing disabled.\n"); |
| 209 | goto err; | 209 | return; |
| 210 | } | 210 | } |
| 211 | 211 | ||
| 212 | status = acpi_get_table(ACPI_SIG_HEST, 0, | 212 | status = acpi_get_table(ACPI_SIG_HEST, 0, |
| 213 | (struct acpi_table_header **)&hest_tab); | 213 | (struct acpi_table_header **)&hest_tab); |
| 214 | if (status == AE_NOT_FOUND) { | 214 | if (status == AE_NOT_FOUND) { |
| 215 | pr_info(HEST_PFX "Table is not found!\n"); | 215 | pr_info(HEST_PFX "Table not found.\n"); |
| 216 | goto err; | 216 | goto err; |
| 217 | } else if (ACPI_FAILURE(status)) { | 217 | } else if (ACPI_FAILURE(status)) { |
| 218 | const char *msg = acpi_format_exception(status); | 218 | const char *msg = acpi_format_exception(status); |
| @@ -226,15 +226,11 @@ static int __init hest_init(void) | |||
| 226 | goto err; | 226 | goto err; |
| 227 | 227 | ||
| 228 | rc = hest_ghes_dev_register(ghes_count); | 228 | rc = hest_ghes_dev_register(ghes_count); |
| 229 | if (rc) | 229 | if (!rc) { |
| 230 | goto err; | 230 | pr_info(HEST_PFX "Table parsing has been initialized.\n"); |
| 231 | 231 | return; | |
| 232 | pr_info(HEST_PFX "HEST table parsing is initialized.\n"); | 232 | } |
| 233 | 233 | ||
| 234 | return 0; | ||
| 235 | err: | 234 | err: |
| 236 | hest_disable = 1; | 235 | hest_disable = 1; |
| 237 | return rc; | ||
| 238 | } | 236 | } |
| 239 | |||
| 240 | subsys_initcall(hest_init); | ||
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index 96668ad09622..d9766797cd98 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c | |||
| @@ -36,6 +36,7 @@ | |||
| 36 | #include <linux/slab.h> | 36 | #include <linux/slab.h> |
| 37 | #include <acpi/acpi_bus.h> | 37 | #include <acpi/acpi_bus.h> |
| 38 | #include <acpi/acpi_drivers.h> | 38 | #include <acpi/acpi_drivers.h> |
| 39 | #include <acpi/apei.h> | ||
| 39 | 40 | ||
| 40 | #define PREFIX "ACPI: " | 41 | #define PREFIX "ACPI: " |
| 41 | 42 | ||
| @@ -47,6 +48,11 @@ static int acpi_pci_root_add(struct acpi_device *device); | |||
| 47 | static int acpi_pci_root_remove(struct acpi_device *device, int type); | 48 | static int acpi_pci_root_remove(struct acpi_device *device, int type); |
| 48 | static int acpi_pci_root_start(struct acpi_device *device); | 49 | static int acpi_pci_root_start(struct acpi_device *device); |
| 49 | 50 | ||
| 51 | #define ACPI_PCIE_REQ_SUPPORT (OSC_EXT_PCI_CONFIG_SUPPORT \ | ||
| 52 | | OSC_ACTIVE_STATE_PWR_SUPPORT \ | ||
| 53 | | OSC_CLOCK_PWR_CAPABILITY_SUPPORT \ | ||
| 54 | | OSC_MSI_SUPPORT) | ||
| 55 | |||
| 50 | static const struct acpi_device_id root_device_ids[] = { | 56 | static const struct acpi_device_id root_device_ids[] = { |
| 51 | {"PNP0A03", 0}, | 57 | {"PNP0A03", 0}, |
| 52 | {"", 0}, | 58 | {"", 0}, |
| @@ -566,6 +572,33 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device) | |||
| 566 | if (flags != base_flags) | 572 | if (flags != base_flags) |
| 567 | acpi_pci_osc_support(root, flags); | 573 | acpi_pci_osc_support(root, flags); |
| 568 | 574 | ||
| 575 | if (!pcie_ports_disabled | ||
| 576 | && (flags & ACPI_PCIE_REQ_SUPPORT) == ACPI_PCIE_REQ_SUPPORT) { | ||
| 577 | flags = OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL | ||
| 578 | | OSC_PCI_EXPRESS_NATIVE_HP_CONTROL | ||
| 579 | | OSC_PCI_EXPRESS_PME_CONTROL; | ||
| 580 | |||
| 581 | if (pci_aer_available()) { | ||
| 582 | if (aer_acpi_firmware_first()) | ||
| 583 | dev_dbg(root->bus->bridge, | ||
| 584 | "PCIe errors handled by BIOS.\n"); | ||
| 585 | else | ||
| 586 | flags |= OSC_PCI_EXPRESS_AER_CONTROL; | ||
| 587 | } | ||
| 588 | |||
| 589 | dev_info(root->bus->bridge, | ||
| 590 | "Requesting ACPI _OSC control (0x%02x)\n", flags); | ||
| 591 | |||
| 592 | status = acpi_pci_osc_control_set(device->handle, &flags, | ||
| 593 | OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL); | ||
| 594 | if (ACPI_SUCCESS(status)) | ||
| 595 | dev_info(root->bus->bridge, | ||
| 596 | "ACPI _OSC control (0x%02x) granted\n", flags); | ||
| 597 | else | ||
| 598 | dev_dbg(root->bus->bridge, | ||
| 599 | "ACPI _OSC request failed (code %d)\n", status); | ||
| 600 | } | ||
| 601 | |||
| 569 | pci_acpi_add_bus_pm_notifier(device, root->bus); | 602 | pci_acpi_add_bus_pm_notifier(device, root->bus); |
| 570 | if (device->wakeup.flags.run_wake) | 603 | if (device->wakeup.flags.run_wake) |
| 571 | device_set_run_wake(root->bus->bridge, true); | 604 | device_set_run_wake(root->bus->bridge, true); |
| @@ -603,6 +636,8 @@ static int __init acpi_pci_root_init(void) | |||
| 603 | if (acpi_pci_disabled) | 636 | if (acpi_pci_disabled) |
| 604 | return 0; | 637 | return 0; |
| 605 | 638 | ||
| 639 | acpi_hest_init(); | ||
| 640 | |||
| 606 | pci_acpi_crs_quirks(); | 641 | pci_acpi_crs_quirks(); |
| 607 | if (acpi_bus_register_driver(&acpi_pci_root_driver) < 0) | 642 | if (acpi_bus_register_driver(&acpi_pci_root_driver) < 0) |
| 608 | return -ENODEV; | 643 | return -ENODEV; |
diff --git a/drivers/media/video/cafe_ccic.c b/drivers/media/video/cafe_ccic.c index 789087cd6a9c..49f1b8f1418e 100644 --- a/drivers/media/video/cafe_ccic.c +++ b/drivers/media/video/cafe_ccic.c | |||
| @@ -2184,9 +2184,7 @@ static int cafe_pci_resume(struct pci_dev *pdev) | |||
| 2184 | struct cafe_camera *cam = to_cam(v4l2_dev); | 2184 | struct cafe_camera *cam = to_cam(v4l2_dev); |
| 2185 | int ret = 0; | 2185 | int ret = 0; |
| 2186 | 2186 | ||
| 2187 | ret = pci_restore_state(pdev); | 2187 | pci_restore_state(pdev); |
| 2188 | if (ret) | ||
| 2189 | return ret; | ||
| 2190 | ret = pci_enable_device(pdev); | 2188 | ret = pci_enable_device(pdev); |
| 2191 | 2189 | ||
| 2192 | if (ret) { | 2190 | if (ret) { |
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index a37fcf11ab36..ea5cfe2c3a04 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
| @@ -3403,9 +3403,7 @@ static int myri10ge_resume(struct pci_dev *pdev) | |||
| 3403 | return -EIO; | 3403 | return -EIO; |
| 3404 | } | 3404 | } |
| 3405 | 3405 | ||
| 3406 | status = pci_restore_state(pdev); | 3406 | pci_restore_state(pdev); |
| 3407 | if (status) | ||
| 3408 | return status; | ||
| 3409 | 3407 | ||
| 3410 | status = pci_enable_device(pdev); | 3408 | status = pci_enable_device(pdev); |
| 3411 | if (status) { | 3409 | if (status) { |
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c index 70e4f7dcce81..61ddd2c6e750 100644 --- a/drivers/net/sfc/falcon.c +++ b/drivers/net/sfc/falcon.c | |||
| @@ -1107,22 +1107,9 @@ static int __falcon_reset_hw(struct efx_nic *efx, enum reset_type method) | |||
| 1107 | 1107 | ||
| 1108 | /* Restore PCI configuration if needed */ | 1108 | /* Restore PCI configuration if needed */ |
| 1109 | if (method == RESET_TYPE_WORLD) { | 1109 | if (method == RESET_TYPE_WORLD) { |
| 1110 | if (efx_nic_is_dual_func(efx)) { | 1110 | if (efx_nic_is_dual_func(efx)) |
| 1111 | rc = pci_restore_state(nic_data->pci_dev2); | 1111 | pci_restore_state(nic_data->pci_dev2); |
| 1112 | if (rc) { | 1112 | pci_restore_state(efx->pci_dev); |
| 1113 | netif_err(efx, drv, efx->net_dev, | ||
| 1114 | "failed to restore PCI config for " | ||
| 1115 | "the secondary function\n"); | ||
| 1116 | goto fail3; | ||
| 1117 | } | ||
| 1118 | } | ||
| 1119 | rc = pci_restore_state(efx->pci_dev); | ||
| 1120 | if (rc) { | ||
| 1121 | netif_err(efx, drv, efx->net_dev, | ||
| 1122 | "failed to restore PCI config for the " | ||
| 1123 | "primary function\n"); | ||
| 1124 | goto fail4; | ||
| 1125 | } | ||
| 1126 | netif_dbg(efx, drv, efx->net_dev, | 1113 | netif_dbg(efx, drv, efx->net_dev, |
| 1127 | "successfully restored PCI config\n"); | 1114 | "successfully restored PCI config\n"); |
| 1128 | } | 1115 | } |
| @@ -1133,7 +1120,7 @@ static int __falcon_reset_hw(struct efx_nic *efx, enum reset_type method) | |||
| 1133 | rc = -ETIMEDOUT; | 1120 | rc = -ETIMEDOUT; |
| 1134 | netif_err(efx, hw, efx->net_dev, | 1121 | netif_err(efx, hw, efx->net_dev, |
| 1135 | "timed out waiting for hardware reset\n"); | 1122 | "timed out waiting for hardware reset\n"); |
| 1136 | goto fail5; | 1123 | goto fail3; |
| 1137 | } | 1124 | } |
| 1138 | netif_dbg(efx, hw, efx->net_dev, "hardware reset complete\n"); | 1125 | netif_dbg(efx, hw, efx->net_dev, "hardware reset complete\n"); |
| 1139 | 1126 | ||
| @@ -1141,11 +1128,9 @@ static int __falcon_reset_hw(struct efx_nic *efx, enum reset_type method) | |||
| 1141 | 1128 | ||
| 1142 | /* pci_save_state() and pci_restore_state() MUST be called in pairs */ | 1129 | /* pci_save_state() and pci_restore_state() MUST be called in pairs */ |
| 1143 | fail2: | 1130 | fail2: |
| 1144 | fail3: | ||
| 1145 | pci_restore_state(efx->pci_dev); | 1131 | pci_restore_state(efx->pci_dev); |
| 1146 | fail1: | 1132 | fail1: |
| 1147 | fail4: | 1133 | fail3: |
| 1148 | fail5: | ||
| 1149 | return rc; | 1134 | return rc; |
| 1150 | } | 1135 | } |
| 1151 | 1136 | ||
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c index 73631c6fbb30..ace0b668c04e 100644 --- a/drivers/net/wireless/rt2x00/rt2x00pci.c +++ b/drivers/net/wireless/rt2x00/rt2x00pci.c | |||
| @@ -363,12 +363,12 @@ int rt2x00pci_resume(struct pci_dev *pci_dev) | |||
| 363 | struct rt2x00_dev *rt2x00dev = hw->priv; | 363 | struct rt2x00_dev *rt2x00dev = hw->priv; |
| 364 | 364 | ||
| 365 | if (pci_set_power_state(pci_dev, PCI_D0) || | 365 | if (pci_set_power_state(pci_dev, PCI_D0) || |
| 366 | pci_enable_device(pci_dev) || | 366 | pci_enable_device(pci_dev)) { |
| 367 | pci_restore_state(pci_dev)) { | ||
| 368 | ERROR(rt2x00dev, "Failed to resume device.\n"); | 367 | ERROR(rt2x00dev, "Failed to resume device.\n"); |
| 369 | return -EIO; | 368 | return -EIO; |
| 370 | } | 369 | } |
| 371 | 370 | ||
| 371 | pci_restore_state(pci_dev); | ||
| 372 | return rt2x00lib_resume(rt2x00dev); | 372 | return rt2x00lib_resume(rt2x00dev); |
| 373 | } | 373 | } |
| 374 | EXPORT_SYMBOL_GPL(rt2x00pci_resume); | 374 | EXPORT_SYMBOL_GPL(rt2x00pci_resume); |
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 7c24dcef2989..44b0aeee83e5 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c | |||
| @@ -168,8 +168,9 @@ static u32 __msix_mask_irq(struct msi_desc *desc, u32 flag) | |||
| 168 | u32 mask_bits = desc->masked; | 168 | u32 mask_bits = desc->masked; |
| 169 | unsigned offset = desc->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE + | 169 | unsigned offset = desc->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE + |
| 170 | PCI_MSIX_ENTRY_VECTOR_CTRL; | 170 | PCI_MSIX_ENTRY_VECTOR_CTRL; |
| 171 | mask_bits &= ~1; | 171 | mask_bits &= ~PCI_MSIX_ENTRY_CTRL_MASKBIT; |
| 172 | mask_bits |= flag; | 172 | if (flag) |
| 173 | mask_bits |= PCI_MSIX_ENTRY_CTRL_MASKBIT; | ||
| 173 | writel(mask_bits, desc->mask_base + offset); | 174 | writel(mask_bits, desc->mask_base + offset); |
| 174 | 175 | ||
| 175 | return mask_bits; | 176 | return mask_bits; |
diff --git a/drivers/pci/msi.h b/drivers/pci/msi.h index feff3bee6fe5..65c42f80f23e 100644 --- a/drivers/pci/msi.h +++ b/drivers/pci/msi.h | |||
| @@ -6,12 +6,6 @@ | |||
| 6 | #ifndef MSI_H | 6 | #ifndef MSI_H |
| 7 | #define MSI_H | 7 | #define MSI_H |
| 8 | 8 | ||
| 9 | #define PCI_MSIX_ENTRY_SIZE 16 | ||
| 10 | #define PCI_MSIX_ENTRY_LOWER_ADDR 0 | ||
| 11 | #define PCI_MSIX_ENTRY_UPPER_ADDR 4 | ||
| 12 | #define PCI_MSIX_ENTRY_DATA 8 | ||
| 13 | #define PCI_MSIX_ENTRY_VECTOR_CTRL 12 | ||
| 14 | |||
| 15 | #define msi_control_reg(base) (base + PCI_MSI_FLAGS) | 9 | #define msi_control_reg(base) (base + PCI_MSI_FLAGS) |
| 16 | #define msi_lower_address_reg(base) (base + PCI_MSI_ADDRESS_LO) | 10 | #define msi_lower_address_reg(base) (base + PCI_MSI_ADDRESS_LO) |
| 17 | #define msi_upper_address_reg(base) (base + PCI_MSI_ADDRESS_HI) | 11 | #define msi_upper_address_reg(base) (base + PCI_MSI_ADDRESS_HI) |
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index 24e19c594e57..6fe0772e0e7d 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c | |||
| @@ -46,9 +46,9 @@ static void pci_acpi_wake_dev(acpi_handle handle, u32 event, void *context) | |||
| 46 | struct pci_dev *pci_dev = context; | 46 | struct pci_dev *pci_dev = context; |
| 47 | 47 | ||
| 48 | if (event == ACPI_NOTIFY_DEVICE_WAKE && pci_dev) { | 48 | if (event == ACPI_NOTIFY_DEVICE_WAKE && pci_dev) { |
| 49 | pci_wakeup_event(pci_dev); | ||
| 49 | pci_check_pme_status(pci_dev); | 50 | pci_check_pme_status(pci_dev); |
| 50 | pm_runtime_resume(&pci_dev->dev); | 51 | pm_runtime_resume(&pci_dev->dev); |
| 51 | pci_wakeup_event(pci_dev); | ||
| 52 | if (pci_dev->subordinate) | 52 | if (pci_dev->subordinate) |
| 53 | pci_pme_wakeup_bus(pci_dev->subordinate); | 53 | pci_pme_wakeup_bus(pci_dev->subordinate); |
| 54 | } | 54 | } |
| @@ -399,6 +399,7 @@ static int __init acpi_pci_init(void) | |||
| 399 | 399 | ||
| 400 | if (acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_ASPM) { | 400 | if (acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_ASPM) { |
| 401 | printk(KERN_INFO"ACPI FADT declares the system doesn't support PCIe ASPM, so disable it\n"); | 401 | printk(KERN_INFO"ACPI FADT declares the system doesn't support PCIe ASPM, so disable it\n"); |
| 402 | pcie_clear_aspm(); | ||
| 402 | pcie_no_aspm(); | 403 | pcie_no_aspm(); |
| 403 | } | 404 | } |
| 404 | 405 | ||
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index 8a6f797de8e5..88246dd46452 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c | |||
| @@ -338,7 +338,7 @@ static int pci_call_probe(struct pci_driver *drv, struct pci_dev *dev, | |||
| 338 | } | 338 | } |
| 339 | 339 | ||
| 340 | /** | 340 | /** |
| 341 | * __pci_device_probe() | 341 | * __pci_device_probe - check if a driver wants to claim a specific PCI device |
| 342 | * @drv: driver to call to check if it wants the PCI device | 342 | * @drv: driver to call to check if it wants the PCI device |
| 343 | * @pci_dev: PCI device being probed | 343 | * @pci_dev: PCI device being probed |
| 344 | * | 344 | * |
| @@ -449,7 +449,8 @@ static int pci_restore_standard_config(struct pci_dev *pci_dev) | |||
| 449 | return error; | 449 | return error; |
| 450 | } | 450 | } |
| 451 | 451 | ||
| 452 | return pci_restore_state(pci_dev); | 452 | pci_restore_state(pci_dev); |
| 453 | return 0; | ||
| 453 | } | 454 | } |
| 454 | 455 | ||
| 455 | static void pci_pm_default_resume_early(struct pci_dev *pci_dev) | 456 | static void pci_pm_default_resume_early(struct pci_dev *pci_dev) |
diff --git a/drivers/pci/pci-stub.c b/drivers/pci/pci-stub.c index f7b68ca6cc98..775e933c2225 100644 --- a/drivers/pci/pci-stub.c +++ b/drivers/pci/pci-stub.c | |||
| @@ -47,6 +47,10 @@ static int __init pci_stub_init(void) | |||
| 47 | if (rc) | 47 | if (rc) |
| 48 | return rc; | 48 | return rc; |
| 49 | 49 | ||
| 50 | /* no ids passed actually */ | ||
| 51 | if (ids[0] == '\0') | ||
| 52 | return 0; | ||
| 53 | |||
| 50 | /* add ids specified in the module parameter */ | 54 | /* add ids specified in the module parameter */ |
| 51 | p = ids; | 55 | p = ids; |
| 52 | while ((id = strsep(&p, ","))) { | 56 | while ((id = strsep(&p, ","))) { |
| @@ -54,6 +58,9 @@ static int __init pci_stub_init(void) | |||
| 54 | subdevice = PCI_ANY_ID, class=0, class_mask=0; | 58 | subdevice = PCI_ANY_ID, class=0, class_mask=0; |
| 55 | int fields; | 59 | int fields; |
| 56 | 60 | ||
| 61 | if (!strlen(id)) | ||
| 62 | continue; | ||
| 63 | |||
| 57 | fields = sscanf(id, "%x:%x:%x:%x:%x:%x", | 64 | fields = sscanf(id, "%x:%x:%x:%x:%x:%x", |
| 58 | &vendor, &device, &subvendor, &subdevice, | 65 | &vendor, &device, &subvendor, &subdevice, |
| 59 | &class, &class_mask); | 66 | &class, &class_mask); |
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index 63d5042f2079..8ecaac983923 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c | |||
| @@ -1149,7 +1149,7 @@ int __must_check pci_create_sysfs_dev_files (struct pci_dev *pdev) | |||
| 1149 | sysfs_bin_attr_init(attr); | 1149 | sysfs_bin_attr_init(attr); |
| 1150 | attr->size = rom_size; | 1150 | attr->size = rom_size; |
| 1151 | attr->attr.name = "rom"; | 1151 | attr->attr.name = "rom"; |
| 1152 | attr->attr.mode = S_IRUSR; | 1152 | attr->attr.mode = S_IRUSR | S_IWUSR; |
| 1153 | attr->read = pci_read_rom; | 1153 | attr->read = pci_read_rom; |
| 1154 | attr->write = pci_write_rom; | 1154 | attr->write = pci_write_rom; |
| 1155 | retval = sysfs_create_bin_file(&pdev->dev.kobj, attr); | 1155 | retval = sysfs_create_bin_file(&pdev->dev.kobj, attr); |
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 710c8a29be0d..b714d787bddd 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
| @@ -937,14 +937,13 @@ pci_save_state(struct pci_dev *dev) | |||
| 937 | * pci_restore_state - Restore the saved state of a PCI device | 937 | * pci_restore_state - Restore the saved state of a PCI device |
| 938 | * @dev: - PCI device that we're dealing with | 938 | * @dev: - PCI device that we're dealing with |
| 939 | */ | 939 | */ |
| 940 | int | 940 | void pci_restore_state(struct pci_dev *dev) |
| 941 | pci_restore_state(struct pci_dev *dev) | ||
| 942 | { | 941 | { |
| 943 | int i; | 942 | int i; |
| 944 | u32 val; | 943 | u32 val; |
| 945 | 944 | ||
| 946 | if (!dev->state_saved) | 945 | if (!dev->state_saved) |
| 947 | return 0; | 946 | return; |
| 948 | 947 | ||
| 949 | /* PCI Express register must be restored first */ | 948 | /* PCI Express register must be restored first */ |
| 950 | pci_restore_pcie_state(dev); | 949 | pci_restore_pcie_state(dev); |
| @@ -968,8 +967,6 @@ pci_restore_state(struct pci_dev *dev) | |||
| 968 | pci_restore_iov_state(dev); | 967 | pci_restore_iov_state(dev); |
| 969 | 968 | ||
| 970 | dev->state_saved = false; | 969 | dev->state_saved = false; |
| 971 | |||
| 972 | return 0; | ||
| 973 | } | 970 | } |
| 974 | 971 | ||
| 975 | static int do_pci_enable_device(struct pci_dev *dev, int bars) | 972 | static int do_pci_enable_device(struct pci_dev *dev, int bars) |
| @@ -1300,22 +1297,6 @@ bool pci_check_pme_status(struct pci_dev *dev) | |||
| 1300 | return ret; | 1297 | return ret; |
| 1301 | } | 1298 | } |
| 1302 | 1299 | ||
| 1303 | /* | ||
| 1304 | * Time to wait before the system can be put into a sleep state after reporting | ||
| 1305 | * a wakeup event signaled by a PCI device. | ||
| 1306 | */ | ||
| 1307 | #define PCI_WAKEUP_COOLDOWN 100 | ||
| 1308 | |||
| 1309 | /** | ||
| 1310 | * pci_wakeup_event - Report a wakeup event related to a given PCI device. | ||
| 1311 | * @dev: Device to report the wakeup event for. | ||
| 1312 | */ | ||
| 1313 | void pci_wakeup_event(struct pci_dev *dev) | ||
| 1314 | { | ||
| 1315 | if (device_may_wakeup(&dev->dev)) | ||
| 1316 | pm_wakeup_event(&dev->dev, PCI_WAKEUP_COOLDOWN); | ||
| 1317 | } | ||
| 1318 | |||
| 1319 | /** | 1300 | /** |
| 1320 | * pci_pme_wakeup - Wake up a PCI device if its PME Status bit is set. | 1301 | * pci_pme_wakeup - Wake up a PCI device if its PME Status bit is set. |
| 1321 | * @dev: Device to handle. | 1302 | * @dev: Device to handle. |
| @@ -1327,8 +1308,8 @@ void pci_wakeup_event(struct pci_dev *dev) | |||
| 1327 | static int pci_pme_wakeup(struct pci_dev *dev, void *ign) | 1308 | static int pci_pme_wakeup(struct pci_dev *dev, void *ign) |
| 1328 | { | 1309 | { |
| 1329 | if (pci_check_pme_status(dev)) { | 1310 | if (pci_check_pme_status(dev)) { |
| 1330 | pm_request_resume(&dev->dev); | ||
| 1331 | pci_wakeup_event(dev); | 1311 | pci_wakeup_event(dev); |
| 1312 | pm_request_resume(&dev->dev); | ||
| 1332 | } | 1313 | } |
| 1333 | return 0; | 1314 | return 0; |
| 1334 | } | 1315 | } |
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 7d33f6673868..f69d6e0fda75 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h | |||
| @@ -74,6 +74,12 @@ extern void pci_pm_init(struct pci_dev *dev); | |||
| 74 | extern void platform_pci_wakeup_init(struct pci_dev *dev); | 74 | extern void platform_pci_wakeup_init(struct pci_dev *dev); |
| 75 | extern void pci_allocate_cap_save_buffers(struct pci_dev *dev); | 75 | extern void pci_allocate_cap_save_buffers(struct pci_dev *dev); |
| 76 | 76 | ||
| 77 | static inline void pci_wakeup_event(struct pci_dev *dev) | ||
| 78 | { | ||
| 79 | /* Wait 100 ms before the system can be put into a sleep state. */ | ||
| 80 | pm_wakeup_event(&dev->dev, 100); | ||
| 81 | } | ||
| 82 | |||
| 77 | static inline bool pci_is_bridge(struct pci_dev *pci_dev) | 83 | static inline bool pci_is_bridge(struct pci_dev *pci_dev) |
| 78 | { | 84 | { |
| 79 | return !!(pci_dev->subordinate); | 85 | return !!(pci_dev->subordinate); |
| @@ -140,14 +146,6 @@ static inline void pci_no_msi(void) { } | |||
| 140 | static inline void pci_msi_init_pci_dev(struct pci_dev *dev) { } | 146 | static inline void pci_msi_init_pci_dev(struct pci_dev *dev) { } |
| 141 | #endif | 147 | #endif |
| 142 | 148 | ||
| 143 | #ifdef CONFIG_PCIEAER | ||
| 144 | void pci_no_aer(void); | ||
| 145 | bool pci_aer_available(void); | ||
| 146 | #else | ||
| 147 | static inline void pci_no_aer(void) { } | ||
| 148 | static inline bool pci_aer_available(void) { return false; } | ||
| 149 | #endif | ||
| 150 | |||
| 151 | static inline int pci_no_d1d2(struct pci_dev *dev) | 149 | static inline int pci_no_d1d2(struct pci_dev *dev) |
| 152 | { | 150 | { |
| 153 | unsigned int parent_dstates = 0; | 151 | unsigned int parent_dstates = 0; |
diff --git a/drivers/pci/pcie/aer/aerdrv.c b/drivers/pci/pcie/aer/aerdrv.c index 2b2b6508efde..58ad7917553c 100644 --- a/drivers/pci/pcie/aer/aerdrv.c +++ b/drivers/pci/pcie/aer/aerdrv.c | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | 17 | ||
| 18 | #include <linux/module.h> | 18 | #include <linux/module.h> |
| 19 | #include <linux/pci.h> | 19 | #include <linux/pci.h> |
| 20 | #include <linux/pci-acpi.h> | ||
| 20 | #include <linux/sched.h> | 21 | #include <linux/sched.h> |
| 21 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
| 22 | #include <linux/errno.h> | 23 | #include <linux/errno.h> |
diff --git a/drivers/pci/pcie/aer/aerdrv.h b/drivers/pci/pcie/aer/aerdrv.h index 9656e3060412..80c11d131499 100644 --- a/drivers/pci/pcie/aer/aerdrv.h +++ b/drivers/pci/pcie/aer/aerdrv.h | |||
| @@ -132,7 +132,6 @@ static inline int aer_osc_setup(struct pcie_device *pciedev) | |||
| 132 | 132 | ||
| 133 | #ifdef CONFIG_ACPI_APEI | 133 | #ifdef CONFIG_ACPI_APEI |
| 134 | extern int pcie_aer_get_firmware_first(struct pci_dev *pci_dev); | 134 | extern int pcie_aer_get_firmware_first(struct pci_dev *pci_dev); |
| 135 | extern bool aer_acpi_firmware_first(void); | ||
| 136 | #else | 135 | #else |
| 137 | static inline int pcie_aer_get_firmware_first(struct pci_dev *pci_dev) | 136 | static inline int pcie_aer_get_firmware_first(struct pci_dev *pci_dev) |
| 138 | { | 137 | { |
| @@ -140,8 +139,6 @@ static inline int pcie_aer_get_firmware_first(struct pci_dev *pci_dev) | |||
| 140 | return pci_dev->__aer_firmware_first; | 139 | return pci_dev->__aer_firmware_first; |
| 141 | return 0; | 140 | return 0; |
| 142 | } | 141 | } |
| 143 | |||
| 144 | static inline bool aer_acpi_firmware_first(void) { return false; } | ||
| 145 | #endif | 142 | #endif |
| 146 | 143 | ||
| 147 | static inline void pcie_aer_force_firmware_first(struct pci_dev *pci_dev, | 144 | static inline void pcie_aer_force_firmware_first(struct pci_dev *pci_dev, |
diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c index 71222814c1ec..3188cd96b338 100644 --- a/drivers/pci/pcie/aspm.c +++ b/drivers/pci/pcie/aspm.c | |||
| @@ -68,7 +68,7 @@ struct pcie_link_state { | |||
| 68 | struct aspm_latency acceptable[8]; | 68 | struct aspm_latency acceptable[8]; |
| 69 | }; | 69 | }; |
| 70 | 70 | ||
| 71 | static int aspm_disabled, aspm_force; | 71 | static int aspm_disabled, aspm_force, aspm_clear_state; |
| 72 | static DEFINE_MUTEX(aspm_lock); | 72 | static DEFINE_MUTEX(aspm_lock); |
| 73 | static LIST_HEAD(link_list); | 73 | static LIST_HEAD(link_list); |
| 74 | 74 | ||
| @@ -139,7 +139,7 @@ static void pcie_set_clkpm(struct pcie_link_state *link, int enable) | |||
| 139 | { | 139 | { |
| 140 | /* Don't enable Clock PM if the link is not Clock PM capable */ | 140 | /* Don't enable Clock PM if the link is not Clock PM capable */ |
| 141 | if (!link->clkpm_capable && enable) | 141 | if (!link->clkpm_capable && enable) |
| 142 | return; | 142 | enable = 0; |
| 143 | /* Need nothing if the specified equals to current state */ | 143 | /* Need nothing if the specified equals to current state */ |
| 144 | if (link->clkpm_enabled == enable) | 144 | if (link->clkpm_enabled == enable) |
| 145 | return; | 145 | return; |
| @@ -498,6 +498,10 @@ static int pcie_aspm_sanity_check(struct pci_dev *pdev) | |||
| 498 | struct pci_dev *child; | 498 | struct pci_dev *child; |
| 499 | int pos; | 499 | int pos; |
| 500 | u32 reg32; | 500 | u32 reg32; |
| 501 | |||
| 502 | if (aspm_clear_state) | ||
| 503 | return -EINVAL; | ||
| 504 | |||
| 501 | /* | 505 | /* |
| 502 | * Some functions in a slot might not all be PCIe functions, | 506 | * Some functions in a slot might not all be PCIe functions, |
| 503 | * very strange. Disable ASPM for the whole slot | 507 | * very strange. Disable ASPM for the whole slot |
| @@ -563,12 +567,15 @@ void pcie_aspm_init_link_state(struct pci_dev *pdev) | |||
| 563 | struct pcie_link_state *link; | 567 | struct pcie_link_state *link; |
| 564 | int blacklist = !!pcie_aspm_sanity_check(pdev); | 568 | int blacklist = !!pcie_aspm_sanity_check(pdev); |
| 565 | 569 | ||
| 566 | if (aspm_disabled || !pci_is_pcie(pdev) || pdev->link_state) | 570 | if (!pci_is_pcie(pdev) || pdev->link_state) |
| 567 | return; | 571 | return; |
| 568 | if (pdev->pcie_type != PCI_EXP_TYPE_ROOT_PORT && | 572 | if (pdev->pcie_type != PCI_EXP_TYPE_ROOT_PORT && |
| 569 | pdev->pcie_type != PCI_EXP_TYPE_DOWNSTREAM) | 573 | pdev->pcie_type != PCI_EXP_TYPE_DOWNSTREAM) |
| 570 | return; | 574 | return; |
| 571 | 575 | ||
| 576 | if (aspm_disabled && !aspm_clear_state) | ||
| 577 | return; | ||
| 578 | |||
| 572 | /* VIA has a strange chipset, root port is under a bridge */ | 579 | /* VIA has a strange chipset, root port is under a bridge */ |
| 573 | if (pdev->pcie_type == PCI_EXP_TYPE_ROOT_PORT && | 580 | if (pdev->pcie_type == PCI_EXP_TYPE_ROOT_PORT && |
| 574 | pdev->bus->self) | 581 | pdev->bus->self) |
| @@ -641,7 +648,7 @@ void pcie_aspm_exit_link_state(struct pci_dev *pdev) | |||
| 641 | struct pci_dev *parent = pdev->bus->self; | 648 | struct pci_dev *parent = pdev->bus->self; |
| 642 | struct pcie_link_state *link, *root, *parent_link; | 649 | struct pcie_link_state *link, *root, *parent_link; |
| 643 | 650 | ||
| 644 | if (aspm_disabled || !pci_is_pcie(pdev) || | 651 | if ((aspm_disabled && !aspm_clear_state) || !pci_is_pcie(pdev) || |
| 645 | !parent || !parent->link_state) | 652 | !parent || !parent->link_state) |
| 646 | return; | 653 | return; |
| 647 | if ((parent->pcie_type != PCI_EXP_TYPE_ROOT_PORT) && | 654 | if ((parent->pcie_type != PCI_EXP_TYPE_ROOT_PORT) && |
| @@ -899,6 +906,12 @@ static int __init pcie_aspm_disable(char *str) | |||
| 899 | 906 | ||
| 900 | __setup("pcie_aspm=", pcie_aspm_disable); | 907 | __setup("pcie_aspm=", pcie_aspm_disable); |
| 901 | 908 | ||
| 909 | void pcie_clear_aspm(void) | ||
| 910 | { | ||
| 911 | if (!aspm_force) | ||
| 912 | aspm_clear_state = 1; | ||
| 913 | } | ||
| 914 | |||
| 902 | void pcie_no_aspm(void) | 915 | void pcie_no_aspm(void) |
| 903 | { | 916 | { |
| 904 | if (!aspm_force) | 917 | if (!aspm_force) |
diff --git a/drivers/pci/pcie/pme.c b/drivers/pci/pcie/pme.c index 2f3c90407227..0057344a3fcb 100644 --- a/drivers/pci/pcie/pme.c +++ b/drivers/pci/pcie/pme.c | |||
| @@ -26,9 +26,6 @@ | |||
| 26 | #include "../pci.h" | 26 | #include "../pci.h" |
| 27 | #include "portdrv.h" | 27 | #include "portdrv.h" |
| 28 | 28 | ||
| 29 | #define PCI_EXP_RTSTA_PME 0x10000 /* PME status */ | ||
| 30 | #define PCI_EXP_RTSTA_PENDING 0x20000 /* PME pending */ | ||
| 31 | |||
| 32 | /* | 29 | /* |
| 33 | * If this switch is set, MSI will not be used for PCIe PME signaling. This | 30 | * If this switch is set, MSI will not be used for PCIe PME signaling. This |
| 34 | * causes the PCIe port driver to use INTx interrupts only, but it turns out | 31 | * causes the PCIe port driver to use INTx interrupts only, but it turns out |
| @@ -74,22 +71,6 @@ void pcie_pme_interrupt_enable(struct pci_dev *dev, bool enable) | |||
| 74 | } | 71 | } |
| 75 | 72 | ||
| 76 | /** | 73 | /** |
| 77 | * pcie_pme_clear_status - Clear root port PME interrupt status. | ||
| 78 | * @dev: PCIe root port or event collector. | ||
| 79 | */ | ||
| 80 | static void pcie_pme_clear_status(struct pci_dev *dev) | ||
| 81 | { | ||
| 82 | int rtsta_pos; | ||
| 83 | u32 rtsta; | ||
| 84 | |||
| 85 | rtsta_pos = pci_pcie_cap(dev) + PCI_EXP_RTSTA; | ||
| 86 | |||
| 87 | pci_read_config_dword(dev, rtsta_pos, &rtsta); | ||
| 88 | rtsta |= PCI_EXP_RTSTA_PME; | ||
| 89 | pci_write_config_dword(dev, rtsta_pos, rtsta); | ||
| 90 | } | ||
| 91 | |||
| 92 | /** | ||
| 93 | * pcie_pme_walk_bus - Scan a PCI bus for devices asserting PME#. | 74 | * pcie_pme_walk_bus - Scan a PCI bus for devices asserting PME#. |
| 94 | * @bus: PCI bus to scan. | 75 | * @bus: PCI bus to scan. |
| 95 | * | 76 | * |
| @@ -103,8 +84,8 @@ static bool pcie_pme_walk_bus(struct pci_bus *bus) | |||
| 103 | list_for_each_entry(dev, &bus->devices, bus_list) { | 84 | list_for_each_entry(dev, &bus->devices, bus_list) { |
| 104 | /* Skip PCIe devices in case we started from a root port. */ | 85 | /* Skip PCIe devices in case we started from a root port. */ |
| 105 | if (!pci_is_pcie(dev) && pci_check_pme_status(dev)) { | 86 | if (!pci_is_pcie(dev) && pci_check_pme_status(dev)) { |
| 106 | pm_request_resume(&dev->dev); | ||
| 107 | pci_wakeup_event(dev); | 87 | pci_wakeup_event(dev); |
| 88 | pm_request_resume(&dev->dev); | ||
| 108 | ret = true; | 89 | ret = true; |
| 109 | } | 90 | } |
| 110 | 91 | ||
| @@ -206,8 +187,8 @@ static void pcie_pme_handle_request(struct pci_dev *port, u16 req_id) | |||
| 206 | /* The device is there, but we have to check its PME status. */ | 187 | /* The device is there, but we have to check its PME status. */ |
| 207 | found = pci_check_pme_status(dev); | 188 | found = pci_check_pme_status(dev); |
| 208 | if (found) { | 189 | if (found) { |
| 209 | pm_request_resume(&dev->dev); | ||
| 210 | pci_wakeup_event(dev); | 190 | pci_wakeup_event(dev); |
| 191 | pm_request_resume(&dev->dev); | ||
| 211 | } | 192 | } |
| 212 | pci_dev_put(dev); | 193 | pci_dev_put(dev); |
| 213 | } else if (devfn) { | 194 | } else if (devfn) { |
| @@ -253,7 +234,7 @@ static void pcie_pme_work_fn(struct work_struct *work) | |||
| 253 | * Clear PME status of the port. If there are other | 234 | * Clear PME status of the port. If there are other |
| 254 | * pending PMEs, the status will be set again. | 235 | * pending PMEs, the status will be set again. |
| 255 | */ | 236 | */ |
| 256 | pcie_pme_clear_status(port); | 237 | pcie_clear_root_pme_status(port); |
| 257 | 238 | ||
| 258 | spin_unlock_irq(&data->lock); | 239 | spin_unlock_irq(&data->lock); |
| 259 | pcie_pme_handle_request(port, rtsta & 0xffff); | 240 | pcie_pme_handle_request(port, rtsta & 0xffff); |
| @@ -378,7 +359,7 @@ static int pcie_pme_probe(struct pcie_device *srv) | |||
| 378 | 359 | ||
| 379 | port = srv->port; | 360 | port = srv->port; |
| 380 | pcie_pme_interrupt_enable(port, false); | 361 | pcie_pme_interrupt_enable(port, false); |
| 381 | pcie_pme_clear_status(port); | 362 | pcie_clear_root_pme_status(port); |
| 382 | 363 | ||
| 383 | ret = request_irq(srv->irq, pcie_pme_irq, IRQF_SHARED, "PCIe PME", srv); | 364 | ret = request_irq(srv->irq, pcie_pme_irq, IRQF_SHARED, "PCIe PME", srv); |
| 384 | if (ret) { | 365 | if (ret) { |
| @@ -402,7 +383,7 @@ static int pcie_pme_suspend(struct pcie_device *srv) | |||
| 402 | 383 | ||
| 403 | spin_lock_irq(&data->lock); | 384 | spin_lock_irq(&data->lock); |
| 404 | pcie_pme_interrupt_enable(port, false); | 385 | pcie_pme_interrupt_enable(port, false); |
| 405 | pcie_pme_clear_status(port); | 386 | pcie_clear_root_pme_status(port); |
| 406 | data->noirq = true; | 387 | data->noirq = true; |
| 407 | spin_unlock_irq(&data->lock); | 388 | spin_unlock_irq(&data->lock); |
| 408 | 389 | ||
| @@ -422,7 +403,7 @@ static int pcie_pme_resume(struct pcie_device *srv) | |||
| 422 | 403 | ||
| 423 | spin_lock_irq(&data->lock); | 404 | spin_lock_irq(&data->lock); |
| 424 | data->noirq = false; | 405 | data->noirq = false; |
| 425 | pcie_pme_clear_status(port); | 406 | pcie_clear_root_pme_status(port); |
| 426 | pcie_pme_interrupt_enable(port, true); | 407 | pcie_pme_interrupt_enable(port, true); |
| 427 | spin_unlock_irq(&data->lock); | 408 | spin_unlock_irq(&data->lock); |
| 428 | 409 | ||
diff --git a/drivers/pci/pcie/portdrv.h b/drivers/pci/pcie/portdrv.h index 7b5aba0a3291..bd00a01aef14 100644 --- a/drivers/pci/pcie/portdrv.h +++ b/drivers/pci/pcie/portdrv.h | |||
| @@ -20,9 +20,6 @@ | |||
| 20 | 20 | ||
| 21 | #define get_descriptor_id(type, service) (((type - 4) << 4) | service) | 21 | #define get_descriptor_id(type, service) (((type - 4) << 4) | service) |
| 22 | 22 | ||
| 23 | extern bool pcie_ports_disabled; | ||
| 24 | extern bool pcie_ports_auto; | ||
| 25 | |||
| 26 | extern struct bus_type pcie_port_bus_type; | 23 | extern struct bus_type pcie_port_bus_type; |
| 27 | extern int pcie_port_device_register(struct pci_dev *dev); | 24 | extern int pcie_port_device_register(struct pci_dev *dev); |
| 28 | #ifdef CONFIG_PM | 25 | #ifdef CONFIG_PM |
| @@ -35,6 +32,8 @@ extern void pcie_port_bus_unregister(void); | |||
| 35 | 32 | ||
| 36 | struct pci_dev; | 33 | struct pci_dev; |
| 37 | 34 | ||
| 35 | extern void pcie_clear_root_pme_status(struct pci_dev *dev); | ||
| 36 | |||
| 38 | #ifdef CONFIG_PCIE_PME | 37 | #ifdef CONFIG_PCIE_PME |
| 39 | extern bool pcie_pme_msi_disabled; | 38 | extern bool pcie_pme_msi_disabled; |
| 40 | 39 | ||
diff --git a/drivers/pci/pcie/portdrv_acpi.c b/drivers/pci/pcie/portdrv_acpi.c index 5982b6a63b89..a86b56e5f2f2 100644 --- a/drivers/pci/pcie/portdrv_acpi.c +++ b/drivers/pci/pcie/portdrv_acpi.c | |||
| @@ -33,7 +33,7 @@ | |||
| 33 | */ | 33 | */ |
| 34 | int pcie_port_acpi_setup(struct pci_dev *port, int *srv_mask) | 34 | int pcie_port_acpi_setup(struct pci_dev *port, int *srv_mask) |
| 35 | { | 35 | { |
| 36 | acpi_status status; | 36 | struct acpi_pci_root *root; |
| 37 | acpi_handle handle; | 37 | acpi_handle handle; |
| 38 | u32 flags; | 38 | u32 flags; |
| 39 | 39 | ||
| @@ -44,26 +44,11 @@ int pcie_port_acpi_setup(struct pci_dev *port, int *srv_mask) | |||
| 44 | if (!handle) | 44 | if (!handle) |
| 45 | return -EINVAL; | 45 | return -EINVAL; |
| 46 | 46 | ||
| 47 | flags = OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL | 47 | root = acpi_pci_find_root(handle); |
| 48 | | OSC_PCI_EXPRESS_NATIVE_HP_CONTROL | 48 | if (!root) |
| 49 | | OSC_PCI_EXPRESS_PME_CONTROL; | ||
| 50 | |||
| 51 | if (pci_aer_available()) { | ||
| 52 | if (aer_acpi_firmware_first()) | ||
| 53 | dev_dbg(&port->dev, "PCIe errors handled by BIOS.\n"); | ||
| 54 | else | ||
| 55 | flags |= OSC_PCI_EXPRESS_AER_CONTROL; | ||
| 56 | } | ||
| 57 | |||
| 58 | status = acpi_pci_osc_control_set(handle, &flags, | ||
| 59 | OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL); | ||
| 60 | if (ACPI_FAILURE(status)) { | ||
| 61 | dev_dbg(&port->dev, "ACPI _OSC request failed (code %d)\n", | ||
| 62 | status); | ||
| 63 | return -ENODEV; | 49 | return -ENODEV; |
| 64 | } | ||
| 65 | 50 | ||
| 66 | dev_info(&port->dev, "ACPI _OSC control granted for 0x%02x\n", flags); | 51 | flags = root->osc_control_set; |
| 67 | 52 | ||
| 68 | *srv_mask = PCIE_PORT_SERVICE_VC; | 53 | *srv_mask = PCIE_PORT_SERVICE_VC; |
| 69 | if (flags & OSC_PCI_EXPRESS_NATIVE_HP_CONTROL) | 54 | if (flags & OSC_PCI_EXPRESS_NATIVE_HP_CONTROL) |
diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c index a9c222d79ebc..5130d0d22390 100644 --- a/drivers/pci/pcie/portdrv_core.c +++ b/drivers/pci/pcie/portdrv_core.c | |||
| @@ -241,17 +241,17 @@ static int get_port_device_capability(struct pci_dev *dev) | |||
| 241 | int cap_mask; | 241 | int cap_mask; |
| 242 | int err; | 242 | int err; |
| 243 | 243 | ||
| 244 | if (pcie_ports_disabled) | ||
| 245 | return 0; | ||
| 246 | |||
| 244 | err = pcie_port_platform_notify(dev, &cap_mask); | 247 | err = pcie_port_platform_notify(dev, &cap_mask); |
| 245 | if (pcie_ports_auto) { | 248 | if (!pcie_ports_auto) { |
| 246 | if (err) { | ||
| 247 | pcie_no_aspm(); | ||
| 248 | return 0; | ||
| 249 | } | ||
| 250 | } else { | ||
| 251 | cap_mask = PCIE_PORT_SERVICE_PME | PCIE_PORT_SERVICE_HP | 249 | cap_mask = PCIE_PORT_SERVICE_PME | PCIE_PORT_SERVICE_HP |
| 252 | | PCIE_PORT_SERVICE_VC; | 250 | | PCIE_PORT_SERVICE_VC; |
| 253 | if (pci_aer_available()) | 251 | if (pci_aer_available()) |
| 254 | cap_mask |= PCIE_PORT_SERVICE_AER; | 252 | cap_mask |= PCIE_PORT_SERVICE_AER; |
| 253 | } else if (err) { | ||
| 254 | return 0; | ||
| 255 | } | 255 | } |
| 256 | 256 | ||
| 257 | pos = pci_pcie_cap(dev); | 257 | pos = pci_pcie_cap(dev); |
| @@ -349,15 +349,18 @@ int pcie_port_device_register(struct pci_dev *dev) | |||
| 349 | int status, capabilities, i, nr_service; | 349 | int status, capabilities, i, nr_service; |
| 350 | int irqs[PCIE_PORT_DEVICE_MAXSERVICES]; | 350 | int irqs[PCIE_PORT_DEVICE_MAXSERVICES]; |
| 351 | 351 | ||
| 352 | /* Get and check PCI Express port services */ | ||
| 353 | capabilities = get_port_device_capability(dev); | ||
| 354 | if (!capabilities) | ||
| 355 | return -ENODEV; | ||
| 356 | |||
| 357 | /* Enable PCI Express port device */ | 352 | /* Enable PCI Express port device */ |
| 358 | status = pci_enable_device(dev); | 353 | status = pci_enable_device(dev); |
| 359 | if (status) | 354 | if (status) |
| 360 | return status; | 355 | return status; |
| 356 | |||
| 357 | /* Get and check PCI Express port services */ | ||
| 358 | capabilities = get_port_device_capability(dev); | ||
| 359 | if (!capabilities) { | ||
| 360 | pcie_no_aspm(); | ||
| 361 | return 0; | ||
| 362 | } | ||
| 363 | |||
| 361 | pci_set_master(dev); | 364 | pci_set_master(dev); |
| 362 | /* | 365 | /* |
| 363 | * Initialize service irqs. Don't use service devices that | 366 | * Initialize service irqs. Don't use service devices that |
diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c index f9033e190fb6..e0610bda1dea 100644 --- a/drivers/pci/pcie/portdrv_pci.c +++ b/drivers/pci/pcie/portdrv_pci.c | |||
| @@ -57,6 +57,22 @@ __setup("pcie_ports=", pcie_port_setup); | |||
| 57 | 57 | ||
| 58 | /* global data */ | 58 | /* global data */ |
| 59 | 59 | ||
| 60 | /** | ||
| 61 | * pcie_clear_root_pme_status - Clear root port PME interrupt status. | ||
| 62 | * @dev: PCIe root port or event collector. | ||
| 63 | */ | ||
| 64 | void pcie_clear_root_pme_status(struct pci_dev *dev) | ||
| 65 | { | ||
| 66 | int rtsta_pos; | ||
| 67 | u32 rtsta; | ||
| 68 | |||
| 69 | rtsta_pos = pci_pcie_cap(dev) + PCI_EXP_RTSTA; | ||
| 70 | |||
| 71 | pci_read_config_dword(dev, rtsta_pos, &rtsta); | ||
| 72 | rtsta |= PCI_EXP_RTSTA_PME; | ||
| 73 | pci_write_config_dword(dev, rtsta_pos, rtsta); | ||
| 74 | } | ||
| 75 | |||
| 60 | static int pcie_portdrv_restore_config(struct pci_dev *dev) | 76 | static int pcie_portdrv_restore_config(struct pci_dev *dev) |
| 61 | { | 77 | { |
| 62 | int retval; | 78 | int retval; |
| @@ -69,6 +85,20 @@ static int pcie_portdrv_restore_config(struct pci_dev *dev) | |||
| 69 | } | 85 | } |
| 70 | 86 | ||
| 71 | #ifdef CONFIG_PM | 87 | #ifdef CONFIG_PM |
| 88 | static int pcie_port_resume_noirq(struct device *dev) | ||
| 89 | { | ||
| 90 | struct pci_dev *pdev = to_pci_dev(dev); | ||
| 91 | |||
| 92 | /* | ||
| 93 | * Some BIOSes forget to clear Root PME Status bits after system wakeup | ||
| 94 | * which breaks ACPI-based runtime wakeup on PCI Express, so clear those | ||
| 95 | * bits now just in case (shouldn't hurt). | ||
| 96 | */ | ||
| 97 | if(pdev->pcie_type == PCI_EXP_TYPE_ROOT_PORT) | ||
| 98 | pcie_clear_root_pme_status(pdev); | ||
| 99 | return 0; | ||
| 100 | } | ||
| 101 | |||
| 72 | static const struct dev_pm_ops pcie_portdrv_pm_ops = { | 102 | static const struct dev_pm_ops pcie_portdrv_pm_ops = { |
| 73 | .suspend = pcie_port_device_suspend, | 103 | .suspend = pcie_port_device_suspend, |
| 74 | .resume = pcie_port_device_resume, | 104 | .resume = pcie_port_device_resume, |
| @@ -76,6 +106,7 @@ static const struct dev_pm_ops pcie_portdrv_pm_ops = { | |||
| 76 | .thaw = pcie_port_device_resume, | 106 | .thaw = pcie_port_device_resume, |
| 77 | .poweroff = pcie_port_device_suspend, | 107 | .poweroff = pcie_port_device_suspend, |
| 78 | .restore = pcie_port_device_resume, | 108 | .restore = pcie_port_device_resume, |
| 109 | .resume_noirq = pcie_port_resume_noirq, | ||
| 79 | }; | 110 | }; |
| 80 | 111 | ||
| 81 | #define PCIE_PORTDRV_PM_OPS (&pcie_portdrv_pm_ops) | 112 | #define PCIE_PORTDRV_PM_OPS (&pcie_portdrv_pm_ops) |
| @@ -327,10 +358,8 @@ static int __init pcie_portdrv_init(void) | |||
| 327 | { | 358 | { |
| 328 | int retval; | 359 | int retval; |
| 329 | 360 | ||
| 330 | if (pcie_ports_disabled) { | 361 | if (pcie_ports_disabled) |
| 331 | pcie_no_aspm(); | 362 | return pci_register_driver(&pcie_portdriver); |
| 332 | return -EACCES; | ||
| 333 | } | ||
| 334 | 363 | ||
| 335 | dmi_check_system(pcie_portdrv_dmi_table); | 364 | dmi_check_system(pcie_portdrv_dmi_table); |
| 336 | 365 | ||
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index d3c5905b22ec..9c5c8be72231 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c | |||
| @@ -7515,16 +7515,10 @@ static int ipr_reset_restore_cfg_space(struct ipr_cmnd *ipr_cmd) | |||
| 7515 | { | 7515 | { |
| 7516 | struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg; | 7516 | struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg; |
| 7517 | volatile u32 int_reg; | 7517 | volatile u32 int_reg; |
| 7518 | int rc; | ||
| 7519 | 7518 | ||
| 7520 | ENTER; | 7519 | ENTER; |
| 7521 | ioa_cfg->pdev->state_saved = true; | 7520 | ioa_cfg->pdev->state_saved = true; |
| 7522 | rc = pci_restore_state(ioa_cfg->pdev); | 7521 | pci_restore_state(ioa_cfg->pdev); |
| 7523 | |||
| 7524 | if (rc != PCIBIOS_SUCCESSFUL) { | ||
| 7525 | ipr_cmd->s.ioasa.hdr.ioasc = cpu_to_be32(IPR_IOASC_PCI_ACCESS_ERROR); | ||
| 7526 | return IPR_RC_JOB_CONTINUE; | ||
| 7527 | } | ||
| 7528 | 7522 | ||
| 7529 | if (ipr_set_pcix_cmd_reg(ioa_cfg)) { | 7523 | if (ipr_set_pcix_cmd_reg(ioa_cfg)) { |
| 7530 | ipr_cmd->s.ioasa.hdr.ioasc = cpu_to_be32(IPR_IOASC_PCI_ACCESS_ERROR); | 7524 | ipr_cmd->s.ioasa.hdr.ioasc = cpu_to_be32(IPR_IOASC_PCI_ACCESS_ERROR); |
diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c index 300d59f389da..321cf3ae8630 100644 --- a/drivers/scsi/pmcraid.c +++ b/drivers/scsi/pmcraid.c | |||
| @@ -2228,12 +2228,7 @@ static void pmcraid_ioa_reset(struct pmcraid_cmd *cmd) | |||
| 2228 | /* Once either bist or pci reset is done, restore PCI config | 2228 | /* Once either bist or pci reset is done, restore PCI config |
| 2229 | * space. If this fails, proceed with hard reset again | 2229 | * space. If this fails, proceed with hard reset again |
| 2230 | */ | 2230 | */ |
| 2231 | if (pci_restore_state(pinstance->pdev)) { | 2231 | pci_restore_state(pinstance->pdev); |
| 2232 | pmcraid_info("config-space error resetting again\n"); | ||
| 2233 | pinstance->ioa_state = IOA_STATE_IN_RESET_ALERT; | ||
| 2234 | pmcraid_reset_alert(cmd); | ||
| 2235 | break; | ||
| 2236 | } | ||
| 2237 | 2232 | ||
| 2238 | /* fail all pending commands */ | 2233 | /* fail all pending commands */ |
| 2239 | pmcraid_fail_outstanding_cmds(pinstance); | 2234 | pmcraid_fail_outstanding_cmds(pinstance); |
diff --git a/drivers/staging/sm7xx/smtcfb.c b/drivers/staging/sm7xx/smtcfb.c index f4b163f7338a..0bc113c44d39 100644 --- a/drivers/staging/sm7xx/smtcfb.c +++ b/drivers/staging/sm7xx/smtcfb.c | |||
| @@ -1071,7 +1071,7 @@ static int __maybe_unused smtcfb_resume(struct pci_dev *pdev) | |||
| 1071 | /* when resuming, restore pci data and fb cursor */ | 1071 | /* when resuming, restore pci data and fb cursor */ |
| 1072 | if (pdev->dev.power.power_state.event != PM_EVENT_FREEZE) { | 1072 | if (pdev->dev.power.power_state.event != PM_EVENT_FREEZE) { |
| 1073 | retv = pci_set_power_state(pdev, PCI_D0); | 1073 | retv = pci_set_power_state(pdev, PCI_D0); |
| 1074 | retv = pci_restore_state(pdev); | 1074 | pci_restore_state(pdev); |
| 1075 | if (pci_enable_device(pdev)) | 1075 | if (pci_enable_device(pdev)) |
| 1076 | return -1; | 1076 | return -1; |
| 1077 | pci_set_master(pdev); | 1077 | pci_set_master(pdev); |
diff --git a/include/acpi/apei.h b/include/acpi/apei.h index b3365025ff8d..c4dbb132d902 100644 --- a/include/acpi/apei.h +++ b/include/acpi/apei.h | |||
| @@ -19,6 +19,12 @@ | |||
| 19 | extern int hest_disable; | 19 | extern int hest_disable; |
| 20 | extern int erst_disable; | 20 | extern int erst_disable; |
| 21 | 21 | ||
| 22 | #ifdef CONFIG_ACPI_APEI | ||
| 23 | void __init acpi_hest_init(void); | ||
| 24 | #else | ||
| 25 | static inline void acpi_hest_init(void) { return; } | ||
| 26 | #endif | ||
| 27 | |||
| 22 | typedef int (*apei_hest_func_t)(struct acpi_hest_header *hest_hdr, void *data); | 28 | typedef int (*apei_hest_func_t)(struct acpi_hest_header *hest_hdr, void *data); |
| 23 | int apei_hest_parse(apei_hest_func_t func, void *data); | 29 | int apei_hest_parse(apei_hest_func_t func, void *data); |
| 24 | 30 | ||
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h index c8b6473c5f42..479d9bb88e11 100644 --- a/include/linux/pci-acpi.h +++ b/include/linux/pci-acpi.h | |||
| @@ -40,4 +40,10 @@ static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) | |||
| 40 | { return NULL; } | 40 | { return NULL; } |
| 41 | #endif | 41 | #endif |
| 42 | 42 | ||
| 43 | #ifdef CONFIG_ACPI_APEI | ||
| 44 | extern bool aer_acpi_firmware_first(void); | ||
| 45 | #else | ||
| 46 | static inline bool aer_acpi_firmware_first(void) { return false; } | ||
| 47 | #endif | ||
| 48 | |||
| 43 | #endif /* _PCI_ACPI_H_ */ | 49 | #endif /* _PCI_ACPI_H_ */ |
diff --git a/include/linux/pci-aspm.h b/include/linux/pci-aspm.h index 91ba0b338b47..ce6810512c66 100644 --- a/include/linux/pci-aspm.h +++ b/include/linux/pci-aspm.h | |||
| @@ -27,6 +27,7 @@ extern void pcie_aspm_init_link_state(struct pci_dev *pdev); | |||
| 27 | extern void pcie_aspm_exit_link_state(struct pci_dev *pdev); | 27 | extern void pcie_aspm_exit_link_state(struct pci_dev *pdev); |
| 28 | extern void pcie_aspm_pm_state_change(struct pci_dev *pdev); | 28 | extern void pcie_aspm_pm_state_change(struct pci_dev *pdev); |
| 29 | extern void pci_disable_link_state(struct pci_dev *pdev, int state); | 29 | extern void pci_disable_link_state(struct pci_dev *pdev, int state); |
| 30 | extern void pcie_clear_aspm(void); | ||
| 30 | extern void pcie_no_aspm(void); | 31 | extern void pcie_no_aspm(void); |
| 31 | #else | 32 | #else |
| 32 | static inline void pcie_aspm_init_link_state(struct pci_dev *pdev) | 33 | static inline void pcie_aspm_init_link_state(struct pci_dev *pdev) |
| @@ -41,7 +42,9 @@ static inline void pcie_aspm_pm_state_change(struct pci_dev *pdev) | |||
| 41 | static inline void pci_disable_link_state(struct pci_dev *pdev, int state) | 42 | static inline void pci_disable_link_state(struct pci_dev *pdev, int state) |
| 42 | { | 43 | { |
| 43 | } | 44 | } |
| 44 | 45 | static inline void pcie_clear_aspm(void) | |
| 46 | { | ||
| 47 | } | ||
| 45 | static inline void pcie_no_aspm(void) | 48 | static inline void pcie_no_aspm(void) |
| 46 | { | 49 | { |
| 47 | } | 50 | } |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 7454408c41b6..9e67dcd054c4 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -806,7 +806,7 @@ size_t pci_get_rom_size(struct pci_dev *pdev, void __iomem *rom, size_t size); | |||
| 806 | 806 | ||
| 807 | /* Power management related routines */ | 807 | /* Power management related routines */ |
| 808 | int pci_save_state(struct pci_dev *dev); | 808 | int pci_save_state(struct pci_dev *dev); |
| 809 | int pci_restore_state(struct pci_dev *dev); | 809 | void pci_restore_state(struct pci_dev *dev); |
| 810 | int __pci_complete_power_transition(struct pci_dev *dev, pci_power_t state); | 810 | int __pci_complete_power_transition(struct pci_dev *dev, pci_power_t state); |
| 811 | int pci_set_power_state(struct pci_dev *dev, pci_power_t state); | 811 | int pci_set_power_state(struct pci_dev *dev, pci_power_t state); |
| 812 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); | 812 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); |
| @@ -820,7 +820,6 @@ int pci_prepare_to_sleep(struct pci_dev *dev); | |||
| 820 | int pci_back_from_sleep(struct pci_dev *dev); | 820 | int pci_back_from_sleep(struct pci_dev *dev); |
| 821 | bool pci_dev_run_wake(struct pci_dev *dev); | 821 | bool pci_dev_run_wake(struct pci_dev *dev); |
| 822 | bool pci_check_pme_status(struct pci_dev *dev); | 822 | bool pci_check_pme_status(struct pci_dev *dev); |
| 823 | void pci_wakeup_event(struct pci_dev *dev); | ||
| 824 | void pci_pme_wakeup_bus(struct pci_bus *bus); | 823 | void pci_pme_wakeup_bus(struct pci_bus *bus); |
| 825 | 824 | ||
| 826 | static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, | 825 | static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, |
| @@ -994,6 +993,9 @@ extern void pci_restore_msi_state(struct pci_dev *dev); | |||
| 994 | extern int pci_msi_enabled(void); | 993 | extern int pci_msi_enabled(void); |
| 995 | #endif | 994 | #endif |
| 996 | 995 | ||
| 996 | extern bool pcie_ports_disabled; | ||
| 997 | extern bool pcie_ports_auto; | ||
| 998 | |||
| 997 | #ifndef CONFIG_PCIEASPM | 999 | #ifndef CONFIG_PCIEASPM |
| 998 | static inline int pcie_aspm_enabled(void) | 1000 | static inline int pcie_aspm_enabled(void) |
| 999 | { | 1001 | { |
| @@ -1003,6 +1005,14 @@ static inline int pcie_aspm_enabled(void) | |||
| 1003 | extern int pcie_aspm_enabled(void); | 1005 | extern int pcie_aspm_enabled(void); |
| 1004 | #endif | 1006 | #endif |
| 1005 | 1007 | ||
| 1008 | #ifdef CONFIG_PCIEAER | ||
| 1009 | void pci_no_aer(void); | ||
| 1010 | bool pci_aer_available(void); | ||
| 1011 | #else | ||
| 1012 | static inline void pci_no_aer(void) { } | ||
| 1013 | static inline bool pci_aer_available(void) { return false; } | ||
| 1014 | #endif | ||
| 1015 | |||
| 1006 | #ifndef CONFIG_PCIE_ECRC | 1016 | #ifndef CONFIG_PCIE_ECRC |
| 1007 | static inline void pcie_set_ecrc_checking(struct pci_dev *dev) | 1017 | static inline void pcie_set_ecrc_checking(struct pci_dev *dev) |
| 1008 | { | 1018 | { |
| @@ -1168,10 +1178,8 @@ static inline int pci_save_state(struct pci_dev *dev) | |||
| 1168 | return 0; | 1178 | return 0; |
| 1169 | } | 1179 | } |
| 1170 | 1180 | ||
| 1171 | static inline int pci_restore_state(struct pci_dev *dev) | 1181 | static inline void pci_restore_state(struct pci_dev *dev) |
| 1172 | { | 1182 | { } |
| 1173 | return 0; | ||
| 1174 | } | ||
| 1175 | 1183 | ||
| 1176 | static inline int pci_set_power_state(struct pci_dev *dev, pci_power_t state) | 1184 | static inline int pci_set_power_state(struct pci_dev *dev, pci_power_t state) |
| 1177 | { | 1185 | { |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index ae0dc453e3e2..3adb06ebf841 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
| @@ -2478,7 +2478,8 @@ | |||
| 2478 | #define PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MIN 0x1c41 | 2478 | #define PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MIN 0x1c41 |
| 2479 | #define PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MAX 0x1c5f | 2479 | #define PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MAX 0x1c5f |
| 2480 | #define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS 0x1d22 | 2480 | #define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS 0x1d22 |
| 2481 | #define PCI_DEVICE_ID_INTEL_PATSBURG_LPC 0x1d40 | 2481 | #define PCI_DEVICE_ID_INTEL_PATSBURG_LPC_0 0x1d40 |
| 2482 | #define PCI_DEVICE_ID_INTEL_PATSBURG_LPC_1 0x1d41 | ||
| 2482 | #define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410 | 2483 | #define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410 |
| 2483 | #define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411 | 2484 | #define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411 |
| 2484 | #define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413 | 2485 | #define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413 |
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index af83076c31a6..5b7e6b1ba54f 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
| @@ -309,6 +309,14 @@ | |||
| 309 | #define PCI_MSIX_PBA 8 | 309 | #define PCI_MSIX_PBA 8 |
| 310 | #define PCI_MSIX_FLAGS_BIRMASK (7 << 0) | 310 | #define PCI_MSIX_FLAGS_BIRMASK (7 << 0) |
| 311 | 311 | ||
| 312 | /* MSI-X entry's format */ | ||
| 313 | #define PCI_MSIX_ENTRY_SIZE 16 | ||
| 314 | #define PCI_MSIX_ENTRY_LOWER_ADDR 0 | ||
| 315 | #define PCI_MSIX_ENTRY_UPPER_ADDR 4 | ||
| 316 | #define PCI_MSIX_ENTRY_DATA 8 | ||
| 317 | #define PCI_MSIX_ENTRY_VECTOR_CTRL 12 | ||
| 318 | #define PCI_MSIX_ENTRY_CTRL_MASKBIT 1 | ||
| 319 | |||
| 312 | /* CompactPCI Hotswap Register */ | 320 | /* CompactPCI Hotswap Register */ |
| 313 | 321 | ||
| 314 | #define PCI_CHSWP_CSR 2 /* Control and Status Register */ | 322 | #define PCI_CHSWP_CSR 2 /* Control and Status Register */ |
| @@ -496,6 +504,8 @@ | |||
| 496 | #define PCI_EXP_RTCTL_CRSSVE 0x10 /* CRS Software Visibility Enable */ | 504 | #define PCI_EXP_RTCTL_CRSSVE 0x10 /* CRS Software Visibility Enable */ |
| 497 | #define PCI_EXP_RTCAP 30 /* Root Capabilities */ | 505 | #define PCI_EXP_RTCAP 30 /* Root Capabilities */ |
| 498 | #define PCI_EXP_RTSTA 32 /* Root Status */ | 506 | #define PCI_EXP_RTSTA 32 /* Root Status */ |
| 507 | #define PCI_EXP_RTSTA_PME 0x10000 /* PME status */ | ||
| 508 | #define PCI_EXP_RTSTA_PENDING 0x20000 /* PME pending */ | ||
| 499 | #define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */ | 509 | #define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */ |
| 500 | #define PCI_EXP_DEVCAP2_ARI 0x20 /* Alternative Routing-ID */ | 510 | #define PCI_EXP_DEVCAP2_ARI 0x20 /* Alternative Routing-ID */ |
| 501 | #define PCI_EXP_DEVCTL2 40 /* Device Control 2 */ | 511 | #define PCI_EXP_DEVCTL2 40 /* Device Control 2 */ |
diff --git a/sound/pci/cs5535audio/cs5535audio_pm.c b/sound/pci/cs5535audio/cs5535audio_pm.c index a3301cc4ab82..185b00088320 100644 --- a/sound/pci/cs5535audio/cs5535audio_pm.c +++ b/sound/pci/cs5535audio/cs5535audio_pm.c | |||
| @@ -90,12 +90,7 @@ int snd_cs5535audio_resume(struct pci_dev *pci) | |||
| 90 | int i; | 90 | int i; |
| 91 | 91 | ||
| 92 | pci_set_power_state(pci, PCI_D0); | 92 | pci_set_power_state(pci, PCI_D0); |
| 93 | if (pci_restore_state(pci) < 0) { | 93 | pci_restore_state(pci); |
| 94 | printk(KERN_ERR "cs5535audio: pci_restore_state failed, " | ||
| 95 | "disabling device\n"); | ||
| 96 | snd_card_disconnect(card); | ||
| 97 | return -EIO; | ||
| 98 | } | ||
| 99 | if (pci_enable_device(pci) < 0) { | 94 | if (pci_enable_device(pci) < 0) { |
| 100 | printk(KERN_ERR "cs5535audio: pci_enable_device failed, " | 95 | printk(KERN_ERR "cs5535audio: pci_enable_device failed, " |
| 101 | "disabling device\n"); | 96 | "disabling device\n"); |
