提交 c4bc34d2 编写于 作者: S Suzuki K Poulose 提交者: Catalin Marinas

arm64: Add a helper for parking CPUs in a loop

Adds a routine which can be used to park CPUs (spinning in kernel)
when they can't be killed.

Cc: Mark Rutland <mark.rutland@arm.com>
Acked-by: NWill Deacon <will.deacon@arm.com>
Signed-off-by: NSuzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
上级 2b5fe07a
......@@ -78,4 +78,12 @@ extern int __cpu_disable(void);
extern void __cpu_die(unsigned int cpu);
extern void cpu_die(void);
static inline void cpu_park_loop(void)
{
for (;;) {
wfe();
wfi();
}
}
#endif /* ifndef __ASM_SMP_H */
......@@ -890,10 +890,7 @@ static void fail_incapable_cpu(char *cap_type,
/* Check if we can park ourselves */
if (cpu_ops[cpu] && cpu_ops[cpu]->cpu_die)
cpu_ops[cpu]->cpu_die(cpu);
asm(
"1: wfe\n"
" wfi\n"
" b 1b");
cpu_park_loop();
}
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册