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.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management and ACPI fixes from Rafael Wysocki:

- Additional CPU ID for the intel_pstate driver from Dirk Brandewie.

- More cpufreq fixes related to ARM big.LITTLE support and locking from
Viresh Kumar.

- VIA C7 cpufreq build fix from Rafał Bilski.

- ACPI power management fix making it possible to use device power
states regardless of the CONFIG_PM setting from Rafael J Wysocki.

- New ACPI video blacklist item from Bastian Triller.

* tag 'pm+acpi-3.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPI / video: Add "Asus UL30A" to ACPI video detect blacklist
cpufreq: arm_big_little_dt: Instantiate as platform_driver
cpufreq: arm_big_little_dt: Register driver only if DT has valid data
cpufreq / e_powersaver: Fix linker error when ACPI processor is a module
cpufreq / intel_pstate: Add additional supported CPU ID
cpufreq: Drop rwsem lock around CPUFREQ_GOV_POLICY_EXIT
ACPI / PM: Allow device power states to be used for CONFIG_PM unset

+155 -148
+1 -1
drivers/acpi/Makefile
··· 24 24 # Power management related files 25 25 acpi-y += wakeup.o 26 26 acpi-y += sleep.o 27 - acpi-$(CONFIG_PM) += device_pm.o 27 + acpi-y += device_pm.o 28 28 acpi-$(CONFIG_ACPI_SLEEP) += proc.o 29 29 30 30
+64 -62
drivers/acpi/device_pm.c
··· 37 37 #define _COMPONENT ACPI_POWER_COMPONENT 38 38 ACPI_MODULE_NAME("device_pm"); 39 39 40 - static DEFINE_MUTEX(acpi_pm_notifier_lock); 41 - 42 - /** 43 - * acpi_add_pm_notifier - Register PM notifier for given ACPI device. 44 - * @adev: ACPI device to add the notifier for. 45 - * @context: Context information to pass to the notifier routine. 46 - * 47 - * NOTE: @adev need not be a run-wake or wakeup device to be a valid source of 48 - * PM wakeup events. For example, wakeup events may be generated for bridges 49 - * if one of the devices below the bridge is signaling wakeup, even if the 50 - * bridge itself doesn't have a wakeup GPE associated with it. 51 - */ 52 - acpi_status acpi_add_pm_notifier(struct acpi_device *adev, 53 - acpi_notify_handler handler, void *context) 54 - { 55 - acpi_status status = AE_ALREADY_EXISTS; 56 - 57 - mutex_lock(&acpi_pm_notifier_lock); 58 - 59 - if (adev->wakeup.flags.notifier_present) 60 - goto out; 61 - 62 - status = acpi_install_notify_handler(adev->handle, 63 - ACPI_SYSTEM_NOTIFY, 64 - handler, context); 65 - if (ACPI_FAILURE(status)) 66 - goto out; 67 - 68 - adev->wakeup.flags.notifier_present = true; 69 - 70 - out: 71 - mutex_unlock(&acpi_pm_notifier_lock); 72 - return status; 73 - } 74 - 75 - /** 76 - * acpi_remove_pm_notifier - Unregister PM notifier from given ACPI device. 77 - * @adev: ACPI device to remove the notifier from. 78 - */ 79 - acpi_status acpi_remove_pm_notifier(struct acpi_device *adev, 80 - acpi_notify_handler handler) 81 - { 82 - acpi_status status = AE_BAD_PARAMETER; 83 - 84 - mutex_lock(&acpi_pm_notifier_lock); 85 - 86 - if (!adev->wakeup.flags.notifier_present) 87 - goto out; 88 - 89 - status = acpi_remove_notify_handler(adev->handle, 90 - ACPI_SYSTEM_NOTIFY, 91 - handler); 92 - if (ACPI_FAILURE(status)) 93 - goto out; 94 - 95 - adev->wakeup.flags.notifier_present = false; 96 - 97 - out: 98 - mutex_unlock(&acpi_pm_notifier_lock); 99 - return status; 100 - } 101 - 102 40 /** 103 41 * acpi_power_state_string - String representation of ACPI device power state. 104 42 * @state: ACPI device power state to return the string representation of. ··· 322 384 return result ? false : device->flags.power_manageable; 323 385 } 324 386 EXPORT_SYMBOL(acpi_bus_power_manageable); 387 + 388 + #ifdef CONFIG_PM 389 + static DEFINE_MUTEX(acpi_pm_notifier_lock); 390 + 391 + /** 392 + * acpi_add_pm_notifier - Register PM notifier for given ACPI device. 393 + * @adev: ACPI device to add the notifier for. 394 + * @context: Context information to pass to the notifier routine. 395 + * 396 + * NOTE: @adev need not be a run-wake or wakeup device to be a valid source of 397 + * PM wakeup events. For example, wakeup events may be generated for bridges 398 + * if one of the devices below the bridge is signaling wakeup, even if the 399 + * bridge itself doesn't have a wakeup GPE associated with it. 400 + */ 401 + acpi_status acpi_add_pm_notifier(struct acpi_device *adev, 402 + acpi_notify_handler handler, void *context) 403 + { 404 + acpi_status status = AE_ALREADY_EXISTS; 405 + 406 + mutex_lock(&acpi_pm_notifier_lock); 407 + 408 + if (adev->wakeup.flags.notifier_present) 409 + goto out; 410 + 411 + status = acpi_install_notify_handler(adev->handle, 412 + ACPI_SYSTEM_NOTIFY, 413 + handler, context); 414 + if (ACPI_FAILURE(status)) 415 + goto out; 416 + 417 + adev->wakeup.flags.notifier_present = true; 418 + 419 + out: 420 + mutex_unlock(&acpi_pm_notifier_lock); 421 + return status; 422 + } 423 + 424 + /** 425 + * acpi_remove_pm_notifier - Unregister PM notifier from given ACPI device. 426 + * @adev: ACPI device to remove the notifier from. 427 + */ 428 + acpi_status acpi_remove_pm_notifier(struct acpi_device *adev, 429 + acpi_notify_handler handler) 430 + { 431 + acpi_status status = AE_BAD_PARAMETER; 432 + 433 + mutex_lock(&acpi_pm_notifier_lock); 434 + 435 + if (!adev->wakeup.flags.notifier_present) 436 + goto out; 437 + 438 + status = acpi_remove_notify_handler(adev->handle, 439 + ACPI_SYSTEM_NOTIFY, 440 + handler); 441 + if (ACPI_FAILURE(status)) 442 + goto out; 443 + 444 + adev->wakeup.flags.notifier_present = false; 445 + 446 + out: 447 + mutex_unlock(&acpi_pm_notifier_lock); 448 + return status; 449 + } 325 450 326 451 bool acpi_bus_can_wakeup(acpi_handle handle) 327 452 { ··· 1024 1023 mutex_unlock(&adev->physical_node_lock); 1025 1024 } 1026 1025 EXPORT_SYMBOL_GPL(acpi_dev_pm_remove_dependent); 1026 + #endif /* CONFIG_PM */
+8
drivers/acpi/video_detect.c
··· 161 161 DMI_MATCH(DMI_PRODUCT_NAME, "UL30VT"), 162 162 }, 163 163 }, 164 + { 165 + .callback = video_detect_force_vendor, 166 + .ident = "Asus UL30A", 167 + .matches = { 168 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."), 169 + DMI_MATCH(DMI_PRODUCT_NAME, "UL30A"), 170 + }, 171 + }, 164 172 { }, 165 173 }; 166 174
+1 -1
drivers/cpufreq/Kconfig.x86
··· 272 272 config X86_E_POWERSAVER 273 273 tristate "VIA C7 Enhanced PowerSaver (DANGEROUS)" 274 274 select CPU_FREQ_TABLE 275 - depends on X86_32 275 + depends on X86_32 && ACPI_PROCESSOR 276 276 help 277 277 This adds the CPUFreq driver for VIA C7 processors. However, this driver 278 278 does not have any safeguards to prevent operating the CPU out of spec
+68 -47
drivers/cpufreq/arm_big_little_dt.c
··· 19 19 20 20 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 21 21 22 + #include <linux/cpu.h> 22 23 #include <linux/cpufreq.h> 23 24 #include <linux/device.h> 24 25 #include <linux/export.h> 25 26 #include <linux/module.h> 26 27 #include <linux/of.h> 27 28 #include <linux/opp.h> 29 + #include <linux/platform_device.h> 28 30 #include <linux/slab.h> 29 31 #include <linux/types.h> 30 32 #include "arm_big_little.h" 31 33 32 - static int dt_init_opp_table(struct device *cpu_dev) 34 + /* get cpu node with valid operating-points */ 35 + static struct device_node *get_cpu_node_with_valid_op(int cpu) 33 36 { 34 - struct device_node *np, *parent; 35 - int count = 0, ret; 36 - 37 - parent = of_find_node_by_path("/cpus"); 38 - if (!parent) { 39 - pr_err("failed to find OF /cpus\n"); 40 - return -ENOENT; 41 - } 42 - 43 - for_each_child_of_node(parent, np) { 44 - if (count++ != cpu_dev->id) 45 - continue; 46 - if (!of_get_property(np, "operating-points", NULL)) { 47 - ret = -ENODATA; 48 - } else { 49 - cpu_dev->of_node = np; 50 - ret = of_init_opp_table(cpu_dev); 51 - } 52 - of_node_put(np); 53 - of_node_put(parent); 54 - 55 - return ret; 56 - } 57 - 58 - return -ENODEV; 59 - } 60 - 61 - static int dt_get_transition_latency(struct device *cpu_dev) 62 - { 63 - struct device_node *np, *parent; 64 - u32 transition_latency = CPUFREQ_ETERNAL; 37 + struct device_node *np = NULL, *parent; 65 38 int count = 0; 66 39 67 40 parent = of_find_node_by_path("/cpus"); 68 41 if (!parent) { 69 - pr_info("Failed to find OF /cpus. Use CPUFREQ_ETERNAL transition latency\n"); 70 - return CPUFREQ_ETERNAL; 42 + pr_err("failed to find OF /cpus\n"); 43 + return NULL; 71 44 } 72 45 73 46 for_each_child_of_node(parent, np) { 74 - if (count++ != cpu_dev->id) 47 + if (count++ != cpu) 75 48 continue; 49 + if (!of_get_property(np, "operating-points", NULL)) { 50 + of_node_put(np); 51 + np = NULL; 52 + } 76 53 77 - of_property_read_u32(np, "clock-latency", &transition_latency); 78 - of_node_put(np); 79 - of_node_put(parent); 80 - 81 - return transition_latency; 54 + break; 82 55 } 83 56 84 - pr_info("clock-latency isn't found, use CPUFREQ_ETERNAL transition latency\n"); 85 - return CPUFREQ_ETERNAL; 57 + of_node_put(parent); 58 + return np; 59 + } 60 + 61 + static int dt_init_opp_table(struct device *cpu_dev) 62 + { 63 + struct device_node *np; 64 + int ret; 65 + 66 + np = get_cpu_node_with_valid_op(cpu_dev->id); 67 + if (!np) 68 + return -ENODATA; 69 + 70 + cpu_dev->of_node = np; 71 + ret = of_init_opp_table(cpu_dev); 72 + of_node_put(np); 73 + 74 + return ret; 75 + } 76 + 77 + static int dt_get_transition_latency(struct device *cpu_dev) 78 + { 79 + struct device_node *np; 80 + u32 transition_latency = CPUFREQ_ETERNAL; 81 + 82 + np = get_cpu_node_with_valid_op(cpu_dev->id); 83 + if (!np) 84 + return CPUFREQ_ETERNAL; 85 + 86 + of_property_read_u32(np, "clock-latency", &transition_latency); 87 + of_node_put(np); 88 + 89 + pr_debug("%s: clock-latency: %d\n", __func__, transition_latency); 90 + return transition_latency; 86 91 } 87 92 88 93 static struct cpufreq_arm_bL_ops dt_bL_ops = { ··· 96 91 .init_opp_table = dt_init_opp_table, 97 92 }; 98 93 99 - static int generic_bL_init(void) 94 + static int generic_bL_probe(struct platform_device *pdev) 100 95 { 96 + struct device_node *np; 97 + 98 + np = get_cpu_node_with_valid_op(0); 99 + if (!np) 100 + return -ENODEV; 101 + 102 + of_node_put(np); 101 103 return bL_cpufreq_register(&dt_bL_ops); 102 104 } 103 - module_init(generic_bL_init); 104 105 105 - static void generic_bL_exit(void) 106 + static int generic_bL_remove(struct platform_device *pdev) 106 107 { 107 - return bL_cpufreq_unregister(&dt_bL_ops); 108 + bL_cpufreq_unregister(&dt_bL_ops); 109 + return 0; 108 110 } 109 - module_exit(generic_bL_exit); 111 + 112 + static struct platform_driver generic_bL_platdrv = { 113 + .driver = { 114 + .name = "arm-bL-cpufreq-dt", 115 + .owner = THIS_MODULE, 116 + }, 117 + .probe = generic_bL_probe, 118 + .remove = generic_bL_remove, 119 + }; 120 + module_platform_driver(generic_bL_platdrv); 110 121 111 122 MODULE_AUTHOR("Viresh Kumar <viresh.kumar@linaro.org>"); 112 123 MODULE_DESCRIPTION("Generic ARM big LITTLE cpufreq driver via DT");
+7 -2
drivers/cpufreq/cpufreq.c
··· 1729 1729 /* end old governor */ 1730 1730 if (data->governor) { 1731 1731 __cpufreq_governor(data, CPUFREQ_GOV_STOP); 1732 + unlock_policy_rwsem_write(policy->cpu); 1732 1733 __cpufreq_governor(data, 1733 1734 CPUFREQ_GOV_POLICY_EXIT); 1735 + lock_policy_rwsem_write(policy->cpu); 1734 1736 } 1735 1737 1736 1738 /* start new governor */ 1737 1739 data->governor = policy->governor; 1738 1740 if (!__cpufreq_governor(data, CPUFREQ_GOV_POLICY_INIT)) { 1739 - if (!__cpufreq_governor(data, CPUFREQ_GOV_START)) 1741 + if (!__cpufreq_governor(data, CPUFREQ_GOV_START)) { 1740 1742 failed = 0; 1741 - else 1743 + } else { 1744 + unlock_policy_rwsem_write(policy->cpu); 1742 1745 __cpufreq_governor(data, 1743 1746 CPUFREQ_GOV_POLICY_EXIT); 1747 + lock_policy_rwsem_write(policy->cpu); 1748 + } 1744 1749 } 1745 1750 1746 1751 if (failed) {
+1
drivers/cpufreq/intel_pstate.c
··· 521 521 static const struct x86_cpu_id intel_pstate_cpu_ids[] = { 522 522 ICPU(0x2a, default_policy), 523 523 ICPU(0x2d, default_policy), 524 + ICPU(0x3a, default_policy), 524 525 {} 525 526 }; 526 527 MODULE_DEVICE_TABLE(x86cpu, intel_pstate_cpu_ids);
+5 -35
include/acpi/acpi_bus.h
··· 377 377 unsigned long long *sta); 378 378 int acpi_bus_get_status(struct acpi_device *device); 379 379 380 - #ifdef CONFIG_PM 381 380 int acpi_bus_set_power(acpi_handle handle, int state); 382 381 const char *acpi_power_state_string(int state); 383 382 int acpi_device_get_power(struct acpi_device *device, int *state); ··· 384 385 int acpi_bus_init_power(struct acpi_device *device); 385 386 int acpi_bus_update_power(acpi_handle handle, int *state_p); 386 387 bool acpi_bus_power_manageable(acpi_handle handle); 388 + 389 + #ifdef CONFIG_PM 387 390 bool acpi_bus_can_wakeup(acpi_handle handle); 388 - #else /* !CONFIG_PM */ 389 - static inline int acpi_bus_set_power(acpi_handle handle, int state) 390 - { 391 - return 0; 392 - } 393 - static inline const char *acpi_power_state_string(int state) 394 - { 395 - return "D0"; 396 - } 397 - static inline int acpi_device_get_power(struct acpi_device *device, int *state) 398 - { 399 - return 0; 400 - } 401 - static inline int acpi_device_set_power(struct acpi_device *device, int state) 402 - { 403 - return 0; 404 - } 405 - static inline int acpi_bus_init_power(struct acpi_device *device) 406 - { 407 - return 0; 408 - } 409 - static inline int acpi_bus_update_power(acpi_handle handle, int *state_p) 410 - { 411 - return 0; 412 - } 413 - static inline bool acpi_bus_power_manageable(acpi_handle handle) 414 - { 415 - return false; 416 - } 417 - static inline bool acpi_bus_can_wakeup(acpi_handle handle) 418 - { 419 - return false; 420 - } 421 - #endif /* !CONFIG_PM */ 391 + #else 392 + static inline bool acpi_bus_can_wakeup(acpi_handle handle) { return false; } 393 + #endif 422 394 423 395 #ifdef CONFIG_ACPI_PROC_EVENT 424 396 int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data);