From: Tao Zeng Date: Wed, 12 Dec 2018 06:37:26 +0000 (+0800) Subject: mm: fix suspend crash on u200 [1/1] X-Git-Tag: hardkernel-4.9.236-104~2031 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=00dc43b368dd8afee8ccd75b763c74589d7c16a1;p=platform%2Fkernel%2Flinux-amlogic.git mm: fix suspend crash on u200 [1/1] 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 --- diff --git a/arch/arm64/kernel/suspend.c b/arch/arm64/kernel/suspend.c index 1e3be90..db2089a 100644 --- a/arch/arm64/kernel/suspend.c +++ b/arch/arm64/kernel/suspend.c @@ -12,6 +12,9 @@ #include #include #include +#ifdef CONFIG_AMLOGIC_VMAP +#include +#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 diff --git a/drivers/amlogic/pm/gx_pm.c b/drivers/amlogic/pm/gx_pm.c index dbf9151..8228001 100644 --- a/drivers/amlogic/pm/gx_pm.c +++ b/drivers/amlogic/pm/gx_pm.c @@ -42,9 +42,6 @@ #include #include <../kernel/power/power.h> #include -#ifdef CONFIG_AMLOGIC_VMAP -#include -#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)