Skip to content

Commit

Permalink
[POWERPC] cell: hard disable interrupts in power_save()
Browse files Browse the repository at this point in the history
With soft-disabled interrupts in power_save, we can
still get external exceptions on Cell, even if we are
in pause(0) a.k.a. sleep state.

When the CPU really wakes up through the 0x100 (system reset)
vector, while we have already started processing the 0x500
(external) exception, we get a panic in unrecoverable_exception()
because of the lost state.

This occurred in Systemsim for Cell, but as far as I can see,
it can theoretically occur on any machine that uses the
system reset exception to get out of sleep state.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
  • Loading branch information
Benjamin Herrenschmidt authored and Paul Mackerras committed Dec 4, 2006
1 parent bf1ab97 commit 5850dd8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions arch/powerpc/platforms/cell/pervasive.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@
static void cbe_power_save(void)
{
unsigned long ctrl, thread_switch_control;

/*
* We need to hard disable interrupts, but we also need to mark them
* hard disabled in the PACA so that the local_irq_enable() done by
* our caller upon return propertly hard enables.
*/
hard_irq_disable();
get_paca()->hard_enabled = 0;

ctrl = mfspr(SPRN_CTRLF);

/* Enable DEC and EE interrupt request */
Expand Down

0 comments on commit 5850dd8

Please sign in to comment.