Skip to content

Commit 993ff6d

Browse files
npigginmpe
authored andcommitted
powerpc/64s: Fix PACA_IRQ_HARD_DIS accounting in idle_power4()
When idle_power4() hard disables interrupts then finds a soft pending interrupt, it returns with interrupts hard disabled but without PACA_IRQ_HARD_DIS set. Commit 9b81c02 ("powerpc/64s: make PACA_IRQ_HARD_DIS track MSR[EE] closely") added a warning for that condition (since disabled). Fix this by adding the PACA_IRQ_HARD_DIS for that case. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent a2dc009 commit 993ff6d

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

arch/powerpc/kernel/idle_power4.S

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ END_FTR_SECTION_IFCLR(CPU_FTR_CAN_NAP)
3232
cmpwi 0,r4,0
3333
beqlr
3434

35+
/* This sequence is similar to prep_irq_for_idle() */
36+
3537
/* Hard disable interrupts */
3638
mfmsr r7
3739
rldicl r0,r7,48,1
@@ -41,10 +43,15 @@ END_FTR_SECTION_IFCLR(CPU_FTR_CAN_NAP)
4143
/* Check if something happened while soft-disabled */
4244
lbz r0,PACAIRQHAPPENED(r13)
4345
cmpwi cr0,r0,0
44-
bnelr
46+
bne- 2f
4547

46-
/* Soft-enable interrupts */
48+
/*
49+
* Soft-enable interrupts. This will make power4_fixup_nap return
50+
* to our caller with interrupts enabled (soft and hard). The caller
51+
* can cope with either interrupts disabled or enabled upon return.
52+
*/
4753
#ifdef CONFIG_TRACE_IRQFLAGS
54+
/* Tell the tracer interrupts are on, because idle responds to them. */
4855
mflr r0
4956
std r0,16(r1)
5057
stdu r1,-128(r1)
@@ -73,3 +80,8 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
7380
isync
7481
b 1b
7582

83+
2: /* Return if an interrupt had happened while soft disabled */
84+
/* Set the HARD_DIS flag because interrupts are now hard disabled */
85+
ori r0,r0,PACA_IRQ_HARD_DIS
86+
stb r0,PACAIRQHAPPENED(r13)
87+
blr

0 commit comments

Comments
 (0)