Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'pm+acpi-3.13-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI and PM fixes and new device IDs from Rafael Wysocki:
"These commits, except for one, are regression fixes and the remaining
one fixes a divide error leading to a kernel panic. The majority of
the regressions fixed here were introduced during the 3.12 cycle, one
of them is from this cycle and one is older.

Specifics:

- VGA switcheroo was broken for some users as a result of the
ACPI-based PCI hotplug (ACPIPHP) changes in 3.12, because some
previously ignored hotplug events started to be handled. The fix
causes them to be ignored again.

- There are two more issues related to cpufreq's suspend/resume
handling changes from the 3.12 cycle addressed by Viresh Kumar's
fixes.

- intel_pstate triggers a divide error in a timer function if the
P-state information it needs is missing during initialization.
This leads to kernel panics on nested KVM clients and is fixed by
failing the initialization cleanly in those cases.

- PCI initalization code changes during the 3.9 cycle uncovered BIOS
issues related to ACPI wakeup notifications (some BIOSes send them
for devices that aren't supposed to support ACPI wakeup). Work
around them by installing an ACPI wakeup notify handler for all PCI
devices with ACPI support.

- The Calxeda cpuilde driver's probe function is tagged as __init,
which is incorrect and causes a section mismatch to occur during
build. Fix from Andre Przywara removes the __init tag from there.

- During the 3.12 cycle ACPIPHP started to print warnings about
missing _ADR for devices that legitimately don't have it. Fix from
Toshi Kani makes it only print the warnings where they make sense"

* tag 'pm+acpi-3.13-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPIPHP / radeon / nouveau: Fix VGA switcheroo problem related to hotplug
intel_pstate: Fail initialization if P-state information is missing
ARM/cpuidle: remove __init tag from Calxeda cpuidle probe function
PCI / ACPI: Install wakeup notify handlers for all PCI devs with ACPI
cpufreq: preserve user_policy across suspend/resume
cpufreq: Clean up after a failing light-weight initialization
ACPI / PCI / hotplug: Avoid warning when _ADR not present

+108 -33
+10
drivers/acpi/bus.c
··· 156 } 157 EXPORT_SYMBOL(acpi_bus_get_private_data); 158 159 static void acpi_print_osc_error(acpi_handle handle, 160 struct acpi_osc_context *context, char *error) 161 {
··· 156 } 157 EXPORT_SYMBOL(acpi_bus_get_private_data); 158 159 + void acpi_bus_no_hotplug(acpi_handle handle) 160 + { 161 + struct acpi_device *adev = NULL; 162 + 163 + acpi_bus_get_device(handle, &adev); 164 + if (adev) 165 + adev->flags.no_hotplug = true; 166 + } 167 + EXPORT_SYMBOL_GPL(acpi_bus_no_hotplug); 168 + 169 static void acpi_print_osc_error(acpi_handle handle, 170 struct acpi_osc_context *context, char *error) 171 {
+23 -14
drivers/cpufreq/cpufreq.c
··· 839 840 /* set default policy */ 841 ret = cpufreq_set_policy(policy, &new_policy); 842 - policy->user_policy.policy = policy->policy; 843 - policy->user_policy.governor = policy->governor; 844 - 845 if (ret) { 846 pr_debug("setting policy failed\n"); 847 if (cpufreq_driver->exit) ··· 1013 read_unlock_irqrestore(&cpufreq_driver_lock, flags); 1014 #endif 1015 1016 - if (frozen) 1017 - /* Restore the saved policy when doing light-weight init */ 1018 - policy = cpufreq_policy_restore(cpu); 1019 - else 1020 policy = cpufreq_policy_alloc(); 1021 - 1022 - if (!policy) 1023 - goto nomem_out; 1024 - 1025 1026 /* 1027 * In the resume path, since we restore a saved policy, the assignment ··· 1068 */ 1069 cpumask_and(policy->cpus, policy->cpus, cpu_online_mask); 1070 1071 - policy->user_policy.min = policy->min; 1072 - policy->user_policy.max = policy->max; 1073 1074 blocking_notifier_call_chain(&cpufreq_policy_notifier_list, 1075 CPUFREQ_START, policy); ··· 1102 1103 cpufreq_init_policy(policy); 1104 1105 kobject_uevent(&policy->kobj, KOBJ_ADD); 1106 up_read(&cpufreq_rwsem); 1107 ··· 1124 if (cpufreq_driver->exit) 1125 cpufreq_driver->exit(policy); 1126 err_set_policy_cpu: 1127 - if (frozen) 1128 cpufreq_policy_put_kobj(policy); 1129 cpufreq_policy_free(policy); 1130 1131 nomem_out:
··· 839 840 /* set default policy */ 841 ret = cpufreq_set_policy(policy, &new_policy); 842 if (ret) { 843 pr_debug("setting policy failed\n"); 844 if (cpufreq_driver->exit) ··· 1016 read_unlock_irqrestore(&cpufreq_driver_lock, flags); 1017 #endif 1018 1019 + /* 1020 + * Restore the saved policy when doing light-weight init and fall back 1021 + * to the full init if that fails. 1022 + */ 1023 + policy = frozen ? cpufreq_policy_restore(cpu) : NULL; 1024 + if (!policy) { 1025 + frozen = false; 1026 policy = cpufreq_policy_alloc(); 1027 + if (!policy) 1028 + goto nomem_out; 1029 + } 1030 1031 /* 1032 * In the resume path, since we restore a saved policy, the assignment ··· 1069 */ 1070 cpumask_and(policy->cpus, policy->cpus, cpu_online_mask); 1071 1072 + if (!frozen) { 1073 + policy->user_policy.min = policy->min; 1074 + policy->user_policy.max = policy->max; 1075 + } 1076 1077 blocking_notifier_call_chain(&cpufreq_policy_notifier_list, 1078 CPUFREQ_START, policy); ··· 1101 1102 cpufreq_init_policy(policy); 1103 1104 + if (!frozen) { 1105 + policy->user_policy.policy = policy->policy; 1106 + policy->user_policy.governor = policy->governor; 1107 + } 1108 + 1109 kobject_uevent(&policy->kobj, KOBJ_ADD); 1110 up_read(&cpufreq_rwsem); 1111 ··· 1118 if (cpufreq_driver->exit) 1119 cpufreq_driver->exit(policy); 1120 err_set_policy_cpu: 1121 + if (frozen) { 1122 + /* Do not leave stale fallback data behind. */ 1123 + per_cpu(cpufreq_cpu_data_fallback, cpu) = NULL; 1124 cpufreq_policy_put_kobj(policy); 1125 + } 1126 cpufreq_policy_free(policy); 1127 1128 nomem_out:
+5
drivers/cpufreq/intel_pstate.c
··· 614 cpu = all_cpu_data[cpunum]; 615 616 intel_pstate_get_cpu_pstates(cpu); 617 618 cpu->cpu = cpunum; 619
··· 614 cpu = all_cpu_data[cpunum]; 615 616 intel_pstate_get_cpu_pstates(cpu); 617 + if (!cpu->pstate.current_pstate) { 618 + all_cpu_data[cpunum] = NULL; 619 + kfree(cpu); 620 + return -ENODATA; 621 + } 622 623 cpu->cpu = cpunum; 624
+1 -1
drivers/cpuidle/cpuidle-calxeda.c
··· 65 .state_count = 2, 66 }; 67 68 - static int __init calxeda_cpuidle_probe(struct platform_device *pdev) 69 { 70 return cpuidle_register(&calxeda_idle_driver, NULL); 71 }
··· 65 .state_count = 2, 66 }; 67 68 + static int calxeda_cpuidle_probe(struct platform_device *pdev) 69 { 70 return cpuidle_register(&calxeda_idle_driver, NULL); 71 }
+14 -2
drivers/gpu/drm/nouveau/nouveau_acpi.c
··· 51 bool dsm_detected; 52 bool optimus_detected; 53 acpi_handle dhandle; 54 acpi_handle rom_handle; 55 } nouveau_dsm_priv; 56 ··· 261 if (!dhandle) 262 return false; 263 264 - if (!acpi_has_method(dhandle, "_DSM")) 265 return false; 266 - 267 if (nouveau_test_dsm(dhandle, nouveau_dsm, NOUVEAU_DSM_POWER)) 268 retval |= NOUVEAU_DSM_HAS_MUX; 269 ··· 340 printk(KERN_INFO "VGA switcheroo: detected DSM switching method %s handle\n", 341 acpi_method_name); 342 nouveau_dsm_priv.dsm_detected = true; 343 ret = true; 344 } 345
··· 51 bool dsm_detected; 52 bool optimus_detected; 53 acpi_handle dhandle; 54 + acpi_handle other_handle; 55 acpi_handle rom_handle; 56 } nouveau_dsm_priv; 57 ··· 260 if (!dhandle) 261 return false; 262 263 + if (!acpi_has_method(dhandle, "_DSM")) { 264 + nouveau_dsm_priv.other_handle = dhandle; 265 return false; 266 + } 267 if (nouveau_test_dsm(dhandle, nouveau_dsm, NOUVEAU_DSM_POWER)) 268 retval |= NOUVEAU_DSM_HAS_MUX; 269 ··· 338 printk(KERN_INFO "VGA switcheroo: detected DSM switching method %s handle\n", 339 acpi_method_name); 340 nouveau_dsm_priv.dsm_detected = true; 341 + /* 342 + * On some systems hotplug events are generated for the device 343 + * being switched off when _DSM is executed. They cause ACPI 344 + * hotplug to trigger and attempt to remove the device from 345 + * the system, which causes it to break down. Prevent that from 346 + * happening by setting the no_hotplug flag for the involved 347 + * ACPI device objects. 348 + */ 349 + acpi_bus_no_hotplug(nouveau_dsm_priv.dhandle); 350 + acpi_bus_no_hotplug(nouveau_dsm_priv.other_handle); 351 ret = true; 352 } 353
+14 -2
drivers/gpu/drm/radeon/radeon_atpx_handler.c
··· 33 bool atpx_detected; 34 /* handle for device - and atpx */ 35 acpi_handle dhandle; 36 struct radeon_atpx atpx; 37 } radeon_atpx_priv; 38 ··· 452 return false; 453 454 status = acpi_get_handle(dhandle, "ATPX", &atpx_handle); 455 - if (ACPI_FAILURE(status)) 456 return false; 457 - 458 radeon_atpx_priv.dhandle = dhandle; 459 radeon_atpx_priv.atpx.handle = atpx_handle; 460 return true; ··· 532 printk(KERN_INFO "VGA switcheroo: detected switching method %s handle\n", 533 acpi_method_name); 534 radeon_atpx_priv.atpx_detected = true; 535 return true; 536 } 537 return false;
··· 33 bool atpx_detected; 34 /* handle for device - and atpx */ 35 acpi_handle dhandle; 36 + acpi_handle other_handle; 37 struct radeon_atpx atpx; 38 } radeon_atpx_priv; 39 ··· 451 return false; 452 453 status = acpi_get_handle(dhandle, "ATPX", &atpx_handle); 454 + if (ACPI_FAILURE(status)) { 455 + radeon_atpx_priv.other_handle = dhandle; 456 return false; 457 + } 458 radeon_atpx_priv.dhandle = dhandle; 459 radeon_atpx_priv.atpx.handle = atpx_handle; 460 return true; ··· 530 printk(KERN_INFO "VGA switcheroo: detected switching method %s handle\n", 531 acpi_method_name); 532 radeon_atpx_priv.atpx_detected = true; 533 + /* 534 + * On some systems hotplug events are generated for the device 535 + * being switched off when ATPX is executed. They cause ACPI 536 + * hotplug to trigger and attempt to remove the device from 537 + * the system, which causes it to break down. Prevent that from 538 + * happening by setting the no_hotplug flag for the involved 539 + * ACPI device objects. 540 + */ 541 + acpi_bus_no_hotplug(radeon_atpx_priv.dhandle); 542 + acpi_bus_no_hotplug(radeon_atpx_priv.other_handle); 543 return true; 544 } 545 return false;
+26 -4
drivers/pci/hotplug/acpiphp_glue.c
··· 279 280 status = acpi_evaluate_integer(handle, "_ADR", NULL, &adr); 281 if (ACPI_FAILURE(status)) { 282 - acpi_handle_warn(handle, "can't evaluate _ADR (%#x)\n", status); 283 return AE_OK; 284 } 285 ··· 645 slot->flags &= (~SLOT_ENABLED); 646 } 647 648 649 /** 650 * get_slot_status - get ACPI slot status ··· 721 unsigned long long sta; 722 723 status = acpi_evaluate_integer(handle, "_STA", NULL, &sta); 724 - alive = ACPI_SUCCESS(status) && sta == ACPI_STA_ALL; 725 } 726 if (!alive) { 727 u32 v; ··· 762 struct pci_dev *dev, *tmp; 763 764 mutex_lock(&slot->crit_sect); 765 - /* wake up all functions */ 766 - if (get_slot_status(slot) == ACPI_STA_ALL) { 767 /* remove stale devices if any */ 768 list_for_each_entry_safe(dev, tmp, &bus->devices, 769 bus_list)
··· 279 280 status = acpi_evaluate_integer(handle, "_ADR", NULL, &adr); 281 if (ACPI_FAILURE(status)) { 282 + if (status != AE_NOT_FOUND) 283 + acpi_handle_warn(handle, 284 + "can't evaluate _ADR (%#x)\n", status); 285 return AE_OK; 286 } 287 ··· 643 slot->flags &= (~SLOT_ENABLED); 644 } 645 646 + static bool acpiphp_no_hotplug(acpi_handle handle) 647 + { 648 + struct acpi_device *adev = NULL; 649 + 650 + acpi_bus_get_device(handle, &adev); 651 + return adev && adev->flags.no_hotplug; 652 + } 653 + 654 + static bool slot_no_hotplug(struct acpiphp_slot *slot) 655 + { 656 + struct acpiphp_func *func; 657 + 658 + list_for_each_entry(func, &slot->funcs, sibling) 659 + if (acpiphp_no_hotplug(func_to_handle(func))) 660 + return true; 661 + 662 + return false; 663 + } 664 665 /** 666 * get_slot_status - get ACPI slot status ··· 701 unsigned long long sta; 702 703 status = acpi_evaluate_integer(handle, "_STA", NULL, &sta); 704 + alive = (ACPI_SUCCESS(status) && sta == ACPI_STA_ALL) 705 + || acpiphp_no_hotplug(handle); 706 } 707 if (!alive) { 708 u32 v; ··· 741 struct pci_dev *dev, *tmp; 742 743 mutex_lock(&slot->crit_sect); 744 + if (slot_no_hotplug(slot)) { 745 + ; /* do nothing */ 746 + } else if (get_slot_status(slot) == ACPI_STA_ALL) { 747 /* remove stale devices if any */ 748 list_for_each_entry_safe(dev, tmp, &bus->devices, 749 bus_list)
+12 -9
drivers/pci/pci-acpi.c
··· 330 static void pci_acpi_setup(struct device *dev) 331 { 332 struct pci_dev *pci_dev = to_pci_dev(dev); 333 - acpi_handle handle = ACPI_HANDLE(dev); 334 - struct acpi_device *adev; 335 336 - if (acpi_bus_get_device(handle, &adev) || !adev->wakeup.flags.valid) 337 return; 338 339 device_set_wakeup_capable(dev, true); 340 acpi_pci_sleep_wake(pci_dev, false); 341 - 342 - pci_acpi_add_pm_notifier(adev, pci_dev); 343 if (adev->wakeup.flags.run_wake) 344 device_set_run_wake(dev, true); 345 } 346 347 static void pci_acpi_cleanup(struct device *dev) 348 { 349 - acpi_handle handle = ACPI_HANDLE(dev); 350 - struct acpi_device *adev; 351 352 - if (!acpi_bus_get_device(handle, &adev) && adev->wakeup.flags.valid) { 353 device_set_wakeup_capable(dev, false); 354 device_set_run_wake(dev, false); 355 - pci_acpi_remove_pm_notifier(adev); 356 } 357 } 358
··· 330 static void pci_acpi_setup(struct device *dev) 331 { 332 struct pci_dev *pci_dev = to_pci_dev(dev); 333 + struct acpi_device *adev = ACPI_COMPANION(dev); 334 335 + if (!adev) 336 + return; 337 + 338 + pci_acpi_add_pm_notifier(adev, pci_dev); 339 + if (!adev->wakeup.flags.valid) 340 return; 341 342 device_set_wakeup_capable(dev, true); 343 acpi_pci_sleep_wake(pci_dev, false); 344 if (adev->wakeup.flags.run_wake) 345 device_set_run_wake(dev, true); 346 } 347 348 static void pci_acpi_cleanup(struct device *dev) 349 { 350 + struct acpi_device *adev = ACPI_COMPANION(dev); 351 352 + if (!adev) 353 + return; 354 + 355 + pci_acpi_remove_pm_notifier(adev); 356 + if (adev->wakeup.flags.valid) { 357 device_set_wakeup_capable(dev, false); 358 device_set_run_wake(dev, false); 359 } 360 } 361
+3 -1
include/acpi/acpi_bus.h
··· 169 u32 ejectable:1; 170 u32 power_manageable:1; 171 u32 match_driver:1; 172 - u32 reserved:27; 173 }; 174 175 /* File System */ ··· 345 extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int); 346 void acpi_bus_private_data_handler(acpi_handle, void *); 347 int acpi_bus_get_private_data(acpi_handle, void **); 348 extern int acpi_notifier_call_chain(struct acpi_device *, u32, u32); 349 extern int register_acpi_notifier(struct notifier_block *); 350 extern int unregister_acpi_notifier(struct notifier_block *);
··· 169 u32 ejectable:1; 170 u32 power_manageable:1; 171 u32 match_driver:1; 172 + u32 no_hotplug:1; 173 + u32 reserved:26; 174 }; 175 176 /* File System */ ··· 344 extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int); 345 void acpi_bus_private_data_handler(acpi_handle, void *); 346 int acpi_bus_get_private_data(acpi_handle, void **); 347 + void acpi_bus_no_hotplug(acpi_handle handle); 348 extern int acpi_notifier_call_chain(struct acpi_device *, u32, u32); 349 extern int register_acpi_notifier(struct notifier_block *); 350 extern int unregister_acpi_notifier(struct notifier_block *);