aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/idle/intel_idle.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-07-04 16:39:41 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-07-04 16:39:41 -0400
commit408c9861c6979db974455b9e7a9bcadd60e0934c (patch)
tree9bdb862da2883cd4f74297d01ec8ce3b4619dd66 /drivers/idle/intel_idle.c
parentb39de277b02ffd8e3dccb01e9159bd45cb07b95d (diff)
parent8f8e5c3e2796eaf150d6262115af12707c2616dd (diff)
Merge tag 'pm-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management updates from Rafael Wysocki: "The big ticket items here are the rework of suspend-to-idle in order to add proper support for power button wakeup from it on recent Dell laptops and the rework of interfaces exporting the current CPU frequency on x86. In addition to that, support for a few new pieces of hardware is added, the PCI/ACPI device wakeup infrastructure is simplified significantly and the wakeup IRQ framework is fixed to unbreak the IRQ bus locking infrastructure. Also, there are some functional improvements for intel_pstate, tools updates and small fixes and cleanups all over. Specifics: - Rework suspend-to-idle to allow it to take wakeup events signaled by the EC into account on ACPI-based platforms in order to properly support power button wakeup from suspend-to-idle on recent Dell laptops (Rafael Wysocki). That includes the core suspend-to-idle code rework, support for the Low Power S0 _DSM interface, and support for the ACPI INT0002 Virtual GPIO device from Hans de Goede (required for USB keyboard wakeup from suspend-to-idle to work on some machines). - Stop trying to export the current CPU frequency via /proc/cpuinfo on x86 as that is inaccurate and confusing (Len Brown). - Rework the way in which the current CPU frequency is exported by the kernel (over the cpufreq sysfs interface) on x86 systems with the APERF and MPERF registers by always using values read from these registers, when available, to compute the current frequency regardless of which cpufreq driver is in use (Len Brown). - Rework the PCI/ACPI device wakeup infrastructure to remove the questionable and artificial distinction between "devices that can wake up the system from sleep states" and "devices that can generate wakeup signals in the working state" from it, which allows the code to be simplified quite a bit (Rafael Wysocki). - Fix the wakeup IRQ framework by making it use SRCU instead of RCU which doesn't allow sleeping in the read-side critical sections, but which in turn is expected to be allowed by the IRQ bus locking infrastructure (Thomas Gleixner). - Modify some computations in the intel_pstate driver to avoid rounding errors resulting from them (Srinivas Pandruvada). - Reduce the overhead of the intel_pstate driver in the HWP (hardware-managed P-states) mode and when the "performance" P-state selection algorithm is in use by making it avoid registering scheduler callbacks in those cases (Len Brown). - Rework the energy_performance_preference sysfs knob in intel_pstate by changing the values that correspond to different symbolic hint names used by it (Len Brown). - Make it possible to use more than one cpuidle driver at the same time on ARM (Daniel Lezcano). - Make it possible to prevent the cpuidle menu governor from using the 0 state by disabling it via sysfs (Nicholas Piggin). - Add support for FFH (Fixed Functional Hardware) MWAIT in ACPI C1 on AMD systems (Yazen Ghannam). - Make the CPPC cpufreq driver take the lowest nonlinear performance information into account (Prashanth Prakash). - Add support for hi3660 to the cpufreq-dt driver, fix the imx6q driver and clean up the sfi, exynos5440 and intel_pstate drivers (Colin Ian King, Krzysztof Kozlowski, Octavian Purdila, Rafael Wysocki, Tao Wang). - Fix a few minor issues in the generic power domains (genpd) framework and clean it up somewhat (Krzysztof Kozlowski, Mikko Perttunen, Viresh Kumar). - Fix a couple of minor issues in the operating performance points (OPP) framework and clean it up somewhat (Viresh Kumar). - Fix a CONFIG dependency in the hibernation core and clean it up slightly (Balbir Singh, Arvind Yadav, BaoJun Luo). - Add rk3228 support to the rockchip-io adaptive voltage scaling (AVS) driver (David Wu). - Fix an incorrect bit shift operation in the RAPL power capping driver (Adam Lessnau). - Add support for the EPP field in the HWP (hardware managed P-states) control register, HWP.EPP, to the x86_energy_perf_policy tool and update msr-index.h with HWP.EPP values (Len Brown). - Fix some minor issues in the turbostat tool (Len Brown). - Add support for AMD family 0x17 CPUs to the cpupower tool and fix a minor issue in it (Sherry Hurwitz). - Assorted cleanups, mostly related to the constification of some data structures (Arvind Yadav, Joe Perches, Kees Cook, Krzysztof Kozlowski)" * tag 'pm-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (69 commits) cpufreq: Update scaling_cur_freq documentation cpufreq: intel_pstate: Clean up after performance governor changes PM: hibernate: constify attribute_group structures. cpuidle: menu: allow state 0 to be disabled intel_idle: Use more common logging style PM / Domains: Fix missing default_power_down_ok comment PM / Domains: Fix unsafe iteration over modified list of domains PM / Domains: Fix unsafe iteration over modified list of domain providers PM / Domains: Fix unsafe iteration over modified list of device links PM / Domains: Handle safely genpd_syscore_switch() call on non-genpd device PM / Domains: Call driver's noirq callbacks PM / core: Drop run_wake flag from struct dev_pm_info PCI / PM: Simplify device wakeup settings code PCI / PM: Drop pme_interrupt flag from struct pci_dev ACPI / PM: Consolidate device wakeup settings code ACPI / PM: Drop run_wake from struct acpi_device_wakeup_flags PM / QoS: constify *_attribute_group. PM / AVS: rockchip-io: add io selectors and supplies for rk3228 powercap/RAPL: prevent overridding bits outside of the mask PM / sysfs: Constify attribute groups ...
Diffstat (limited to 'drivers/idle/intel_idle.c')
-rw-r--r--drivers/idle/intel_idle.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index 216d7ec88c0c..c2ae819a871c 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -51,6 +51,8 @@
51/* un-comment DEBUG to enable pr_debug() statements */ 51/* un-comment DEBUG to enable pr_debug() statements */
52#define DEBUG 52#define DEBUG
53 53
54#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
55
54#include <linux/kernel.h> 56#include <linux/kernel.h>
55#include <linux/cpuidle.h> 57#include <linux/cpuidle.h>
56#include <linux/tick.h> 58#include <linux/tick.h>
@@ -65,7 +67,6 @@
65#include <asm/msr.h> 67#include <asm/msr.h>
66 68
67#define INTEL_IDLE_VERSION "0.4.1" 69#define INTEL_IDLE_VERSION "0.4.1"
68#define PREFIX "intel_idle: "
69 70
70static struct cpuidle_driver intel_idle_driver = { 71static struct cpuidle_driver intel_idle_driver = {
71 .name = "intel_idle", 72 .name = "intel_idle",
@@ -1111,7 +1112,7 @@ static int __init intel_idle_probe(void)
1111 const struct x86_cpu_id *id; 1112 const struct x86_cpu_id *id;
1112 1113
1113 if (max_cstate == 0) { 1114 if (max_cstate == 0) {
1114 pr_debug(PREFIX "disabled\n"); 1115 pr_debug("disabled\n");
1115 return -EPERM; 1116 return -EPERM;
1116 } 1117 }
1117 1118
@@ -1119,8 +1120,8 @@ static int __init intel_idle_probe(void)
1119 if (!id) { 1120 if (!id) {
1120 if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL && 1121 if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
1121 boot_cpu_data.x86 == 6) 1122 boot_cpu_data.x86 == 6)
1122 pr_debug(PREFIX "does not run on family %d model %d\n", 1123 pr_debug("does not run on family %d model %d\n",
1123 boot_cpu_data.x86, boot_cpu_data.x86_model); 1124 boot_cpu_data.x86, boot_cpu_data.x86_model);
1124 return -ENODEV; 1125 return -ENODEV;
1125 } 1126 }
1126 1127
@@ -1134,13 +1135,13 @@ static int __init intel_idle_probe(void)
1134 !mwait_substates) 1135 !mwait_substates)
1135 return -ENODEV; 1136 return -ENODEV;
1136 1137
1137 pr_debug(PREFIX "MWAIT substates: 0x%x\n", mwait_substates); 1138 pr_debug("MWAIT substates: 0x%x\n", mwait_substates);
1138 1139
1139 icpu = (const struct idle_cpu *)id->driver_data; 1140 icpu = (const struct idle_cpu *)id->driver_data;
1140 cpuidle_state_table = icpu->state_table; 1141 cpuidle_state_table = icpu->state_table;
1141 1142
1142 pr_debug(PREFIX "v" INTEL_IDLE_VERSION 1143 pr_debug("v" INTEL_IDLE_VERSION " model 0x%X\n",
1143 " model 0x%X\n", boot_cpu_data.x86_model); 1144 boot_cpu_data.x86_model);
1144 1145
1145 return 0; 1146 return 0;
1146} 1147}
@@ -1340,8 +1341,7 @@ static void __init intel_idle_cpuidle_driver_init(void)
1340 break; 1341 break;
1341 1342
1342 if (cstate + 1 > max_cstate) { 1343 if (cstate + 1 > max_cstate) {
1343 printk(PREFIX "max_cstate %d reached\n", 1344 pr_info("max_cstate %d reached\n", max_cstate);
1344 max_cstate);
1345 break; 1345 break;
1346 } 1346 }
1347 1347
@@ -1358,8 +1358,8 @@ static void __init intel_idle_cpuidle_driver_init(void)
1358 1358
1359 /* if state marked as disabled, skip it */ 1359 /* if state marked as disabled, skip it */
1360 if (cpuidle_state_table[cstate].disabled != 0) { 1360 if (cpuidle_state_table[cstate].disabled != 0) {
1361 pr_debug(PREFIX "state %s is disabled", 1361 pr_debug("state %s is disabled\n",
1362 cpuidle_state_table[cstate].name); 1362 cpuidle_state_table[cstate].name);
1363 continue; 1363 continue;
1364 } 1364 }
1365 1365
@@ -1395,7 +1395,7 @@ static int intel_idle_cpu_init(unsigned int cpu)
1395 dev->cpu = cpu; 1395 dev->cpu = cpu;
1396 1396
1397 if (cpuidle_register_device(dev)) { 1397 if (cpuidle_register_device(dev)) {
1398 pr_debug(PREFIX "cpuidle_register_device %d failed!\n", cpu); 1398 pr_debug("cpuidle_register_device %d failed!\n", cpu);
1399 return -EIO; 1399 return -EIO;
1400 } 1400 }
1401 1401
@@ -1447,8 +1447,8 @@ static int __init intel_idle_init(void)
1447 retval = cpuidle_register_driver(&intel_idle_driver); 1447 retval = cpuidle_register_driver(&intel_idle_driver);
1448 if (retval) { 1448 if (retval) {
1449 struct cpuidle_driver *drv = cpuidle_get_driver(); 1449 struct cpuidle_driver *drv = cpuidle_get_driver();
1450 printk(KERN_DEBUG PREFIX "intel_idle yielding to %s", 1450 printk(KERN_DEBUG pr_fmt("intel_idle yielding to %s\n"),
1451 drv ? drv->name : "none"); 1451 drv ? drv->name : "none");
1452 goto init_driver_fail; 1452 goto init_driver_fail;
1453 } 1453 }
1454 1454
@@ -1460,8 +1460,8 @@ static int __init intel_idle_init(void)
1460 if (retval < 0) 1460 if (retval < 0)
1461 goto hp_setup_fail; 1461 goto hp_setup_fail;
1462 1462
1463 pr_debug(PREFIX "lapic_timer_reliable_states 0x%x\n", 1463 pr_debug("lapic_timer_reliable_states 0x%x\n",
1464 lapic_timer_reliable_states); 1464 lapic_timer_reliable_states);
1465 1465
1466 return 0; 1466 return 0;
1467 1467