Skip to content

Commit

Permalink
sparc32, leon: Enable interrupts before going idle to avoid getting s…
Browse files Browse the repository at this point in the history
…tuck

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

Commit 87fa05a, "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: Andreas Larsson <andreas@gaisler.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Andreas Larsson authored and David S. Miller committed Jun 19, 2013
1 parent 1ffbc51 commit d72ee6b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions arch/sparc/kernel/leon_pmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ void pmc_leon_idle_fixup(void)
* MMU does not get a TLB miss here by using the MMU BYPASS ASI.
*/
register unsigned int address = (unsigned int)leon3_irqctrl_regs;

/* Interrupts need to be enabled to not hang the CPU */
local_irq_enable();

__asm__ __volatile__ (
"wr %%g0, %%asr19\n"
"lda [%0] %1, %%g0\n"
Expand All @@ -60,6 +64,9 @@ void pmc_leon_idle_fixup(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 */
__asm__ __volatile__ ("wr %g0, %asr19\n\t");
}
Expand Down

0 comments on commit d72ee6b

Please sign in to comment.