Skip to content

Commit ff2e6d7

Browse files
committed
powerpc: Fix goof in 6xx and POWER4 idle power-save functions
This fixes a mistake I made when editing these functions - when I took out the interrupt disabling code (because interrupts are now disabled by the caller) I left the register that is used for the MSR value to be used during doze/nap uninitialized. This fixes it. Also updated some of the comments in idle_power4.S and removed some code that was copied over from idle_6xx.S but is no longer relevant (we don't ever clear the CPU_FTR_CAN_NAP bit at runtime for POWER4). Signed-off-by: Paul Mackerras <paulus@samba.org>
1 parent 9618eda commit ff2e6d7

2 files changed

Lines changed: 5 additions & 21 deletions

File tree

‎arch/powerpc/kernel/idle_6xx.S‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ BEGIN_FTR_SECTION
144144
DSSALL
145145
sync
146146
END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
147-
ori r7,r7,MSR_EE /* Could be ommited (already set) */
147+
mfmsr r7
148+
ori r7,r7,MSR_EE
148149
oris r7,r7,MSR_POW@h
149150
sync
150151
isync

‎arch/powerpc/kernel/idle_power4.S‎

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
/*
2-
* This file contains the power_save function for 6xx & 7xxx CPUs
3-
* rewritten in assembler
4-
*
5-
* Warning ! This code assumes that if your machine has a 750fx
6-
* it will have PLL 1 set to low speed mode (used during NAP/DOZE).
7-
* if this is not the case some additional changes will have to
8-
* be done to check a runtime var (a bit like powersave-nap)
2+
* This file contains the power_save function for 970-family CPUs.
93
*
104
* This program is free software; you can redistribute it and/or
115
* modify it under the terms of the GNU General Public License
@@ -26,23 +20,10 @@
2620

2721
.text
2822

29-
/*
30-
* Here is the power_save_6xx function. This could eventually be
31-
* split into several functions & changing the function pointer
32-
* depending on the various features.
33-
*/
3423
_GLOBAL(power4_idle)
3524
BEGIN_FTR_SECTION
3625
blr
3726
END_FTR_SECTION_IFCLR(CPU_FTR_CAN_NAP)
38-
/* We must dynamically check for the NAP feature as it
39-
* can be cleared by CPU init after the fixups are done
40-
*/
41-
LOAD_REG_ADDRBASE(r3,cur_cpu_spec)
42-
ld r4,ADDROFF(cur_cpu_spec)(r3)
43-
ld r4,CPU_SPEC_FEATURES(r4)
44-
andi. r0,r4,CPU_FTR_CAN_NAP
45-
beqlr
4627
/* Now check if user or arch enabled NAP mode */
4728
LOAD_REG_ADDRBASE(r3,powersave_nap)
4829
lwz r4,ADDROFF(powersave_nap)(r3)
@@ -54,6 +35,8 @@ BEGIN_FTR_SECTION
5435
DSSALL
5536
sync
5637
END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
38+
mfmsr r7
39+
ori r7,r7,MSR_EE
5740
oris r7,r7,MSR_POW@h
5841
sync
5942
isync

0 commit comments

Comments
 (0)