ARM: tegra: power: restore reset handler after lp0
Jin Qian [Wed, 24 Aug 2011 01:15:32 +0000 (18:15 -0700)]
Bug 862504

Change-Id: I910f4f229a2040d13d79e2a4f64fd2558509d9e7
Reviewed-on: http://git-master/r/50241
Reviewed-by: Jin Qian <jqian@nvidia.com>
Tested-by: Jin Qian <jqian@nvidia.com>
Reviewed-by: Aleksandr Frid <afrid@nvidia.com>
Reviewed-by: Scott Williams <scwilliams@nvidia.com>

Rebase-Id: R3c4d055f1c2ebad76ad2a9305d5e02f5a4411400

arch/arm/mach-tegra/pm.c
arch/arm/mach-tegra/reset.c

index 06ce359..9e6c9a8 100644 (file)
@@ -778,6 +778,7 @@ int tegra_suspend_dram(enum tegra_suspend_mode mode, unsigned int flags)
        if (mode == TEGRA_SUSPEND_LP0) {
                tegra_lp0_cpu_mode(true);
                tegra_lp0_suspend_mc();
+               tegra_cpu_reset_handler_save();
        }
 
        suspend_cpu_complex(flags);
@@ -797,6 +798,7 @@ int tegra_suspend_dram(enum tegra_suspend_mode mode, unsigned int flags)
        tegra_init_cache();
 
        if (mode == TEGRA_SUSPEND_LP0) {
+               tegra_cpu_reset_handler_restore();
                tegra_lp0_resume_mc();
                tegra_lp0_cpu_mode(false);
        } else if (mode == TEGRA_SUSPEND_LP1)
index 853edde..30efd2c 100644 (file)
@@ -71,15 +71,13 @@ static void __init tegra_cpu_reset_handler_enable(void)
 }
 
 #ifdef CONFIG_PM_SLEEP
-static unsigned long cpu_reset_handler_save[TEGRA_RESET_DATA_SIZE];
-
 void tegra_cpu_reset_handler_save(void)
 {
        unsigned int i;
        BUG_ON(!is_enabled);
        for (i = 0; i < TEGRA_RESET_DATA_SIZE; i++)
-               cpu_reset_handler_save[i] =
-                                       tegra_cpu_reset_handler_ptr[i];
+               __tegra_cpu_reset_handler_data[i] =
+                       tegra_cpu_reset_handler_ptr[i];
        is_enabled = false;
 }
 
@@ -87,9 +85,10 @@ void tegra_cpu_reset_handler_restore(void)
 {
        unsigned int i;
        BUG_ON(is_enabled);
+       tegra_cpu_reset_handler_enable();
        for (i = 0; i < TEGRA_RESET_DATA_SIZE; i++)
                tegra_cpu_reset_handler_ptr[i] =
-                                       cpu_reset_handler_save[i];
+                       __tegra_cpu_reset_handler_data[i];
        is_enabled = true;
 }
 #endif