Skip to content

Commit c7fb90d

Browse files
committed
Merge branches 'pm-cpufreq', 'pm-cpuidle', 'pm-devfreq', 'pm-opp' and 'pm-tools'
* pm-cpufreq: cpufreq: speedstep-smi: enable interrupts when waiting * pm-cpuidle: intel_idle: support additional Broadwell model * pm-devfreq: PM / devfreq: event: testing the wrong variable * pm-opp: PM / OPP / clk: Remove unnecessary OOM message * pm-tools: tools/power turbostat: support additional Broadwell model tools/power turbostat: update parameters, documentation tools/power turbostat: Skip printing disabled package C-states
6 parents 69bf75e + d4d4eda + 5177a94 + 04a695e + 59d84ca + 79b56ab commit c7fb90d

9 files changed

Lines changed: 275 additions & 170 deletions

File tree

‎drivers/base/firmware_class.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,6 @@ fw_create_instance(struct firmware *firmware, const char *fw_name,
855855

856856
fw_priv = kzalloc(sizeof(*fw_priv), GFP_KERNEL);
857857
if (!fw_priv) {
858-
dev_err(device, "%s: kmalloc failed\n", __func__);
859858
fw_priv = ERR_PTR(-ENOMEM);
860859
goto exit;
861860
}

‎drivers/base/power/clock_ops.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,8 @@ static int __pm_clk_add(struct device *dev, const char *con_id,
8181
return -EINVAL;
8282

8383
ce = kzalloc(sizeof(*ce), GFP_KERNEL);
84-
if (!ce) {
85-
dev_err(dev, "Not enough memory for clock entry.\n");
84+
if (!ce)
8685
return -ENOMEM;
87-
}
8886

8987
if (con_id) {
9088
ce->con_id = kstrdup(con_id, GFP_KERNEL);

‎drivers/base/power/opp.c‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -474,10 +474,8 @@ static int _opp_add_dynamic(struct device *dev, unsigned long freq,
474474

475475
/* allocate new OPP node */
476476
new_opp = kzalloc(sizeof(*new_opp), GFP_KERNEL);
477-
if (!new_opp) {
478-
dev_warn(dev, "%s: Unable to create new OPP node\n", __func__);
477+
if (!new_opp)
479478
return -ENOMEM;
480-
}
481479

482480
/* Hold our list modification lock here */
483481
mutex_lock(&dev_opp_list_lock);
@@ -695,10 +693,8 @@ static int _opp_set_availability(struct device *dev, unsigned long freq,
695693

696694
/* keep the node allocated */
697695
new_opp = kmalloc(sizeof(*new_opp), GFP_KERNEL);
698-
if (!new_opp) {
699-
dev_warn(dev, "%s: Unable to create OPP\n", __func__);
696+
if (!new_opp)
700697
return -ENOMEM;
701-
}
702698

703699
mutex_lock(&dev_opp_list_lock);
704700

‎drivers/cpufreq/speedstep-lib.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@ unsigned int speedstep_get_freqs(enum speedstep_processor processor,
400400

401401
pr_debug("previous speed is %u\n", prev_speed);
402402

403+
preempt_disable();
403404
local_irq_save(flags);
404405

405406
/* switch to low state */
@@ -464,6 +465,8 @@ unsigned int speedstep_get_freqs(enum speedstep_processor processor,
464465

465466
out:
466467
local_irq_restore(flags);
468+
preempt_enable();
469+
467470
return ret;
468471
}
469472
EXPORT_SYMBOL_GPL(speedstep_get_freqs);

‎drivers/cpufreq/speedstep-smi.c‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ static void speedstep_set_state(unsigned int state)
156156
return;
157157

158158
/* Disable IRQs */
159+
preempt_disable();
159160
local_irq_save(flags);
160161

161162
command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff);
@@ -166,9 +167,19 @@ static void speedstep_set_state(unsigned int state)
166167

167168
do {
168169
if (retry) {
170+
/*
171+
* We need to enable interrupts, otherwise the blockage
172+
* won't resolve.
173+
*
174+
* We disable preemption so that other processes don't
175+
* run. If other processes were running, they could
176+
* submit more DMA requests, making the blockage worse.
177+
*/
169178
pr_debug("retry %u, previous result %u, waiting...\n",
170179
retry, result);
180+
local_irq_enable();
171181
mdelay(retry * 50);
182+
local_irq_disable();
172183
}
173184
retry++;
174185
__asm__ __volatile__(
@@ -185,6 +196,7 @@ static void speedstep_set_state(unsigned int state)
185196

186197
/* enable IRQs */
187198
local_irq_restore(flags);
199+
preempt_enable();
188200

189201
if (new_state == state)
190202
pr_debug("change to %u MHz succeeded after %u tries "

‎drivers/devfreq/event/exynos-ppmu.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,8 @@ static int exynos_ppmu_probe(struct platform_device *pdev)
327327

328328
for (i = 0; i < info->num_events; i++) {
329329
edev[i] = devm_devfreq_event_add_edev(&pdev->dev, &desc[i]);
330-
if (IS_ERR(edev)) {
331-
ret = PTR_ERR(edev);
330+
if (IS_ERR(edev[i])) {
331+
ret = PTR_ERR(edev[i]);
332332
dev_err(&pdev->dev,
333333
"failed to add devfreq-event device\n");
334334
goto err;

‎drivers/idle/intel_idle.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,7 @@ static const struct x86_cpu_id intel_idle_ids[] = {
727727
ICPU(0x46, idle_cpu_hsw),
728728
ICPU(0x4d, idle_cpu_avn),
729729
ICPU(0x3d, idle_cpu_bdw),
730+
ICPU(0x47, idle_cpu_bdw),
730731
ICPU(0x4f, idle_cpu_bdw),
731732
ICPU(0x56, idle_cpu_bdw),
732733
{}

‎tools/power/x86/turbostat/turbostat.8‎

Lines changed: 39 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ turbostat \- Report processor frequency and idle statistics
99
.br
1010
.B turbostat
1111
.RB [ Options ]
12-
.RB [ "\-i interval_sec" ]
12+
.RB [ "\--interval seconds" ]
1313
.SH DESCRIPTION
1414
\fBturbostat \fP reports processor topology, frequency,
1515
idle power-state statistics, temperature and power on X86 processors.
@@ -18,31 +18,41 @@ The first method is to supply a
1818
\fBcommand\fP, which is forked and statistics are printed
1919
upon its completion.
2020
The second method is to omit the command,
21-
and turbodstat will print statistics every 5 seconds.
22-
The 5-second interval can changed using the -i option.
21+
and turbostat displays statistics every 5 seconds.
22+
The 5-second interval can be changed using the --interval option.
2323

24-
Some information is not availalbe on older processors.
24+
Some information is not available on older processors.
2525
.SS Options
26-
The \fB-p\fP option limits output to the 1st thread in 1st core of each package.
26+
\fB--Counter MSR#\fP shows the delta of the specified 64-bit MSR counter.
2727
.PP
28-
The \fB-P\fP option limits output to the 1st thread in each Package.
28+
\fB--counter MSR#\fP shows the delta of the specified 32-bit MSR counter.
2929
.PP
30-
The \fB-S\fP option limits output to a 1-line System Summary for each interval.
30+
\fB--Dump\fP displays the raw counter values.
3131
.PP
32-
The \fB-v\fP option increases verbosity.
32+
\fB--debug\fP displays additional system configuration information. Invoking this parameter
33+
more than once may also enable internal turbostat debug information.
3334
.PP
34-
The \fB-c MSR#\fP option includes the delta of the specified 32-bit MSR counter.
35+
\fB--interval seconds\fP overrides the default 5-second measurement interval.
3536
.PP
36-
The \fB-C MSR#\fP option includes the delta of the specified 64-bit MSR counter.
37+
\fB--help\fP displays usage for the most common parameters.
3738
.PP
38-
The \fB-m MSR#\fP option includes the the specified 32-bit MSR value.
39+
\fB--Joules\fP displays energy in Joules, rather than dividing Joules by time to print power in Watts.
3940
.PP
40-
The \fB-M MSR#\fP option includes the the specified 64-bit MSR value.
41+
\fB--MSR MSR#\fP shows the specified 64-bit MSR value.
4142
.PP
42-
The \fB-i interval_sec\fP option prints statistics every \fiinterval_sec\fP seconds.
43-
The default is 5 seconds.
43+
\fB--msr MSR#\fP shows the specified 32-bit MSR value.
4444
.PP
45-
The \fBcommand\fP parameter forks \fBcommand\fP and upon its exit,
45+
\fB--Package\fP limits output to the system summary plus the 1st thread in each Package.
46+
.PP
47+
\fB--processor\fP limits output to the system summary plus the 1st thread in each processor of each package. Ie. it skips hyper-threaded siblings.
48+
.PP
49+
\fB--Summary\fP limits output to a 1-line System Summary for each interval.
50+
.PP
51+
\fB--TCC temperature\fP sets the Thermal Control Circuit temperature for systems which do not export that value. This is used for making sense of the Digital Thermal Sensor outputs, as they return degrees Celsius below the TCC activation temperature.
52+
.PP
53+
\fB--version\fP displays the version.
54+
.PP
55+
The \fBcommand\fP parameter forks \fBcommand\fP, and upon its exit,
4656
displays the statistics gathered since it was forked.
4757
.PP
4858
.SH FIELD DESCRIPTIONS
@@ -52,7 +62,7 @@ displays the statistics gathered since it was forked.
5262
\fBCPU\fP Linux CPU (logical processor) number.
5363
Note that multiple CPUs per core indicate support for Intel(R) Hyper-Threading Technology.
5464
\fBAVG_MHz\fP number of cycles executed divided by time elapsed.
55-
\fB%Buzy\fP percent of the interval that the CPU retired instructions, aka. % of time in "C0" state.
65+
\fB%Busy\fP percent of the interval that the CPU retired instructions, aka. % of time in "C0" state.
5666
\fBBzy_MHz\fP average clock rate while the CPU was busy (in "c0" state).
5767
\fBTSC_MHz\fP average MHz that the TSC ran during the entire interval.
5868
\fBCPU%c1, CPU%c3, CPU%c6, CPU%c7\fP show the percentage residency in hardware core idle states.
@@ -68,7 +78,7 @@ Note that multiple CPUs per core indicate support for Intel(R) Hyper-Threading T
6878
.fi
6979
.PP
7080
.SH EXAMPLE
71-
Without any parameters, turbostat prints out counters ever 5 seconds.
81+
Without any parameters, turbostat displays statistics ever 5 seconds.
7282
(override interval with "-i sec" option, or specify a command
7383
for turbostat to fork).
7484

@@ -91,19 +101,19 @@ Subsequent rows show per-CPU statistics.
91101
3 3 3 0.20 1596 3492 0 0.44 0.00 99.37 0.00 23
92102
3 7 5 0.31 1596 3492 0 0.33
93103
.fi
94-
.SH VERBOSE EXAMPLE
95-
The "-v" option adds verbosity to the output:
104+
.SH DEBUG EXAMPLE
105+
The "--debug" option prints additional system information before measurements:
96106

97107
.nf
98-
[root@ivy]# turbostat -v
99-
turbostat v3.0 November 23, 2012 - Len Brown <lenb@kernel.org>
108+
turbostat version 4.0 10-Feb, 2015 - Len Brown <lenb@kernel.org>
100109
CPUID(0): GenuineIntel 13 CPUID levels; family:model:stepping 0x6:3a:9 (6:58:9)
101110
CPUID(6): APERF, DTS, PTM, EPB
102-
RAPL: 851 sec. Joule Counter Range
111+
RAPL: 851 sec. Joule Counter Range, at 77 Watts
103112
cpu0: MSR_NHM_PLATFORM_INFO: 0x81010f0012300
104113
16 * 100 = 1600 MHz max efficiency
105114
35 * 100 = 3500 MHz TSC frequency
106-
cpu0: MSR_NHM_SNB_PKG_CST_CFG_CTL: 0x1e008402 (UNdemote-C3, UNdemote-C1, demote-C3, demote-C1, locked: pkg-cstate-limit=2: pc6-noret)
115+
cpu0: MSR_IA32_POWER_CTL: 0x0014005d (C1E auto-promotion: DISabled)
116+
cpu0: MSR_NHM_SNB_PKG_CST_CFG_CTL: 0x1e008402 (UNdemote-C3, UNdemote-C1, demote-C3, demote-C1, locked: pkg-cstate-limit=2: pc6n)
107117
cpu0: MSR_NHM_TURBO_RATIO_LIMIT: 0x25262727
108118
37 * 100 = 3700 MHz max turbo 4 active cores
109119
38 * 100 = 3800 MHz max turbo 3 active cores
@@ -112,9 +122,9 @@ cpu0: MSR_NHM_TURBO_RATIO_LIMIT: 0x25262727
112122
cpu0: MSR_IA32_ENERGY_PERF_BIAS: 0x00000006 (balanced)
113123
cpu0: MSR_RAPL_POWER_UNIT: 0x000a1003 (0.125000 Watts, 0.000015 Joules, 0.000977 sec.)
114124
cpu0: MSR_PKG_POWER_INFO: 0x01e00268 (77 W TDP, RAPL 60 - 0 W, 0.000000 sec.)
115-
cpu0: MSR_PKG_POWER_LIMIT: 0x830000148268 (UNlocked)
125+
cpu0: MSR_PKG_POWER_LIMIT: 0x30000148268 (UNlocked)
116126
cpu0: PKG Limit #1: ENabled (77.000000 Watts, 1.000000 sec, clamp DISabled)
117-
cpu0: PKG Limit #2: ENabled (96.000000 Watts, 0.000977* sec, clamp DISabled)
127+
cpu0: PKG Limit #2: DISabled (96.000000 Watts, 0.000977* sec, clamp DISabled)
118128
cpu0: MSR_PP0_POLICY: 0
119129
cpu0: MSR_PP0_POWER_LIMIT: 0x00000000 (UNlocked)
120130
cpu0: Cores Limit: DISabled (0.000000 Watts, 0.000977 sec, clamp DISabled)
@@ -123,9 +133,9 @@ cpu0: MSR_PP1_POWER_LIMIT: 0x00000000 (UNlocked)
123133
cpu0: GFX Limit: DISabled (0.000000 Watts, 0.000977 sec, clamp DISabled)
124134
cpu0: MSR_IA32_TEMPERATURE_TARGET: 0x00691400 (105 C)
125135
cpu0: MSR_IA32_PACKAGE_THERM_STATUS: 0x884e0000 (27 C)
126-
cpu0: MSR_IA32_THERM_STATUS: 0x88560000 (19 C +/- 1)
127-
cpu1: MSR_IA32_THERM_STATUS: 0x88560000 (19 C +/- 1)
128-
cpu2: MSR_IA32_THERM_STATUS: 0x88540000 (21 C +/- 1)
136+
cpu0: MSR_IA32_THERM_STATUS: 0x88580000 (17 C +/- 1)
137+
cpu1: MSR_IA32_THERM_STATUS: 0x885a0000 (15 C +/- 1)
138+
cpu2: MSR_IA32_THERM_STATUS: 0x88570000 (18 C +/- 1)
129139
cpu3: MSR_IA32_THERM_STATUS: 0x884e0000 (27 C +/- 1)
130140
...
131141
.fi
@@ -195,7 +205,7 @@ in those kernels.
195205

196206
AVG_MHz = APERF_delta/measurement_interval. This is the actual
197207
number of elapsed cycles divided by the entire sample interval --
198-
including idle time. Note that this calculation is resiliant
208+
including idle time. Note that this calculation is resilient
199209
to systems lacking a non-stop TSC.
200210

201211
TSC_MHz = TSC_delta/measurement_interval.

0 commit comments

Comments
 (0)