All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@deeprootsystems.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: linux-arm-kernel@lists.arm.linux.org.uk,
	linux-omap@vger.kernel.org,
	Jouni Hogander <jouni.hogander@nokia.com>,
	Paul Walmsley <paul@pwsan.com>
Subject: Re: [PATCH 01/11] OMAP2/3: PM: push core PM code from linux-omap
Date: Tue, 19 May 2009 11:55:41 -0700	[thread overview]
Message-ID: <87r5yk6hxu.fsf@deeprootsystems.com> (raw)
In-Reply-To: <20090518170656.GJ7042@n2100.arm.linux.org.uk> (Russell King's message of "Mon\, 18 May 2009 18\:06\:56 +0100")

Russell King - ARM Linux <linux@arm.linux.org.uk> writes:

> On Mon, May 18, 2009 at 10:00:44AM -0700, Kevin Hilman wrote:
>> Russell King - ARM Linux <linux@arm.linux.org.uk> writes:
>> 
>> > On Fri, May 15, 2009 at 11:40:41AM -0700, Kevin Hilman wrote:
>> >> This patch is to sync the core linux-omap PM code with mainline.  This
>> >> code has evolved and been used for a while the linux-omap tree, but
>> >> the attempt here is to finally get this into mainline.
>> >> 
>> >> Following this will be a series of patches from the 'PM branch' of the
>> >> linux-omap tree to add full PM hardware support from the linux-omap
>> >> tree.
>> >> 
>> >> Much of this PM core code was written by Jouni Hogander with
>> >> significant contributions from Paul Walmsley as well as many others
>> >> from Nokia, Texas Instruments and linux-omap community.
>> >
>> > Overall comment, I think we need to rework the idle support code so
>> > that enable_hlt/disable_hlt can be used even when pm_idle has been
>> > overridden, rather than OMAP going off and inventing its own mechanisms.
>> 
>> Would adding:
>> 
>> 	if (hlt_counter)
>> 		cpu_relax();
>> 
>> to the beginning of omap*_pm_idle functions be sufficient?  That will
>> at least allow the hlt stuff to behave as expected.
>
> Yes, but the comment was also directed at the other functions which
> increment/decrement that atomic_t variable to enable/disable sleep mode.
>

Russell,

Do you have a preference in how to export the hlt_counter to
platform-specific code?

The patch below creates a can_hlt() function that can be called from
platform-specific idle code.

Kevin

>From 23c802a0a1e9bb24ca51af9cf18b972590f8d1dc Mon Sep 17 00:00:00 2001
From: Kevin Hilman <khilman@deeprootsystems.com>
Date: Tue, 19 May 2009 11:34:12 -0700
Subject: [PATCH] ARM: add can_hlt() for platform PM code to check before idling

When platform-specific code overrides pm_idle, the hlt_counter
is no longer used.  Create a can_hlt() check which returns
the hlt_counter so platform code can check it and thus
honor the requests of enable_hlt()/disable_hlt() users.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
---
 arch/arm/include/asm/system.h |    1 +
 arch/arm/kernel/process.c     |    7 +++++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
index bd4dc8e..ff9e2dd 100644
--- a/arch/arm/include/asm/system.h
+++ b/arch/arm/include/asm/system.h
@@ -313,6 +313,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size
 
 extern void disable_hlt(void);
 extern void enable_hlt(void);
+extern int can_hlt(void);
 
 #include <asm-generic/cmpxchg-local.h>
 
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index c3265a2..1b414b8 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -68,6 +68,13 @@ void enable_hlt(void)
 
 EXPORT_SYMBOL(enable_hlt);
 
+int can_hlt(void)
+{
+	return !hlt_counter;
+}
+
+EXPORT_SYMBOL(can_hlt);
+
 static int __init nohlt_setup(char *__unused)
 {
 	hlt_counter = 1;
-- 
1.6.2.2


  parent reply	other threads:[~2009-05-19 18:55 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-15 18:40 [PATCH 00/11] OMAP2/3: PM sync-up Kevin Hilman
2009-05-15 18:40 ` [PATCH 01/11] OMAP2/3: PM: push core PM code from linux-omap Kevin Hilman
2009-05-15 18:40   ` [PATCH 02/11] OMAP: Add new function to check wether there is irq pending Kevin Hilman
2009-05-15 18:40     ` [PATCH 03/11] OMAP3: PM: Force IVA2 into idle during bootup Kevin Hilman
2009-05-15 18:40       ` [PATCH 04/11] OMAP3: PM: Add wake-up bit defintiions for CONTROL_PADCONF_X Kevin Hilman
2009-05-15 18:40         ` [PATCH 05/11] OMAP3: PM: UART: disable clocks when idle and off-mode support Kevin Hilman
2009-05-15 18:40           ` [PATCH 06/11] OMAP3: PM: Add D2D clocks and auto-idle setup to PRCM init Kevin Hilman
2009-05-15 18:40             ` [PATCH 07/11] OMAP3: PM: D2D clockdomain supports SW supervised transitions Kevin Hilman
2009-05-15 18:40               ` [PATCH 08/11] OMAP3: PM: Ensure MUSB block can idle when driver not loaded Kevin Hilman
2009-05-15 18:40                 ` [PATCH 09/11] OMAP3: PM: Ensure PRCM interrupts are cleared at boot Kevin Hilman
2009-05-15 18:40                   ` [PATCH 10/11] OMAP3: PM: Clear pending PRCM reset flags on init Kevin Hilman
2009-05-15 18:40                     ` [PATCH 11/11] OMAP3: PM: prevent module wakeups from waking IVA2 Kevin Hilman
2009-05-18 13:16                 ` [PATCH 08/11] OMAP3: PM: Ensure MUSB block can idle when driver not loaded Russell King - ARM Linux
2009-05-18 14:50                   ` Kevin Hilman
2009-05-18 15:04                     ` Tony Lindgren
2009-05-18 13:32   ` [PATCH 01/11] OMAP2/3: PM: push core PM code from linux-omap Russell King - ARM Linux
2009-05-18 17:00     ` Kevin Hilman
2009-05-18 17:06       ` Russell King - ARM Linux
2009-05-18 17:28         ` Kevin Hilman
2009-05-19  5:49           ` Artem Bityutskiy
2009-05-19 14:57             ` Kevin Hilman
2009-05-19 18:55         ` Kevin Hilman [this message]
2009-05-28 13:43           ` Russell King - ARM Linux
2009-05-18 17:08     ` Kevin Hilman
2009-05-18 18:30       ` Russell King - ARM Linux
2009-05-18 19:04       ` Woodruff, Richard
2009-05-18 20:24         ` Russell King - ARM Linux
2009-05-18 20:47           ` Woodruff, Richard
2009-05-18 21:11             ` Russell King - ARM Linux
2009-05-18 21:19               ` Woodruff, Richard
2009-05-19  0:23           ` Kevin Hilman

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=87r5yk6hxu.fsf@deeprootsystems.com \
    --to=khilman@deeprootsystems.com \
    --cc=jouni.hogander@nokia.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=paul@pwsan.com \
    /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.