From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Trinabh Gupta <trinabh@linux.vnet.ibm.com>
Cc: arjan@linux.intel.com, peterz@infradead.org, lenb@kernel.org,
venki@google.com, ak@linux.intel.com, len.brown@intel.com,
santosh.shilimkar@ti.com, khilman@ti.com,
linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-acpi@vger.kernel.org, linux-pm@lists.linux-foundation.org,
linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [RFC PATCH V5 1/4] cpuidle: Move dev->last_residency update to driver enter routine, remove dev->last_state
Date: Mon, 6 Jun 2011 14:51:05 +0100 [thread overview]
Message-ID: <20110606135105.GA7023@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20110606133926.5670.4650.stgit@tringupt.in.ibm.com>
On Mon, Jun 06, 2011 at 07:09:26PM +0530, Trinabh Gupta wrote:
> diff --git a/arch/arm/mach-at91/cpuidle.c b/arch/arm/mach-at91/cpuidle.c
> index 1cfeac1..4696a0d 100644
> --- a/arch/arm/mach-at91/cpuidle.c
> +++ b/arch/arm/mach-at91/cpuidle.c
> @@ -41,10 +41,10 @@ static int at91_enter_idle(struct cpuidle_device *dev,
>
> local_irq_disable();
> do_gettimeofday(&before);
> - if (state == &dev->states[0])
> + if (index == 0)
> /* Wait for interrupt state */
> cpu_do_idle();
> - else if (state == &dev->states[1]) {
> + else if (index == 1) {
> asm("b 1f; .align 5; 1:");
> asm("mcr p15, 0, r0, c7, c10, 4"); /* drain write buffer */
While looking through this patch, it is probably worth pointing out for
the AT91 folk that this is broken. Here's an extract from the GCC manual:
| Similarly, you can't expect a sequence of volatile `asm' instructions
| to remain perfectly consecutive. If you want consecutive output, use a
| single `asm'. Also, GCC will perform some optimizations across a
| volatile `asm' instruction; GCC does not "forget everything" when it
| encounters a volatile `asm' instruction the way some other compilers do.
It might be a good idea to fix those two asm() statements into one.
next prev parent reply other threads:[~2011-06-06 13:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-06 13:39 [RFC PATCH V5 0/4] cpuidle: global registration of idle states with per-cpu statistics Trinabh Gupta
2011-06-06 13:39 ` [RFC PATCH V5 1/4] cpuidle: Move dev->last_residency update to driver enter routine, remove dev->last_state Trinabh Gupta
2011-06-06 13:51 ` Russell King - ARM Linux [this message]
2011-06-06 13:39 ` [RFC PATCH V5 2/4] cpuidle: Remove CPUIDLE_FLAG_IGNORE and dev->prepare() Trinabh Gupta
2011-06-06 13:39 ` [RFC PATCH V5 3/4] cpuidle: Split cpuidle_state structure and move per-cpu statistics fields Trinabh Gupta
2011-06-06 13:39 ` [RFC PATCH V5 4/4] cpuidle: Single/Global registration of idle states Trinabh Gupta
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=20110606135105.GA7023@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=ak@linux.intel.com \
--cc=arjan@linux.intel.com \
--cc=khilman@ti.com \
--cc=len.brown@intel.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=linux-sh@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=santosh.shilimkar@ti.com \
--cc=trinabh@linux.vnet.ibm.com \
--cc=venki@google.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 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).