Skip to content

Commit 375f561

Browse files
paulusmackozbenh
authored andcommitted
powerpc/powernv: Always go into nap mode when CPU is offline
The CPU hotplug code for the powernv platform currently only puts offline CPUs into nap mode if the powersave_nap variable is set. However, HV-style KVM on this platform requires secondary CPU threads to be offline and in nap mode. Since we know nap mode works just fine on all POWER7 machines, and the only machines that support the powernv platform are POWER7 machines, this changes the code to always put offline CPUs into nap mode, regardless of powersave_nap. Powersave_nap still controls whether or not CPUs go into nap mode when idle, as before. Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
1 parent dabe859 commit 375f561

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

arch/powerpc/include/asm/processor.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ extern unsigned long cpuidle_disable;
386386
enum idle_boot_override {IDLE_NO_OVERRIDE = 0, IDLE_POWERSAVE_OFF};
387387

388388
extern int powersave_nap;/* set if nap mode can be used in idle loop */
389+
extern void power7_nap(void);
389390

390391
#ifdef CONFIG_PSERIES_IDLE
391392
extern void update_smt_snooze_delay(int snooze);

arch/powerpc/kernel/idle_power7.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ _GLOBAL(power7_idle)
2828
lwz r4,ADDROFF(powersave_nap)(r3)
2929
cmpwi0,r4,0
3030
beqlr
31+
/* fall through */
3132

33+
_GLOBAL(power7_nap)
3234
/* NAP is a state loss, we create a regs frame on the
3335
* stack, fill it up with the state we care about and
3436
* stick a pointer to it in PACAR1. We really only

arch/powerpc/platforms/powernv/smp.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,6 @@ static void pnv_smp_cpu_kill_self(void)
106106
{
107107
unsigned int cpu;
108108

109-
/* If powersave_nap is enabled, use NAP mode, else just
110-
* spin aimlessly
111-
*/
112-
if (!powersave_nap) {
113-
generic_mach_cpu_die();
114-
return;
115-
}
116-
117109
/* Standard hot unplug procedure */
118110
local_irq_disable();
119111
idle_task_exit();
@@ -128,7 +120,7 @@ static void pnv_smp_cpu_kill_self(void)
128120
*/
129121
mtspr(SPRN_LPCR, mfspr(SPRN_LPCR) & ~(u64)LPCR_PECE1);
130122
while (!generic_check_cpu_restart(cpu)) {
131-
power7_idle();
123+
power7_nap();
132124
if (!generic_check_cpu_restart(cpu)) {
133125
DBG("CPU%d Unexpected exit while offline !\n", cpu);
134126
/* We may be getting an IPI, so we re-enable

0 commit comments

Comments
 (0)