diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-01-06 13:37:50 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-01-06 13:37:50 -0500 |
commit | b937a8697b81e2e385642853b90647e1b4aef85e (patch) | |
tree | 9a2afa60a18a10a63974adb456a019be25b8db40 | |
parent | 88ba6cae15e38f609aba4f3881e1c404c432596c (diff) | |
parent | 7e2b9d85550ee267ec3b5aba6362fdaeb1559f46 (diff) |
Merge tag 'pm-4.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management fixes from Rafael Wysocki:
"These fix a few issues in the intel_pstate driver, a documetation
issue, a false-positive compiler warning in the generic power domains
framework and two problems in the devfreq subsystem. They also update
the MAINTAINERS entry for devfreq and add a new "compatible" string to
the generic cpufreq-dt driver.
Specifics:
- Fix a few intel_pstate driver issues: add missing locking it two
places, avoid exposing a useless debugfs interface and keep the
attribute values in sysfs in sync (Rafael Wysocki).
- Drop confusing kernel-doc references related to power management
and ACPI from the driver API manual (Rafael Wysocki).
- Make a false-positive compiler warning in the generic power domains
framework go away (Augusto Mecking Caringi).
- Fix two initialization issues in the devfreq subsystem and update
the MAINTAINERS entry for it (Chanwoo Choi).
- Add a new "compatible" string for APM X-Gene 2 to the generic DT
cpufreq driver (Hoan Tran)"
* tag 'pm-4.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
cpufreq: dt: Add support for APM X-Gene 2
PM / devfreq: exynos-bus: Fix the wrong return value
PM / devfreq: Fix the bug of devfreq_add_device when governor is NULL
MAINTAINERS: Add myself as reviewer for DEVFREQ subsystem support
PM / docs: Drop confusing kernel-doc references from infrastructure.rst
PM / domains: Fix 'may be used uninitialized' build warning
cpufreq: intel_pstate: Always keep all limits settings in sync
cpufreq: intel_pstate: Use locking in intel_cpufreq_verify_policy()
cpufreq: intel_pstate: Use locking in intel_pstate_resume()
cpufreq: intel_pstate: Do not expose PID parameters in passive mode
-rw-r--r-- | Documentation/driver-api/infrastructure.rst | 15 | ||||
-rw-r--r-- | MAINTAINERS | 1 | ||||
-rw-r--r-- | drivers/base/power/domain.c | 1 | ||||
-rw-r--r-- | drivers/cpufreq/cpufreq-dt-platdev.c | 2 | ||||
-rw-r--r-- | drivers/cpufreq/intel_pstate.c | 53 | ||||
-rw-r--r-- | drivers/devfreq/devfreq.c | 15 | ||||
-rw-r--r-- | drivers/devfreq/exynos-bus.c | 2 |
7 files changed, 46 insertions, 43 deletions
diff --git a/Documentation/driver-api/infrastructure.rst b/Documentation/driver-api/infrastructure.rst index 0bb0b5fc9512..6d9ff316b608 100644 --- a/Documentation/driver-api/infrastructure.rst +++ b/Documentation/driver-api/infrastructure.rst | |||
@@ -55,21 +55,6 @@ Device Drivers DMA Management | |||
55 | .. kernel-doc:: drivers/base/dma-mapping.c | 55 | .. kernel-doc:: drivers/base/dma-mapping.c |
56 | :export: | 56 | :export: |
57 | 57 | ||
58 | Device Drivers Power Management | ||
59 | ------------------------------- | ||
60 | |||
61 | .. kernel-doc:: drivers/base/power/main.c | ||
62 | :export: | ||
63 | |||
64 | Device Drivers ACPI Support | ||
65 | --------------------------- | ||
66 | |||
67 | .. kernel-doc:: drivers/acpi/scan.c | ||
68 | :export: | ||
69 | |||
70 | .. kernel-doc:: drivers/acpi/scan.c | ||
71 | :internal: | ||
72 | |||
73 | Device drivers PnP support | 58 | Device drivers PnP support |
74 | -------------------------- | 59 | -------------------------- |
75 | 60 | ||
diff --git a/MAINTAINERS b/MAINTAINERS index 9267b8fad791..a136dfbb8eea 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -3800,6 +3800,7 @@ F: include/linux/devcoredump.h | |||
3800 | DEVICE FREQUENCY (DEVFREQ) | 3800 | DEVICE FREQUENCY (DEVFREQ) |
3801 | M: MyungJoo Ham <myungjoo.ham@samsung.com> | 3801 | M: MyungJoo Ham <myungjoo.ham@samsung.com> |
3802 | M: Kyungmin Park <kyungmin.park@samsung.com> | 3802 | M: Kyungmin Park <kyungmin.park@samsung.com> |
3803 | R: Chanwoo Choi <cw00.choi@samsung.com> | ||
3803 | L: linux-pm@vger.kernel.org | 3804 | L: linux-pm@vger.kernel.org |
3804 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/mzx/devfreq.git | 3805 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/mzx/devfreq.git |
3805 | S: Maintained | 3806 | S: Maintained |
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index a5e1262b964b..2997026b4dfb 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c | |||
@@ -626,6 +626,7 @@ static int genpd_runtime_resume(struct device *dev) | |||
626 | 626 | ||
627 | out: | 627 | out: |
628 | /* Measure resume latency. */ | 628 | /* Measure resume latency. */ |
629 | time_start = 0; | ||
629 | if (timed && runtime_pm) | 630 | if (timed && runtime_pm) |
630 | time_start = ktime_get(); | 631 | time_start = ktime_get(); |
631 | 632 | ||
diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c index bc97b6a4b1cf..7fcaf26e8f81 100644 --- a/drivers/cpufreq/cpufreq-dt-platdev.c +++ b/drivers/cpufreq/cpufreq-dt-platdev.c | |||
@@ -26,6 +26,8 @@ static const struct of_device_id machines[] __initconst = { | |||
26 | { .compatible = "allwinner,sun8i-a83t", }, | 26 | { .compatible = "allwinner,sun8i-a83t", }, |
27 | { .compatible = "allwinner,sun8i-h3", }, | 27 | { .compatible = "allwinner,sun8i-h3", }, |
28 | 28 | ||
29 | { .compatible = "apm,xgene-shadowcat", }, | ||
30 | |||
29 | { .compatible = "arm,integrator-ap", }, | 31 | { .compatible = "arm,integrator-ap", }, |
30 | { .compatible = "arm,integrator-cp", }, | 32 | { .compatible = "arm,integrator-cp", }, |
31 | 33 | ||
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 6acbd4af632e..f91c25718d16 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c | |||
@@ -857,13 +857,13 @@ static struct freq_attr *hwp_cpufreq_attrs[] = { | |||
857 | NULL, | 857 | NULL, |
858 | }; | 858 | }; |
859 | 859 | ||
860 | static void intel_pstate_hwp_set(const struct cpumask *cpumask) | 860 | static void intel_pstate_hwp_set(struct cpufreq_policy *policy) |
861 | { | 861 | { |
862 | int min, hw_min, max, hw_max, cpu, range, adj_range; | 862 | int min, hw_min, max, hw_max, cpu, range, adj_range; |
863 | struct perf_limits *perf_limits = limits; | 863 | struct perf_limits *perf_limits = limits; |
864 | u64 value, cap; | 864 | u64 value, cap; |
865 | 865 | ||
866 | for_each_cpu(cpu, cpumask) { | 866 | for_each_cpu(cpu, policy->cpus) { |
867 | int max_perf_pct, min_perf_pct; | 867 | int max_perf_pct, min_perf_pct; |
868 | struct cpudata *cpu_data = all_cpu_data[cpu]; | 868 | struct cpudata *cpu_data = all_cpu_data[cpu]; |
869 | s16 epp; | 869 | s16 epp; |
@@ -949,7 +949,7 @@ skip_epp: | |||
949 | static int intel_pstate_hwp_set_policy(struct cpufreq_policy *policy) | 949 | static int intel_pstate_hwp_set_policy(struct cpufreq_policy *policy) |
950 | { | 950 | { |
951 | if (hwp_active) | 951 | if (hwp_active) |
952 | intel_pstate_hwp_set(policy->cpus); | 952 | intel_pstate_hwp_set(policy); |
953 | 953 | ||
954 | return 0; | 954 | return 0; |
955 | } | 955 | } |
@@ -968,19 +968,28 @@ static int intel_pstate_hwp_save_state(struct cpufreq_policy *policy) | |||
968 | 968 | ||
969 | static int intel_pstate_resume(struct cpufreq_policy *policy) | 969 | static int intel_pstate_resume(struct cpufreq_policy *policy) |
970 | { | 970 | { |
971 | int ret; | ||
972 | |||
971 | if (!hwp_active) | 973 | if (!hwp_active) |
972 | return 0; | 974 | return 0; |
973 | 975 | ||
976 | mutex_lock(&intel_pstate_limits_lock); | ||
977 | |||
974 | all_cpu_data[policy->cpu]->epp_policy = 0; | 978 | all_cpu_data[policy->cpu]->epp_policy = 0; |
975 | 979 | ||
976 | return intel_pstate_hwp_set_policy(policy); | 980 | ret = intel_pstate_hwp_set_policy(policy); |
981 | |||
982 | mutex_unlock(&intel_pstate_limits_lock); | ||
983 | |||
984 | return ret; | ||
977 | } | 985 | } |
978 | 986 | ||
979 | static void intel_pstate_hwp_set_online_cpus(void) | 987 | static void intel_pstate_update_policies(void) |
980 | { | 988 | { |
981 | get_online_cpus(); | 989 | int cpu; |
982 | intel_pstate_hwp_set(cpu_online_mask); | 990 | |
983 | put_online_cpus(); | 991 | for_each_possible_cpu(cpu) |
992 | cpufreq_update_policy(cpu); | ||
984 | } | 993 | } |
985 | 994 | ||
986 | /************************** debugfs begin ************************/ | 995 | /************************** debugfs begin ************************/ |
@@ -1018,10 +1027,6 @@ static void __init intel_pstate_debug_expose_params(void) | |||
1018 | struct dentry *debugfs_parent; | 1027 | struct dentry *debugfs_parent; |
1019 | int i = 0; | 1028 | int i = 0; |
1020 | 1029 | ||
1021 | if (hwp_active || | ||
1022 | pstate_funcs.get_target_pstate == get_target_pstate_use_cpu_load) | ||
1023 | return; | ||
1024 | |||
1025 | debugfs_parent = debugfs_create_dir("pstate_snb", NULL); | 1030 | debugfs_parent = debugfs_create_dir("pstate_snb", NULL); |
1026 | if (IS_ERR_OR_NULL(debugfs_parent)) | 1031 | if (IS_ERR_OR_NULL(debugfs_parent)) |
1027 | return; | 1032 | return; |
@@ -1105,11 +1110,10 @@ static ssize_t store_no_turbo(struct kobject *a, struct attribute *b, | |||
1105 | 1110 | ||
1106 | limits->no_turbo = clamp_t(int, input, 0, 1); | 1111 | limits->no_turbo = clamp_t(int, input, 0, 1); |
1107 | 1112 | ||
1108 | if (hwp_active) | ||
1109 | intel_pstate_hwp_set_online_cpus(); | ||
1110 | |||
1111 | mutex_unlock(&intel_pstate_limits_lock); | 1113 | mutex_unlock(&intel_pstate_limits_lock); |
1112 | 1114 | ||
1115 | intel_pstate_update_policies(); | ||
1116 | |||
1113 | return count; | 1117 | return count; |
1114 | } | 1118 | } |
1115 | 1119 | ||
@@ -1134,11 +1138,10 @@ static ssize_t store_max_perf_pct(struct kobject *a, struct attribute *b, | |||
1134 | limits->max_perf_pct); | 1138 | limits->max_perf_pct); |
1135 | limits->max_perf = div_ext_fp(limits->max_perf_pct, 100); | 1139 | limits->max_perf = div_ext_fp(limits->max_perf_pct, 100); |
1136 | 1140 | ||
1137 | if (hwp_active) | ||
1138 | intel_pstate_hwp_set_online_cpus(); | ||
1139 | |||
1140 | mutex_unlock(&intel_pstate_limits_lock); | 1141 | mutex_unlock(&intel_pstate_limits_lock); |
1141 | 1142 | ||
1143 | intel_pstate_update_policies(); | ||
1144 | |||
1142 | return count; | 1145 | return count; |
1143 | } | 1146 | } |
1144 | 1147 | ||
@@ -1163,11 +1166,10 @@ static ssize_t store_min_perf_pct(struct kobject *a, struct attribute *b, | |||
1163 | limits->min_perf_pct); | 1166 | limits->min_perf_pct); |
1164 | limits->min_perf = div_ext_fp(limits->min_perf_pct, 100); | 1167 | limits->min_perf = div_ext_fp(limits->min_perf_pct, 100); |
1165 | 1168 | ||
1166 | if (hwp_active) | ||
1167 | intel_pstate_hwp_set_online_cpus(); | ||
1168 | |||
1169 | mutex_unlock(&intel_pstate_limits_lock); | 1169 | mutex_unlock(&intel_pstate_limits_lock); |
1170 | 1170 | ||
1171 | intel_pstate_update_policies(); | ||
1172 | |||
1171 | return count; | 1173 | return count; |
1172 | } | 1174 | } |
1173 | 1175 | ||
@@ -2153,8 +2155,12 @@ static int intel_cpufreq_verify_policy(struct cpufreq_policy *policy) | |||
2153 | if (per_cpu_limits) | 2155 | if (per_cpu_limits) |
2154 | perf_limits = cpu->perf_limits; | 2156 | perf_limits = cpu->perf_limits; |
2155 | 2157 | ||
2158 | mutex_lock(&intel_pstate_limits_lock); | ||
2159 | |||
2156 | intel_pstate_update_perf_limits(policy, perf_limits); | 2160 | intel_pstate_update_perf_limits(policy, perf_limits); |
2157 | 2161 | ||
2162 | mutex_unlock(&intel_pstate_limits_lock); | ||
2163 | |||
2158 | return 0; | 2164 | return 0; |
2159 | } | 2165 | } |
2160 | 2166 | ||
@@ -2487,7 +2493,10 @@ hwp_cpu_matched: | |||
2487 | if (rc) | 2493 | if (rc) |
2488 | goto out; | 2494 | goto out; |
2489 | 2495 | ||
2490 | intel_pstate_debug_expose_params(); | 2496 | if (intel_pstate_driver == &intel_pstate && !hwp_active && |
2497 | pstate_funcs.get_target_pstate != get_target_pstate_use_cpu_load) | ||
2498 | intel_pstate_debug_expose_params(); | ||
2499 | |||
2491 | intel_pstate_sysfs_expose_params(); | 2500 | intel_pstate_sysfs_expose_params(); |
2492 | 2501 | ||
2493 | if (hwp_active) | 2502 | if (hwp_active) |
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index a324801d6a66..47206a21bb90 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c | |||
@@ -593,11 +593,16 @@ struct devfreq *devfreq_add_device(struct device *dev, | |||
593 | list_add(&devfreq->node, &devfreq_list); | 593 | list_add(&devfreq->node, &devfreq_list); |
594 | 594 | ||
595 | governor = find_devfreq_governor(devfreq->governor_name); | 595 | governor = find_devfreq_governor(devfreq->governor_name); |
596 | if (!IS_ERR(governor)) | 596 | if (IS_ERR(governor)) { |
597 | devfreq->governor = governor; | 597 | dev_err(dev, "%s: Unable to find governor for the device\n", |
598 | if (devfreq->governor) | 598 | __func__); |
599 | err = devfreq->governor->event_handler(devfreq, | 599 | err = PTR_ERR(governor); |
600 | DEVFREQ_GOV_START, NULL); | 600 | goto err_init; |
601 | } | ||
602 | |||
603 | devfreq->governor = governor; | ||
604 | err = devfreq->governor->event_handler(devfreq, DEVFREQ_GOV_START, | ||
605 | NULL); | ||
601 | if (err) { | 606 | if (err) { |
602 | dev_err(dev, "%s: Unable to start governor for the device\n", | 607 | dev_err(dev, "%s: Unable to start governor for the device\n", |
603 | __func__); | 608 | __func__); |
diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c index a8ed7792ece2..9af86f46fbec 100644 --- a/drivers/devfreq/exynos-bus.c +++ b/drivers/devfreq/exynos-bus.c | |||
@@ -497,7 +497,7 @@ passive: | |||
497 | if (IS_ERR(bus->devfreq)) { | 497 | if (IS_ERR(bus->devfreq)) { |
498 | dev_err(dev, | 498 | dev_err(dev, |
499 | "failed to add devfreq dev with passive governor\n"); | 499 | "failed to add devfreq dev with passive governor\n"); |
500 | ret = -EPROBE_DEFER; | 500 | ret = PTR_ERR(bus->devfreq); |
501 | goto err; | 501 | goto err; |
502 | } | 502 | } |
503 | 503 | ||