public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ACPI: cpuidle: port idle timer suspend/resume workaround to cpuidle
@ 2007-10-04  5:22 Len Brown
  2007-10-08 22:17 ` Thomas Gleixner
  0 siblings, 1 reply; 2+ messages in thread
From: Len Brown @ 2007-10-04  5:22 UTC (permalink / raw)
  To: ACPI List; +Cc: Thomas Gleixner

From: Len Brown <len.brown@intel.com>

Some timers stop during C2 and C3, and so there are various
generations of timer broadcast workarounds to deal with that.
But that (already complex) code gets confused during suspend.

As it is unlikely that deep C-states would save much power
during the actual suspend/resume process anyway, deep C-states
were disabled via the addition of .suspend/.resume hooks
in to the ACPI processor driver.

Here that workaround is ported to the cpuidle version of
the ACPI idle loop.  Technically, ACPI could un-register
itself from cpuidle on .suspend, but that code path
is currently quite cumbersome.  So instead,
we simply invoke C1 from the C2 and C3 handlers
for the duration of .suspend/.resume.

Signed-off-by: Len Brown <len.brown@intel.com>
---
 processor_idle.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index d924aa3..3b62632 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -1373,6 +1373,10 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
 	if (unlikely(!pr))
 		return 0;
 
+ 	if (acpi_idle_suspend)
+ 		return(acpi_idle_enter_c1(dev, state));
+ 
+
 	local_irq_disable();
 	current_thread_info()->status &= ~TS_POLLING;
 	/*
@@ -1431,6 +1435,9 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
 	if (unlikely(!pr))
 		return 0;
 
+	if (acpi_idle_suspend)
+		return(acpi_idle_enter_c1(dev, state));
+
 	local_irq_disable();
 	current_thread_info()->status &= ~TS_POLLING;
 	/*

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

* Re: [PATCH] ACPI: cpuidle: port idle timer suspend/resume workaround to cpuidle
  2007-10-04  5:22 [PATCH] ACPI: cpuidle: port idle timer suspend/resume workaround to cpuidle Len Brown
@ 2007-10-08 22:17 ` Thomas Gleixner
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Gleixner @ 2007-10-08 22:17 UTC (permalink / raw)
  To: Len Brown; +Cc: ACPI List

Len,

sorry for answering late. Your mail got into the wrong folder after I had 
to restructure my procmail crap due to a dead server disk. :(

On Thu, 4 Oct 2007, Len Brown wrote:

> From: Len Brown <len.brown@intel.com>
> 
> Some timers stop during C2 and C3, and so there are various
> generations of timer broadcast workarounds to deal with that.
> But that (already complex) code gets confused during suspend.
> 
> As it is unlikely that deep C-states would save much power
> during the actual suspend/resume process anyway, deep C-states
> were disabled via the addition of .suspend/.resume hooks
> in to the ACPI processor driver.
> 
> Here that workaround is ported to the cpuidle version of
> the ACPI idle loop.  Technically, ACPI could un-register
> itself from cpuidle on .suspend, but that code path
> is currently quite cumbersome.  So instead,
> we simply invoke C1 from the C2 and C3 handlers
> for the duration of .suspend/.resume.

That's basically what I did in my -hrt patch set. I just wonder whether 
this decision should be moved into the cpuidle code.

> Signed-off-by: Len Brown <len.brown@intel.com>

Reviewed-by: Thomas Gleixner <tglx@linutronix.de>

> ---
>  processor_idle.c |    7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
> index d924aa3..3b62632 100644
> --- a/drivers/acpi/processor_idle.c
> +++ b/drivers/acpi/processor_idle.c
> @@ -1373,6 +1373,10 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
>  	if (unlikely(!pr))
>  		return 0;
>  
> + 	if (acpi_idle_suspend)
> + 		return(acpi_idle_enter_c1(dev, state));
> + 
> +
>  	local_irq_disable();
>  	current_thread_info()->status &= ~TS_POLLING;
>  	/*
> @@ -1431,6 +1435,9 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
>  	if (unlikely(!pr))
>  		return 0;
>  
> +	if (acpi_idle_suspend)
> +		return(acpi_idle_enter_c1(dev, state));
> +
>  	local_irq_disable();
>  	current_thread_info()->status &= ~TS_POLLING;
>  	/*
> 

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

end of thread, other threads:[~2007-10-08 22:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-04  5:22 [PATCH] ACPI: cpuidle: port idle timer suspend/resume workaround to cpuidle Len Brown
2007-10-08 22:17 ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox