Skip to content

Commit 9890368

Browse files
committed
parisc: Rewrite arch_cpu_idle_dead() for CPU hotplugging
Let the PDC firmware put the CPU into firmware idle loop with the pdc_cpu_rendezvous() function. Signed-off-by: Helge Deller <deller@gmx.de>
1 parent 88b3aac commit 9890368

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

arch/parisc/kernel/process.c

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include <linux/rcupdate.h>
3939
#include <linux/random.h>
4040
#include <linux/nmi.h>
41+
#include <linux/sched/hotplug.h>
4142

4243
#include <asm/io.h>
4344
#include <asm/asm-offsets.h>
@@ -46,6 +47,7 @@
4647
#include <asm/pdc_chassis.h>
4748
#include <asm/unwind.h>
4849
#include <asm/sections.h>
50+
#include <asm/cacheflush.h>
4951

5052
#define COMMAND_GLOBAL F_EXTEND(0xfffe0030)
5153
#define CMD_RESET 5 /* reset any module */
@@ -158,10 +160,29 @@ void release_thread(struct task_struct *dead_task)
158160
int running_on_qemu __ro_after_init;
159161
EXPORT_SYMBOL(running_on_qemu);
160162

161-
void __cpuidle arch_cpu_idle_dead(void)
163+
/*
164+
* Called from the idle thread for the CPU which has been shutdown.
165+
*/
166+
void arch_cpu_idle_dead(void)
162167
{
163-
/* nop on real hardware, qemu will offline CPU. */
164-
asm volatile("or %%r31,%%r31,%%r31\n":::);
168+
#ifdef CONFIG_HOTPLUG_CPU
169+
idle_task_exit();
170+
171+
local_irq_disable();
172+
173+
/* Tell __cpu_die() that this CPU is now safe to dispose of. */
174+
(void)cpu_report_death();
175+
176+
/* Ensure that the cache lines are written out. */
177+
flush_cache_all_local();
178+
flush_tlb_all_local(NULL);
179+
180+
/* Let PDC firmware put CPU into firmware idle loop. */
181+
__pdc_cpu_rendezvous();
182+
183+
pr_warn("PDC does not provide rendezvous function.\n");
184+
#endif
185+
while (1);
165186
}
166187

167188
void __cpuidle arch_cpu_idle(void)

0 commit comments

Comments
 (0)