Skip to content

Commit 512a928

Browse files
a3fShawn Guo
authored andcommitted
ARM: imx: build v7_cpu_resume() unconditionally
This function is not only needed by the platform suspend code, but is also reused as the CPU resume function when the ARM cores can be powered down completely in deep idle, which is the case on i.MX6SX and i.MX6UL(L). Providing the static inline stub whenever CONFIG_SUSPEND is disabled means that those platforms will hang on resume from cpuidle if suspend is disabled. So there are two problems: - The static inline stub masks the linker error - The function is not available where needed Fix both by just building the function unconditionally, when CONFIG_SOC_IMX6 is enabled. The actual code is three instructions long, so it's arguably ok to just leave it in for all i.MX6 kernel configurations. Fixes: 05136f0 ("ARM: imx: support arm power off in cpuidle for i.mx6sx") Signed-off-by: Lucas Stach <[email protected]> Signed-off-by: Ahmad Fatoum <[email protected]> Signed-off-by: Rouven Czerwinski <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
1 parent eb0bbba commit 512a928

File tree

4 files changed

+28
-16
lines changed

4 files changed

+28
-16
lines changed

arch/arm/mach-imx/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ AFLAGS_suspend-imx6.o :=-Wa,-march=armv7-a
9191
obj-$(CONFIG_SOC_IMX6) += suspend-imx6.o
9292
obj-$(CONFIG_SOC_IMX53) += suspend-imx53.o
9393
endif
94+
AFLAGS_resume-imx6.o :=-Wa,-march=armv7-a
95+
obj-$(CONFIG_SOC_IMX6) += resume-imx6.o
9496
obj-$(CONFIG_SOC_IMX6) += pm-imx6.o
9597

9698
obj-$(CONFIG_SOC_IMX1) += mach-imx1.o

arch/arm/mach-imx/common.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,17 +109,17 @@ void imx_cpu_die(unsigned int cpu);
109109
int imx_cpu_kill(unsigned int cpu);
110110

111111
#ifdef CONFIG_SUSPEND
112-
void v7_cpu_resume(void);
113112
void imx53_suspend(void __iomem *ocram_vbase);
114113
extern const u32 imx53_suspend_sz;
115114
void imx6_suspend(void __iomem *ocram_vbase);
116115
#else
117-
static inline void v7_cpu_resume(void) {}
118116
static inline void imx53_suspend(void __iomem *ocram_vbase) {}
119117
static const u32 imx53_suspend_sz;
120118
static inline void imx6_suspend(void __iomem *ocram_vbase) {}
121119
#endif
122120

121+
void v7_cpu_resume(void);
122+
123123
void imx6_pm_ccm_init(const char *ccm_compat);
124124
void imx6q_pm_init(void);
125125
void imx6dl_pm_init(void);

arch/arm/mach-imx/resume-imx6.S

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/* SPDX-License-Identifier: GPL-2.0-or-later */
2+
/*
3+
* Copyright 2014 Freescale Semiconductor, Inc.
4+
*/
5+
6+
#include <linux/linkage.h>
7+
#include <asm/assembler.h>
8+
#include <asm/asm-offsets.h>
9+
#include <asm/hardware/cache-l2x0.h>
10+
#include "hardware.h"
11+
12+
/*
13+
* The following code must assume it is running from physical address
14+
* where absolute virtual addresses to the data section have to be
15+
* turned into relative ones.
16+
*/
17+
18+
ENTRY(v7_cpu_resume)
19+
bl v7_invalidate_l1
20+
#ifdef CONFIG_CACHE_L2X0
21+
bl l2c310_early_resume
22+
#endif
23+
b cpu_resume
24+
ENDPROC(v7_cpu_resume)

arch/arm/mach-imx/suspend-imx6.S

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -327,17 +327,3 @@ resume:
327327

328328
ret lr
329329
ENDPROC(imx6_suspend)
330-
331-
/*
332-
* The following code must assume it is running from physical address
333-
* where absolute virtual addresses to the data section have to be
334-
* turned into relative ones.
335-
*/
336-
337-
ENTRY(v7_cpu_resume)
338-
bl v7_invalidate_l1
339-
#ifdef CONFIG_CACHE_L2X0
340-
bl l2c310_early_resume
341-
#endif
342-
b cpu_resume
343-
ENDPROC(v7_cpu_resume)

0 commit comments

Comments
 (0)