提交 d72ee6be 编写于 作者: A Andreas Larsson 提交者: David S. Miller

sparc32, leon: Enable interrupts before going idle to avoid getting stuck

This enables interrupts for Leon before having the CPU enter power-down mode.

Commit 87fa05ae, "sparc: Use generic idle loop",
gets the CPU stuck on idle for Leon systems. On Leon, disabling interrupts and
powering down the processor will get the processor stuck waiting for an
interrupt that will never be reacted to.
Signed-off-by: NAndreas Larsson <andreas@gaisler.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 1ffbc51a
...@@ -47,6 +47,10 @@ void pmc_leon_idle_fixup(void) ...@@ -47,6 +47,10 @@ void pmc_leon_idle_fixup(void)
* MMU does not get a TLB miss here by using the MMU BYPASS ASI. * MMU does not get a TLB miss here by using the MMU BYPASS ASI.
*/ */
register unsigned int address = (unsigned int)leon3_irqctrl_regs; register unsigned int address = (unsigned int)leon3_irqctrl_regs;
/* Interrupts need to be enabled to not hang the CPU */
local_irq_enable();
__asm__ __volatile__ ( __asm__ __volatile__ (
"wr %%g0, %%asr19\n" "wr %%g0, %%asr19\n"
"lda [%0] %1, %%g0\n" "lda [%0] %1, %%g0\n"
...@@ -60,6 +64,9 @@ void pmc_leon_idle_fixup(void) ...@@ -60,6 +64,9 @@ void pmc_leon_idle_fixup(void)
*/ */
void pmc_leon_idle(void) void pmc_leon_idle(void)
{ {
/* Interrupts need to be enabled to not hang the CPU */
local_irq_enable();
/* For systems without power-down, this will be no-op */ /* For systems without power-down, this will be no-op */
__asm__ __volatile__ ("wr %g0, %asr19\n\t"); __asm__ __volatile__ ("wr %g0, %asr19\n\t");
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册