Patch "cpufreq: powernv: Disable preemption while checking CPU throttling state" has been added to the 4.4-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
cpufreq: powernv: Disable preemption while checking CPU throttling state
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
cpufreq-powernv-disable-preemption-while-checking-cpu-throttling-state.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
8a10c06a20ec8097a68fd7a4a1c0e285095b4d2fMon Sep 17 00:00:00 2001
From: Denis Kirjanov <[email protected]>
Date: Tue, 8 Nov 2016 05:39:28 -0500
Subject: cpufreq: powernv: Disable preemption while checking CPU throttling state
From: Denis Kirjanov <[email protected]>
commit 8a10c06a20ec8097a68fd7a4a1c0e285095b4d2f upstream.
With preemption turned on we can read incorrect throttling state while being switched to CPU on a different chip.
BUG: using smp_processor_id() in preemptible [00000000] code: cat/7343 caller is .powernv_cpufreq_throttle_check+0x2c/0x710 CPU: 13 PID: 7343 Comm: cat Not tainted 4.8.0-rc5-dirty #1 Call Trace: [c0000007d25b75b0] [c000000000971378] .dump_stack+0xe4/0x150 (unreliable) [c0000007d25b7640] [c0000000005162e4] .check_preemption_disabled+0x134/0x150 [c0000007d25b76e0] [c0000000007b63ac] .powernv_cpufreq_throttle_check+0x2c/0x710 [c0000007d25b7790] [c0000000007b6d18] .powernv_cpufreq_target_index+0x288/0x360 [c0000007d25b7870] [c0000000007acee4] .__cpufreq_driver_target+0x394/0x8c0 [c0000007d25b7920] [c0000000007b22ac] .cpufreq_set+0x7c/0xd0 [c0000007d25b79b0] [c0000000007adf50] .store_scaling_setspeed+0x80/0xc0 [c0000007d25b7a40] [c0000000007ae270] .store+0xa0/0x100 [c0000007d25b7ae0] [c0000000003566e8] .sysfs_kf_write+0x88/0xb0 [c0000007d25b7b70] [c0000000003553b8] .kernfs_fop_write+0x178/0x260 [c0000007d25b7c10] [c0000000002ac3cc] .__vfs_write+0x3c/0x1c0 [c0000007d25b7cf0] [c0000000002ad584] .vfs_write+0xc4/0x230 [c0000007d25b7d90] [c0000000002aeef8] .SyS_write+0x58/0x100 [c0000007d25b7e30] [c00000000000bfec] system_call+0x38/0xfc
--- drivers/cpufreq/powernv-cpufreq.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/cpufreq/powernv-cpufreq.c +7 -1
@@ -373,8 +373,14 @@ static int powernv_cpufreq_target_index(if (unlikely (rebooting) && new_index !=get_nominal_index ())return 0 ; -if (!throttled) +if (!throttled) { +/* we don't want to be preempted while +* checking if the CPU frequency has been throttled +*/ +preempt_disable ();powernv_cpufreq_throttle_check (NULL ); +preempt_enable (); + } freq_data.pstate_id = powernv_freqs[new_index].driver_data;
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/cpufreq-powernv-disable-preemption-while-checking-cpu-throttling-state.patch