ARM: tegra20: Store CPU "resettable" status in IRAM
authorDmitry Osipenko <digetx@gmail.com>
Thu, 15 Jan 2015 10:58:57 +0000 (13:58 +0300)
committerThierry Reding <treding@nvidia.com>
Mon, 4 May 2015 10:58:19 +0000 (12:58 +0200)
Commit 7232398abc6a ("ARM: tegra: Convert PMC to a driver") changed tegra_resume()
location storing from late to early and, as a result, broke suspend on Tegra20.
PMC scratch register 41 is used by tegra LP1 resume code for retrieving stored
physical memory address of common resume function and in the same time used by
tegra20_cpu_shutdown() (shared by Tegra20 cpuidle driver and platform SMP code),
which is storing CPU1 "resettable" status. It implies strict order of scratch
register usage, otherwise resume function address is lost on Tegra20 after
disabling non-boot CPU's on suspend. Fix it by storing "resettable" status in
IRAM instead of PMC scratch register.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Fixes: 7232398abc6a (ARM: tegra: Convert PMC to a driver)
Cc: <stable@vger.kernel.org> # v3.17+
Signed-off-by: Thierry Reding <treding@nvidia.com>
arch/arm/mach-tegra/cpuidle-tegra20.c
arch/arm/mach-tegra/reset-handler.S
arch/arm/mach-tegra/reset.h
arch/arm/mach-tegra/sleep-tegra20.S
arch/arm/mach-tegra/sleep.h

index 88de2dc..7469347 100644 (file)
@@ -34,6 +34,7 @@
 #include "iomap.h"
 #include "irq.h"
 #include "pm.h"
+#include "reset.h"
 #include "sleep.h"
 
 #ifdef CONFIG_PM_SLEEP
@@ -70,15 +71,13 @@ static struct cpuidle_driver tegra_idle_driver = {
 
 #ifdef CONFIG_PM_SLEEP
 #ifdef CONFIG_SMP
-static void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE);
-
 static int tegra20_reset_sleeping_cpu_1(void)
 {
        int ret = 0;
 
        tegra_pen_lock();
 
-       if (readl(pmc + PMC_SCRATCH41) == CPU_RESETTABLE)
+       if (readb(tegra20_cpu1_resettable_status) == CPU_RESETTABLE)
                tegra20_cpu_shutdown(1);
        else
                ret = -EINVAL;
Simple merge
Simple merge
Simple merge
Simple merge