linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] cpuidle: exynos: Allow to use the driver without AFTR
@ 2014-07-21  8:36 Krzysztof Kozlowski
  2014-07-21  8:36 ` [PATCH 2/3] ARM: EXYNOS: Enable cpuidle in WFI on all SoCs Krzysztof Kozlowski
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2014-07-21  8:36 UTC (permalink / raw)
  To: Russell King, Kukjin Kim, Rafael J. Wysocki, Daniel Lezcano,
	Sachin Kamat, Tushar Behera, linux-arm-kernel, linux-samsung-soc,
	linux-kernel, linux-pm
  Cc: Kyungmin Park, Marek Szyprowski, Bartlomiej Zolnierkiewicz,
	Tomasz Figa, Krzysztof Kozlowski

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(+)

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) {
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] ARM: EXYNOS: Enable cpuidle in WFI on all SoCs
  2014-07-21  8:36 [PATCH 1/3] cpuidle: exynos: Allow to use the driver without AFTR Krzysztof Kozlowski
@ 2014-07-21  8:36 ` Krzysztof Kozlowski
  2014-07-21  8:36 ` [PATCH 3/3] ARM: exynos_defconfig: Enable cpuidle driver Krzysztof Kozlowski
  2014-07-21  9:53 ` [PATCH 1/3] cpuidle: exynos: Allow to use the driver without AFTR Daniel Lezcano
  2 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2014-07-21  8:36 UTC (permalink / raw)
  To: Russell King, Kukjin Kim, Rafael J. Wysocki, Daniel Lezcano,
	Sachin Kamat, Tushar Behera, linux-arm-kernel, linux-samsung-soc,
	linux-kernel, linux-pm
  Cc: Kyungmin Park, Marek Szyprowski, Bartlomiej Zolnierkiewicz,
	Tomasz Figa, Krzysztof Kozlowski

Add cpuidle device for each SoC but set AFTR enter function only on
supported ones (for now these are only Exynos4210 and Exynos5250). For
other chipsets use only WFI.

This actually does not give any special energy-saving benefits but
allows to track the idle time of each core.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
---
 arch/arm/mach-exynos/exynos.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
index 2a43a1734eca..4109d592f6fc 100644
--- a/arch/arm/mach-exynos/exynos.c
+++ b/arch/arm/mach-exynos/exynos.c
@@ -171,14 +171,20 @@ static void exynos_restart(enum reboot_mode mode, const char *cmd)
 
 static struct platform_device exynos_cpuidle = {
 	.name              = "exynos_cpuidle",
-	.dev.platform_data = exynos_enter_aftr,
+	/*
+	 * Currently AFTR is not implemented for each SoC.
+	 * Set this to exynos_enter_aftr() only for supported SoCs.
+	 */
+	.dev.platform_data = NULL,
 	.id                = -1,
 };
 
 void __init exynos_cpuidle_init(void)
 {
 	if (soc_is_exynos4210() || soc_is_exynos5250())
-		platform_device_register(&exynos_cpuidle);
+		exynos_cpuidle.dev.platform_data = exynos_enter_aftr;
+
+	platform_device_register(&exynos_cpuidle);
 }
 
 void __init exynos_cpufreq_init(void)
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] ARM: exynos_defconfig: Enable cpuidle driver
  2014-07-21  8:36 [PATCH 1/3] cpuidle: exynos: Allow to use the driver without AFTR Krzysztof Kozlowski
  2014-07-21  8:36 ` [PATCH 2/3] ARM: EXYNOS: Enable cpuidle in WFI on all SoCs Krzysztof Kozlowski
@ 2014-07-21  8:36 ` Krzysztof Kozlowski
  2014-07-21  9:53 ` [PATCH 1/3] cpuidle: exynos: Allow to use the driver without AFTR Daniel Lezcano
  2 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2014-07-21  8:36 UTC (permalink / raw)
  To: Russell King, Kukjin Kim, Rafael J. Wysocki, Daniel Lezcano,
	Sachin Kamat, Tushar Behera, linux-arm-kernel, linux-samsung-soc,
	linux-kernel, linux-pm
  Cc: Kyungmin Park, Marek Szyprowski, Bartlomiej Zolnierkiewicz,
	Tomasz Figa, Krzysztof Kozlowski

The cpuidle driver for Exynos supports all SoCs now. AFTR is supported
only on Exynos4210 and Exynos5250 (WFI is used on other). Add the driver
to default exynos config.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
---
 arch/arm/configs/exynos_defconfig | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/configs/exynos_defconfig b/arch/arm/configs/exynos_defconfig
index fc7d1683bf67..237434e26565 100644
--- a/arch/arm/configs/exynos_defconfig
+++ b/arch/arm/configs/exynos_defconfig
@@ -24,6 +24,12 @@ CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_ARM_APPENDED_DTB=y
 CONFIG_ARM_ATAG_DTB_COMPAT=y
 CONFIG_CMDLINE="root=/dev/ram0 rw ramdisk=8192 initrd=0x41000000,8M console=ttySAC1,115200 init=/linuxrc mem=256M"
+CONFIG_CPU_IDLE=y
+CONFIG_CPU_IDLE_MULTIPLE_DRIVERS=y
+CONFIG_CPU_IDLE_GOV_LADDER=y
+CONFIG_CPU_IDLE_GOV_MENU=y
+CONFIG_ARM_BIG_LITTLE_CPUIDLE=y
+CONFIG_ARM_EXYNOS_CPUIDLE=y
 CONFIG_VFP=y
 CONFIG_NEON=y
 CONFIG_PM_RUNTIME=y
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/3] cpuidle: exynos: Allow to use the driver without AFTR
  2014-07-21  8:36 [PATCH 1/3] cpuidle: exynos: Allow to use the driver without AFTR Krzysztof Kozlowski
  2014-07-21  8:36 ` [PATCH 2/3] ARM: EXYNOS: Enable cpuidle in WFI on all SoCs Krzysztof Kozlowski
  2014-07-21  8:36 ` [PATCH 3/3] ARM: exynos_defconfig: Enable cpuidle driver Krzysztof Kozlowski
@ 2014-07-21  9:53 ` Daniel Lezcano
  2014-07-21 10:08   ` Krzysztof Kozlowski
  2 siblings, 1 reply; 5+ messages in thread
From: Daniel Lezcano @ 2014-07-21  9:53 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Russell King, Kukjin Kim, Rafael J. Wysocki,
	Sachin Kamat, Tushar Behera, linux-arm-kernel, linux-samsung-soc,
	linux-kernel, linux-pm
  Cc: Kyungmin Park, Marek Szyprowski, Bartlomiej Zolnierkiewicz,
	Tomasz Figa

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) {
>


-- 
  <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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/3] cpuidle: exynos: Allow to use the driver without AFTR
  2014-07-21  9:53 ` [PATCH 1/3] cpuidle: exynos: Allow to use the driver without AFTR Daniel Lezcano
@ 2014-07-21 10:08   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2014-07-21 10:08 UTC (permalink / raw)
  To: Daniel Lezcano
  Cc: Russell King, Kukjin Kim, Rafael J. Wysocki, Sachin Kamat,
	Tushar Behera, linux-arm-kernel, linux-samsung-soc, linux-kernel,
	linux-pm, Kyungmin Park, Marek Szyprowski,
	Bartlomiej Zolnierkiewicz, Tomasz Figa

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) {
> >
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-07-21 10:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-21  8:36 [PATCH 1/3] cpuidle: exynos: Allow to use the driver without AFTR Krzysztof Kozlowski
2014-07-21  8:36 ` [PATCH 2/3] ARM: EXYNOS: Enable cpuidle in WFI on all SoCs Krzysztof Kozlowski
2014-07-21  8:36 ` [PATCH 3/3] ARM: exynos_defconfig: Enable cpuidle driver Krzysztof Kozlowski
2014-07-21  9:53 ` [PATCH 1/3] cpuidle: exynos: Allow to use the driver without AFTR Daniel Lezcano
2014-07-21 10:08   ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).