From: Greg Kroah-Hartman Date: Fri, 17 Jul 2015 01:34:41 +0000 (-0700) Subject: 3.14-stable patches X-Git-Tag: v4.0.9~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=61660c0cbd21fb01c19468cf7310c857d5058ece;p=thirdparty%2Fkernel%2Fstable-queue.git 3.14-stable patches added patches: cpuidle-menu-return-1-if-there-are-no-suitable-states.patch --- diff --git a/queue-3.14/cpuidle-menu-return-1-if-there-are-no-suitable-states.patch b/queue-3.14/cpuidle-menu-return-1-if-there-are-no-suitable-states.patch new file mode 100644 index 00000000000..2052df3f921 --- /dev/null +++ b/queue-3.14/cpuidle-menu-return-1-if-there-are-no-suitable-states.patch @@ -0,0 +1,53 @@ +From 3836785a1bdcd6706c68ad46bf53adc0b057b310 Mon Sep 17 00:00:00 2001 +From: "Rafael J. Wysocki" +Date: Thu, 1 May 2014 00:14:04 +0200 +Subject: cpuidle / menu: Return (-1) if there are no suitable states + +From: "Rafael J. Wysocki" + +commit 3836785a1bdcd6706c68ad46bf53adc0b057b310 upstream. + +If there is a PM QoS latency limit and all of the sufficiently shallow +C-states are disabled, the cpuidle menu governor returns 0 which on +some systems is CPUIDLE_DRIVER_STATE_START and shouldn't be returned +if that C-state has been disabled. + +Fix the issue by modifying the menu governor to return (-1) in such +situations. + +Signed-off-by: Rafael J. Wysocki +[shilpab: Backport to 3.10.y + - adjust context + - add a check if 'next_state' is less than 0 in 'cpuidle_idle_call()', + this ensures that we exit 'cpuidle_idle_call()' if governor->select() + returns negative value] +Signed-off-by: Shilpasri G Bhat +Signed-off-by: Greg Kroah-Hartman +--- + drivers/cpuidle/cpuidle.c | 3 +++ + drivers/cpuidle/governors/menu.c | 2 +- + 2 files changed, 4 insertions(+), 1 deletion(-) + +--- a/drivers/cpuidle/cpuidle.c ++++ b/drivers/cpuidle/cpuidle.c +@@ -131,6 +131,9 @@ int cpuidle_idle_call(void) + + /* ask the governor for the next state */ + next_state = cpuidle_curr_governor->select(drv, dev); ++ if (next_state < 0) ++ return -EBUSY; ++ + if (need_resched()) { + dev->last_residency = 0; + /* give the governor an opportunity to reflect on the outcome */ +--- a/drivers/cpuidle/governors/menu.c ++++ b/drivers/cpuidle/governors/menu.c +@@ -297,7 +297,7 @@ static int menu_select(struct cpuidle_dr + data->needs_update = 0; + } + +- data->last_state_idx = 0; ++ data->last_state_idx = CPUIDLE_DRIVER_STATE_START - 1; + data->exit_us = 0; + + /* Special case when user has set very strict latency requirement */ diff --git a/queue-3.14/series b/queue-3.14/series index 3340f375f7e..b5daa62653a 100644 --- a/queue-3.14/series +++ b/queue-3.14/series @@ -8,3 +8,4 @@ arc-add-compiler-barrier-to-llsc-based-cmpxchg.patch arm64-do-not-attempt-to-use-init_mm-in-reset_context.patch arm64-mm-fix-freeing-of-the-wrong-memmap-entries-with-sparsemem_vmemmap.patch arm64-vdso-work-around-broken-elf-toolchains-in-makefile.patch +cpuidle-menu-return-1-if-there-are-no-suitable-states.patch