diff mbox

[1/3] cpuidle: exynos: Allow to use the driver without AFTR

Message ID 1405931771-24100-1-git-send-email-k.kozlowski@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Krzysztof Kozlowski July 21, 2014, 8:36 a.m. UTC
Allow the driver to be used when AFTR enter function is not provided
(device platform data is NULL).

This actually does not give any special energy-saving benefits but
allows to track the idle time of each core. Additionally it is a safe
way to validate supplied platform data.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
---
 drivers/cpuidle/cpuidle-exynos.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Daniel Lezcano July 21, 2014, 9:53 a.m. UTC | #1
On 07/21/2014 10:36 AM, Krzysztof Kozlowski wrote:
> Allow the driver to be used when AFTR enter function is not provided
> (device platform data is NULL).
>
> This actually does not give any special energy-saving benefits but
> allows to track the idle time of each core. Additionally it is a safe
> way to validate supplied platform data.
>
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

I think we already talk about this in the mailing list several times.
It does not make sense to enable the cpuidle driver for WFI just for the 
sake of tracking via sysfs some idle timings.

Using the cpuidle driver means using the underlying cpuidle 
infrastructure with all the stats computation in the governor.

If there is a *real* need of a WFI cpuidle driver, then a generic WFI 
cpuidle driver could be implemented to supersede this one.

It took a while to cleanup this driver and remove all the hacks around 
this AFTR state... :)



> ---
>   drivers/cpuidle/cpuidle-exynos.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/drivers/cpuidle/cpuidle-exynos.c b/drivers/cpuidle/cpuidle-exynos.c
> index 7c0151263828..5325a394be7e 100644
> --- a/drivers/cpuidle/cpuidle-exynos.c
> +++ b/drivers/cpuidle/cpuidle-exynos.c
> @@ -77,7 +77,10 @@ static int exynos_cpuidle_probe(struct platform_device *pdev)
>   {
>   	int ret;
>
> +	/* If NULL enter only WFI */
>   	exynos_enter_aftr = (void *)(pdev->dev.platform_data);
> +	if (!exynos_enter_aftr)
> +		exynos_idle_driver.state_count = 1;
>
>   	ret = cpuidle_register(&exynos_idle_driver, NULL);
>   	if (ret) {
>
Krzysztof Kozlowski July 21, 2014, 10:08 a.m. UTC | #2
On pon, 2014-07-21 at 11:53 +0200, Daniel Lezcano wrote:
> On 07/21/2014 10:36 AM, Krzysztof Kozlowski wrote:
> > Allow the driver to be used when AFTR enter function is not provided
> > (device platform data is NULL).
> >
> > This actually does not give any special energy-saving benefits but
> > allows to track the idle time of each core. Additionally it is a safe
> > way to validate supplied platform data.
> >
> > Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> 
> I think we already talk about this in the mailing list several times.
> It does not make sense to enable the cpuidle driver for WFI just for the 
> sake of tracking via sysfs some idle timings.
> 
> Using the cpuidle driver means using the underlying cpuidle 
> infrastructure with all the stats computation in the governor.
> 
> If there is a *real* need of a WFI cpuidle driver, then a generic WFI 
> cpuidle driver could be implemented to supersede this one.
> 
> It took a while to cleanup this driver and remove all the hacks around 
> this AFTR state... :)

Sure, I understand.

Best regards,
Krzysztof


> 
> > ---
> >   drivers/cpuidle/cpuidle-exynos.c | 3 +++
> >   1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/cpuidle/cpuidle-exynos.c b/drivers/cpuidle/cpuidle-exynos.c
> > index 7c0151263828..5325a394be7e 100644
> > --- a/drivers/cpuidle/cpuidle-exynos.c
> > +++ b/drivers/cpuidle/cpuidle-exynos.c
> > @@ -77,7 +77,10 @@ static int exynos_cpuidle_probe(struct platform_device *pdev)
> >   {
> >   	int ret;
> >
> > +	/* If NULL enter only WFI */
> >   	exynos_enter_aftr = (void *)(pdev->dev.platform_data);
> > +	if (!exynos_enter_aftr)
> > +		exynos_idle_driver.state_count = 1;
> >
> >   	ret = cpuidle_register(&exynos_idle_driver, NULL);
> >   	if (ret) {
> >
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/cpuidle/cpuidle-exynos.c b/drivers/cpuidle/cpuidle-exynos.c
index 7c0151263828..5325a394be7e 100644
--- a/drivers/cpuidle/cpuidle-exynos.c
+++ b/drivers/cpuidle/cpuidle-exynos.c
@@ -77,7 +77,10 @@  static int exynos_cpuidle_probe(struct platform_device *pdev)
 {
 	int ret;
 
+	/* If NULL enter only WFI */
 	exynos_enter_aftr = (void *)(pdev->dev.platform_data);
+	if (!exynos_enter_aftr)
+		exynos_idle_driver.state_count = 1;
 
 	ret = cpuidle_register(&exynos_idle_driver, NULL);
 	if (ret) {