From fb3f709afe4ec260f310dd1569f589aafe8856be Mon Sep 17 00:00:00 2001 From: Chenhui Zhao Date: Mon, 8 Dec 2014 17:55:13 +0800 Subject: arm: ls1: only call ls1_pm_iomap() when doing deep sleep ls1_pm_iomap() maps some register spaces for deep sleep, so do not call ls1_pm_iomap() when doing sleep. This patch also fixes a kernel BUG which happens when doing sleep on LS1021ATWR board. Signed-off-by: Chenhui Zhao Change-Id: I1e06222f6ee2f6c44f763d48d959680838db0551 Reviewed-on: http://git.am.freescale.net:8181/25476 Reviewed-by: Yang Li Tested-by: Review Code-CDREVIEW Reviewed-by: Matthew Weigel diff --git a/arch/arm/mach-imx/pm-ls1.c b/arch/arm/mach-imx/pm-ls1.c index ad32c62..827a486 100644 --- a/arch/arm/mach-imx/pm-ls1.c +++ b/arch/arm/mach-imx/pm-ls1.c @@ -81,6 +81,7 @@ static u8 ddr_buff[DDR_BUF_SIZE] __aligned(64); static struct ls1_pm_baseaddr ls1_pm_base; /* supported sleep modes by the present platform */ static unsigned int sleep_modes; +static suspend_state_t ls1_pm_state; static void ls1_pm_iomap(void) { @@ -330,14 +331,18 @@ static int ls1_suspend_valid(suspend_state_t state) static int ls1_suspend_begin(suspend_state_t state) { - ls1_pm_iomap(); + ls1_pm_state = state; + + if (ls1_pm_state == PM_SUSPEND_MEM) + ls1_pm_iomap(); return 0; } static void ls1_suspend_end(void) { - ls1_pm_uniomap(); + if (ls1_pm_state == PM_SUSPEND_MEM) + ls1_pm_uniomap(); } static const struct platform_suspend_ops ls1_suspend_ops = { -- cgit v0.10.2