diff options
author | Scott Williams <scwilliams@nvidia.com> | 2010-05-07 12:54:51 -0700 |
---|---|---|
committer | Gary King <gking@nvidia.com> | 2010-05-12 19:36:19 -0700 |
commit | bae2012ac2c01124c6e102b3d2e7fb623169a965 (patch) | |
tree | bdfec2d6c8b0caab2dc6480289cf871fa3973e56 | |
parent | b9166ad37e5695f47c6a1b5d34a9241dfb5d4c9c (diff) |
tegra: Perform DSB immediately before WFI
As per ARM recommendation, perform a DSB immediatly before a WFI.
Change-Id: Id024356efa7e2f316f7b7c96ebb3936a12d70b3a
Reviewed-on: http://git-master/r/1318
Reviewed-by: Scott Williams <scwilliams@nvidia.com>
Reviewed-by: Gary King <gking@nvidia.com>
Tested-by: Gary King <gking@nvidia.com>
-rw-r--r-- | arch/arm/mach-tegra/cpuidle.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-tegra/idle-t2.c | 16 |
2 files changed, 10 insertions, 8 deletions
diff --git a/arch/arm/mach-tegra/cpuidle.c b/arch/arm/mach-tegra/cpuidle.c index 95dfddaf0fae..f26c6401f930 100644 --- a/arch/arm/mach-tegra/cpuidle.c +++ b/arch/arm/mach-tegra/cpuidle.c @@ -61,9 +61,9 @@ static int tegra_idle_enter_lp3(struct cpuidle_device *dev, local_irq_disable(); enter = ktime_get(); if (!need_resched()) { - dsb(); __raw_writel(reg, flow_ctrl); reg = __raw_readl(flow_ctrl); + dsb(); __asm__ volatile ("wfi"); __raw_writel(0, flow_ctrl); reg = __raw_readl(flow_ctrl); diff --git a/arch/arm/mach-tegra/idle-t2.c b/arch/arm/mach-tegra/idle-t2.c index 53095c3e5683..1e80c34cc342 100644 --- a/arch/arm/mach-tegra/idle-t2.c +++ b/arch/arm/mach-tegra/idle-t2.c @@ -269,8 +269,6 @@ void cpu_ap20_do_idle(void) unsigned int tmp = 0; volatile uint32_t *addr = 0; - dsb(); - if (likely(s_pFlowCtrl)) { /* @@ -289,13 +287,11 @@ void cpu_ap20_do_idle(void) NV_WRITE32(addr, tmp); tmp = NV_READ32(addr); - } - // Wait for any interrupt - __asm__ volatile ("wfi"); + // Wait for any interrupt + dsb(); + __asm__ volatile ("wfi"); - if (addr) - { /* * Signal "stats monitor" to stop counting the idle cycles. */ @@ -303,6 +299,12 @@ void cpu_ap20_do_idle(void) NV_WRITE32(addr, tmp); tmp = NV_READ32(addr); } + else + { + // Wait for any interrupt + dsb(); + __asm__ volatile ("wfi"); + } } void mach_tegra_idle(void) |