All of lore.kernel.org
 help / color / mirror / Atom feed
From: Len Brown <lenb@kernel.org>
To: linux-acpi@vger.kernel.org
Cc: Len Brown <len.brown@intel.com>
Subject: [PATCH 2/4] ACPI: cpuidle: port idle timer suspend/resume workaround to cpuidle
Date: Wed, 10 Oct 2007 01:07:48 -0400	[thread overview]
Message-ID: <1191992870-15009-3-git-send-email-lenb@kernel.org> (raw)
Message-ID: <e196441bdf2dbf0526b28a6829c39557c236d611.1191992618.git.len.brown@intel.com> (raw)
In-Reply-To: <1191992870-15009-2-git-send-email-lenb@kernel.org>
In-Reply-To: <4f86d3a8e297205780cca027e974fd5f81064780.1191992618.git.len.brown@intel.com>

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>
---
 drivers/acpi/processor_idle.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 99da6a7..0cad56c 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -1416,6 +1416,9 @@ 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));
+
 	if (pr->flags.bm_check)
 		acpi_idle_update_bm_rld(pr, cx);
 
@@ -1477,6 +1480,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;
 	/*
-- 
1.5.3.4.206.g58ba4

  parent reply	other threads:[~2007-10-10  5:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-10  5:07 ACPI patches on test branch, which are not on release branch Len Brown
2007-10-10  5:07 ` [PATCH 1/4] cpuidle: consolidate 2.6.22 cpuidle branch into one patch Len Brown
2007-10-10  5:07   ` Len Brown
2007-10-10  5:07   ` Len Brown [this message]
2007-10-10  5:07     ` [PATCH 2/4] ACPI: cpuidle: port idle timer suspend/resume workaround to cpuidle Len Brown
2007-10-10  5:07   ` [PATCH 3/4] ACPICA: hw: remove use_lock flag from acpi_hw_register_{read, write} Len Brown
2007-10-10  5:07     ` Len Brown
2007-10-10  5:07   ` [PATCH 4/4] ACPICA: hw: Don't carry spinlock over suspend Len Brown
2007-10-10  5:07     ` Len Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1191992870-15009-3-git-send-email-lenb@kernel.org \
    --to=lenb@kernel.org \
    --cc=len.brown@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.