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-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

+46 -43
-15
Documentation/driver-api/infrastructure.rst
··· 55 55 .. kernel-doc:: drivers/base/dma-mapping.c 56 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 58 Device drivers PnP support 74 59 -------------------------- 75 60
+1
MAINTAINERS
··· 3800 3800 DEVICE FREQUENCY (DEVFREQ) 3801 3801 M: MyungJoo Ham <myungjoo.ham@samsung.com> 3802 3802 M: Kyungmin Park <kyungmin.park@samsung.com> 3803 + R: Chanwoo Choi <cw00.choi@samsung.com> 3803 3804 L: linux-pm@vger.kernel.org 3804 3805 T: git git://git.kernel.org/pub/scm/linux/kernel/git/mzx/devfreq.git 3805 3806 S: Maintained
+1
drivers/base/power/domain.c
··· 626 626 627 627 out: 628 628 /* Measure resume latency. */ 629 + time_start = 0; 629 630 if (timed && runtime_pm) 630 631 time_start = ktime_get(); 631 632
+2
drivers/cpufreq/cpufreq-dt-platdev.c
··· 26 26 { .compatible = "allwinner,sun8i-a83t", }, 27 27 { .compatible = "allwinner,sun8i-h3", }, 28 28 29 + { .compatible = "apm,xgene-shadowcat", }, 30 + 29 31 { .compatible = "arm,integrator-ap", }, 30 32 { .compatible = "arm,integrator-cp", }, 31 33
+31 -22
drivers/cpufreq/intel_pstate.c
··· 857 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 862 int min, hw_min, max, hw_max, cpu, range, adj_range; 863 863 struct perf_limits *perf_limits = limits; 864 864 u64 value, cap; 865 865 866 - for_each_cpu(cpu, cpumask) { 866 + for_each_cpu(cpu, policy->cpus) { 867 867 int max_perf_pct, min_perf_pct; 868 868 struct cpudata *cpu_data = all_cpu_data[cpu]; 869 869 s16 epp; ··· 949 949 static int intel_pstate_hwp_set_policy(struct cpufreq_policy *policy) 950 950 { 951 951 if (hwp_active) 952 - intel_pstate_hwp_set(policy->cpus); 952 + intel_pstate_hwp_set(policy); 953 953 954 954 return 0; 955 955 } ··· 968 968 969 969 static int intel_pstate_resume(struct cpufreq_policy *policy) 970 970 { 971 + int ret; 972 + 971 973 if (!hwp_active) 972 974 return 0; 973 975 976 + mutex_lock(&intel_pstate_limits_lock); 977 + 974 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(); 982 - intel_pstate_hwp_set(cpu_online_mask); 983 - put_online_cpus(); 989 + int cpu; 990 + 991 + for_each_possible_cpu(cpu) 992 + cpufreq_update_policy(cpu); 984 993 } 985 994 986 995 /************************** debugfs begin ************************/ ··· 1026 1017 { 1027 1018 struct dentry *debugfs_parent; 1028 1019 int i = 0; 1029 - 1030 - if (hwp_active || 1031 - pstate_funcs.get_target_pstate == get_target_pstate_use_cpu_load) 1032 - return; 1033 1020 1034 1021 debugfs_parent = debugfs_create_dir("pstate_snb", NULL); 1035 1022 if (IS_ERR_OR_NULL(debugfs_parent)) ··· 1110 1105 1111 1106 limits->no_turbo = clamp_t(int, input, 0, 1); 1112 1107 1113 - if (hwp_active) 1114 - intel_pstate_hwp_set_online_cpus(); 1115 - 1116 1108 mutex_unlock(&intel_pstate_limits_lock); 1109 + 1110 + intel_pstate_update_policies(); 1117 1111 1118 1112 return count; 1119 1113 } ··· 1138 1134 limits->max_perf_pct); 1139 1135 limits->max_perf = div_ext_fp(limits->max_perf_pct, 100); 1140 1136 1141 - if (hwp_active) 1142 - intel_pstate_hwp_set_online_cpus(); 1143 - 1144 1137 mutex_unlock(&intel_pstate_limits_lock); 1138 + 1139 + intel_pstate_update_policies(); 1145 1140 1146 1141 return count; 1147 1142 } ··· 1166 1163 limits->min_perf_pct); 1167 1164 limits->min_perf = div_ext_fp(limits->min_perf_pct, 100); 1168 1165 1169 - if (hwp_active) 1170 - intel_pstate_hwp_set_online_cpus(); 1171 - 1172 1166 mutex_unlock(&intel_pstate_limits_lock); 1167 + 1168 + intel_pstate_update_policies(); 1173 1169 1174 1170 return count; 1175 1171 } ··· 2155 2153 if (per_cpu_limits) 2156 2154 perf_limits = cpu->perf_limits; 2157 2155 2156 + mutex_lock(&intel_pstate_limits_lock); 2157 + 2158 2158 intel_pstate_update_perf_limits(policy, perf_limits); 2159 + 2160 + mutex_unlock(&intel_pstate_limits_lock); 2159 2161 2160 2162 return 0; 2161 2163 } ··· 2493 2487 if (rc) 2494 2488 goto out; 2495 2489 2496 - intel_pstate_debug_expose_params(); 2490 + if (intel_pstate_driver == &intel_pstate && !hwp_active && 2491 + pstate_funcs.get_target_pstate != get_target_pstate_use_cpu_load) 2492 + intel_pstate_debug_expose_params(); 2493 + 2497 2494 intel_pstate_sysfs_expose_params(); 2498 2495 2499 2496 if (hwp_active)
+10 -5
drivers/devfreq/devfreq.c
··· 593 593 list_add(&devfreq->node, &devfreq_list); 594 594 595 595 governor = find_devfreq_governor(devfreq->governor_name); 596 - if (!IS_ERR(governor)) 597 - devfreq->governor = governor; 598 - if (devfreq->governor) 599 - err = devfreq->governor->event_handler(devfreq, 600 - DEVFREQ_GOV_START, NULL); 596 + if (IS_ERR(governor)) { 597 + dev_err(dev, "%s: Unable to find governor for the device\n", 598 + __func__); 599 + err = PTR_ERR(governor); 600 + goto err_init; 601 + } 602 + 603 + devfreq->governor = governor; 604 + err = devfreq->governor->event_handler(devfreq, DEVFREQ_GOV_START, 605 + NULL); 601 606 if (err) { 602 607 dev_err(dev, "%s: Unable to start governor for the device\n", 603 608 __func__);
+1 -1
drivers/devfreq/exynos-bus.c
··· 497 497 if (IS_ERR(bus->devfreq)) { 498 498 dev_err(dev, 499 499 "failed to add devfreq dev with passive governor\n"); 500 - ret = -EPROBE_DEFER; 500 + ret = PTR_ERR(bus->devfreq); 501 501 goto err; 502 502 } 503 503