From 9beb643af8a33cdb202173feb7e6d4f923cfc6e3 Mon Sep 17 00:00:00 2001 From: Tao Zeng Date: Wed, 12 Dec 2018 14:37:26 +0800 Subject: [PATCH] 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 --- arch/arm64/kernel/suspend.c | 6 ++++++ drivers/amlogic/pm/gx_pm.c | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) 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) -- 2.7.4