lkml.org 
[lkml]   [2014]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] cpuidle / menu: Return error code if there are no suitable states
On 04/27/2014 02:55 PM, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> 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 an error code
> in such situations.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
> drivers/cpuidle/governors/menu.c | 2 +-
> include/linux/cpuidle.h | 2 ++
> 2 files changed, 3 insertions(+), 1 deletion(-)
>
> Index: linux-pm/drivers/cpuidle/governors/menu.c
> ===================================================================
> --- linux-pm.orig/drivers/cpuidle/governors/menu.c
> +++ linux-pm/drivers/cpuidle/governors/menu.c
> @@ -296,7 +296,7 @@ static int menu_select(struct cpuidle_dr
> data->needs_update = 0;
> }
>
> - data->last_state_idx = 0;
> + data->last_state_idx = CPUIDLE_DRIVER_STATE_POLL;
>
> /* Special case when user has set very strict latency requirement */
> if (unlikely(latency_req == 0))
> Index: linux-pm/include/linux/cpuidle.h
> ===================================================================
> --- linux-pm.orig/include/linux/cpuidle.h
> +++ linux-pm/include/linux/cpuidle.h
> @@ -217,8 +217,10 @@ static inline int cpuidle_register_gover
>
> #ifdef CONFIG_ARCH_HAS_CPU_RELAX
> #define CPUIDLE_DRIVER_STATE_START 1
> +#define CPUIDLE_DRIVER_STATE_POLL 0
> #else
> #define CPUIDLE_DRIVER_STATE_START 0
> +#define CPUIDLE_DRIVER_STATE_POLL (-ENXIO)
> #endif
>
> #endif /* _LINUX_CPUIDLE_H */

Hi Rafael,

CPUIDLE_DRIVER_STATE_START is only for x86. It introduces some confusion
in the code. As only two drivers are concerned by it, wouldn't make
sense to add the poll state to those driver directly instead of having
the code hacked around ? (eg. insert the poll state in the common
cpuidle code).


--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2014-04-28 14:01    [W:0.097 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site