mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-27 19:25:05 +07:00
fa3f82c8bb
Various thing are torn down when a CPU is hot-unplugged. That CPU is expected to go back to start_secondary when re-plugged to re initialize everything, such as clock sources, maps, ... Some implementations just return from cpu_die() callback in the idle loop when the CPU is "re-plugged". This is not enough. We fix it using a little asm trampoline which resets the stack and calls back into start_secondary as if we were all fresh from boot. The trampoline already existed on ppc64, but we add it for ppc32 Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
38 lines
889 B
C
38 lines
889 B
C
#ifndef _OFFLINE_STATES_H_
|
|
#define _OFFLINE_STATES_H_
|
|
|
|
/* Cpu offline states go here */
|
|
enum cpu_state_vals {
|
|
CPU_STATE_OFFLINE,
|
|
CPU_STATE_INACTIVE,
|
|
CPU_STATE_ONLINE,
|
|
CPU_MAX_OFFLINE_STATES
|
|
};
|
|
|
|
#ifdef CONFIG_HOTPLUG_CPU
|
|
extern enum cpu_state_vals get_cpu_current_state(int cpu);
|
|
extern void set_cpu_current_state(int cpu, enum cpu_state_vals state);
|
|
extern void set_preferred_offline_state(int cpu, enum cpu_state_vals state);
|
|
extern void set_default_offline_state(int cpu);
|
|
#else
|
|
static inline enum cpu_state_vals get_cpu_current_state(int cpu)
|
|
{
|
|
return CPU_STATE_ONLINE;
|
|
}
|
|
|
|
static inline void set_cpu_current_state(int cpu, enum cpu_state_vals state)
|
|
{
|
|
}
|
|
|
|
static inline void set_preferred_offline_state(int cpu, enum cpu_state_vals state)
|
|
{
|
|
}
|
|
|
|
static inline void set_default_offline_state(int cpu)
|
|
{
|
|
}
|
|
#endif
|
|
|
|
extern enum cpu_state_vals get_preferred_offline_state(int cpu);
|
|
#endif
|