mirror of
https://github.com/torvalds/linux.git
synced 2024-11-26 22:21:42 +00:00
The imx fixes for 3.9, take 4:
Running suspend/resume without no_console_suspend setting on kernel cmdline will likely makes system hang. It causesd by the sync issue between imx_cpu_die() and imx_cpu_kill() call. Fix the issue by synchronizing the calls using cpu jumping argument register which is free to use in kernel. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQEcBAABAgAGBQJRU60+AAoJEFBXWFqHsHzOTzAIAL0t34b0Pd1FRuybb8q1uwGJ Xe7gr/knRLszQ6FemX4F2qqU3Xdx2OLjET6iZT1j1pcO2WOUB93C0Pa6hwZ7u8ex 4EMgBiwaEqnr8ICkPMEQIrJ/ja8VIazYwgFDk3MDV4djIDPEdl6CZz9BOWXSce8M f9o8YhmVvV5TINz9TxOKNA19qxjxqR8K/WT3DsiTxmo7660rtMO4VNhPFhRLMRlm 8qd0SSZ9XYNa05aJdXa+YayCpm6SGdcSj6fWrpDmQ4926D9dhvX/TEDNqmibfUyw 7YAyk2p1U8W5+20nUrYDjZnfBzLgaTFg60Y60DrYbcOPk7ZlqRgGk0SyIjGwyjw= =V81t -----END PGP SIGNATURE----- Merge tag 'imx-fixes-3.9-4' of git://git.linaro.org/people/shawnguo/linux-2.6 into fixes From Shawn Guo <shawn.guo@linaro.org>: The imx fixes for 3.9, take 4: Running suspend/resume without no_console_suspend setting on kernel cmdline will likely makes system hang. It causesd by the sync issue between imx_cpu_die() and imx_cpu_kill() call. Fix the issue by synchronizing the calls using cpu jumping argument register which is free to use in kernel. * tag 'imx-fixes-3.9-4' of git://git.linaro.org/people/shawnguo/linux-2.6: ARM: imx: fix sync issue between imx_cpu_die and imx_cpu_kill ARM: imx: add dependency check for DEBUG_IMX_UART_PORT Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
commit
fb5d932ac2
@ -495,6 +495,7 @@ config DEBUG_IMX_UART_PORT
|
||||
DEBUG_IMX53_UART || \
|
||||
DEBUG_IMX6Q_UART
|
||||
default 1
|
||||
depends on ARCH_MXC
|
||||
help
|
||||
Choose UART port on which kernel low-level debug messages
|
||||
should be output.
|
||||
|
@ -110,6 +110,8 @@ void tzic_handle_irq(struct pt_regs *);
|
||||
|
||||
extern void imx_enable_cpu(int cpu, bool enable);
|
||||
extern void imx_set_cpu_jump(int cpu, void *jump_addr);
|
||||
extern u32 imx_get_cpu_arg(int cpu);
|
||||
extern void imx_set_cpu_arg(int cpu, u32 arg);
|
||||
extern void v7_cpu_resume(void);
|
||||
extern u32 *pl310_get_save_ptr(void);
|
||||
#ifdef CONFIG_SMP
|
||||
|
@ -46,11 +46,23 @@ static inline void cpu_enter_lowpower(void)
|
||||
void imx_cpu_die(unsigned int cpu)
|
||||
{
|
||||
cpu_enter_lowpower();
|
||||
/*
|
||||
* We use the cpu jumping argument register to sync with
|
||||
* imx_cpu_kill() which is running on cpu0 and waiting for
|
||||
* the register being cleared to kill the cpu.
|
||||
*/
|
||||
imx_set_cpu_arg(cpu, ~0);
|
||||
cpu_do_idle();
|
||||
}
|
||||
|
||||
int imx_cpu_kill(unsigned int cpu)
|
||||
{
|
||||
unsigned long timeout = jiffies + msecs_to_jiffies(50);
|
||||
|
||||
while (imx_get_cpu_arg(cpu) == 0)
|
||||
if (time_after(jiffies, timeout))
|
||||
return 0;
|
||||
imx_enable_cpu(cpu, false);
|
||||
imx_set_cpu_arg(cpu, 0);
|
||||
return 1;
|
||||
}
|
||||
|
@ -43,6 +43,18 @@ void imx_set_cpu_jump(int cpu, void *jump_addr)
|
||||
src_base + SRC_GPR1 + cpu * 8);
|
||||
}
|
||||
|
||||
u32 imx_get_cpu_arg(int cpu)
|
||||
{
|
||||
cpu = cpu_logical_map(cpu);
|
||||
return readl_relaxed(src_base + SRC_GPR1 + cpu * 8 + 4);
|
||||
}
|
||||
|
||||
void imx_set_cpu_arg(int cpu, u32 arg)
|
||||
{
|
||||
cpu = cpu_logical_map(cpu);
|
||||
writel_relaxed(arg, src_base + SRC_GPR1 + cpu * 8 + 4);
|
||||
}
|
||||
|
||||
void imx_src_prepare_restart(void)
|
||||
{
|
||||
u32 val;
|
||||
|
Loading…
Reference in New Issue
Block a user