mm: fix suspend crash on u200 [1/1]
authorTao Zeng <tao.zeng@amlogic.com>
Wed, 12 Dec 2018 06:37:26 +0000 (14:37 +0800)
committerLuan Yuan <luan.yuan@amlogic.com>
Mon, 17 Dec 2018 09:27:29 +0000 (17:27 +0800)
PD#SWPL-1219

Problem:
When open vmap stack, suspend will fail on U200. If open cpu idle,
resume from idle will fail too.

Solution:
set up vmap stack early before open IRQ. If set up this stack late
than IRQ open, stack will point to a ramdom address

Verify:
u200

Change-Id: Ie60f6faadf9afece47ccc887a0af46814f070897
Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
arch/arm64/kernel/suspend.c
drivers/amlogic/pm/gx_pm.c

index 1e3be90..db2089a 100644 (file)
@@ -12,6 +12,9 @@
 #include <asm/smp_plat.h>
 #include <asm/suspend.h>
 #include <asm/tlbflush.h>
+#ifdef CONFIG_AMLOGIC_VMAP
+#include <linux/amlogic/vmap_stack.h>
+#endif
 
 /*
  * This is allocated by cpu_suspend_init(), and used to store a pointer to
@@ -39,6 +42,9 @@ void notrace __cpu_suspend_exit(void)
 {
        unsigned int cpu = smp_processor_id();
 
+#ifdef CONFIG_AMLOGIC_VMAP
+       __setup_vmap_stack(my_cpu_offset);
+#endif
        /*
         * We are resuming from reset with the idmap active in TTBR0_EL1.
         * We must uninstall the idmap and restore the expected MMU
index dbf9151..8228001 100644 (file)
@@ -42,9 +42,6 @@
 #include <linux/kobject.h>
 #include <../kernel/power/power.h>
 #include <linux/amlogic/scpi_protocol.h>
-#ifdef CONFIG_AMLOGIC_VMAP
-#include <linux/amlogic/vmap_stack.h>
-#endif
 
 typedef unsigned long (psci_fn)(unsigned long, unsigned long,
                                unsigned long, unsigned long);
@@ -85,9 +82,6 @@ static void meson_gx_suspend(void)
 /*     cpu_suspend(0, meson_system_suspend);
  */
        pr_info("... wake up\n");
-#ifdef CONFIG_AMLOGIC_VMAP
-       __setup_vmap_stack(my_cpu_offset);
-#endif
 }
 
 static int meson_pm_prepare(void)