Skip to content

Commit 7073377

Browse files
Suzuki K PouloseAKASHI Takahiro
authored andcommitted
arm64: Move cpu_die_early to smp.c
This patch moves cpu_die_early to smp.c, where it fits better. No functional changes, except for adding the necessary checks for CONFIG_HOTPLUG_CPU. Cc: Mark Rutland <mark.rutland@arm.com> Acked-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent 8083cfe commit 7073377

3 files changed

Lines changed: 23 additions & 19 deletions

File tree

arch/arm64/include/asm/smp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ extern int __cpu_disable(void);
7777

7878
extern void __cpu_die(unsigned int cpu);
7979
extern void cpu_die(void);
80+
extern void cpu_die_early(void);
8081

8182
static inline void cpu_park_loop(void)
8283
{

arch/arm64/kernel/cpufeature.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -893,25 +893,6 @@ static u64 __raw_read_system_reg(u32 sys_id)
893893
}
894894
}
895895

896-
/*
897-
* Kill the calling secondary CPU, early in bringup before it is turned
898-
* online.
899-
*/
900-
void cpu_die_early(void)
901-
{
902-
int cpu = smp_processor_id();
903-
904-
pr_crit("CPU%d: will not boot\n", cpu);
905-
906-
/* Mark this CPU absent */
907-
set_cpu_present(cpu, 0);
908-
909-
/* Check if we can park ourselves */
910-
if (cpu_ops[cpu] && cpu_ops[cpu]->cpu_die)
911-
cpu_ops[cpu]->cpu_die(cpu);
912-
cpu_park_loop();
913-
}
914-
915896
/*
916897
* Run through the enabled system capabilities and enable() it on this CPU.
917898
* The capabilities were decided based on the available CPUs at the boot time.

arch/arm64/kernel/smp.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,28 @@ void cpu_die(void)
311311
}
312312
#endif
313313

314+
/*
315+
* Kill the calling secondary CPU, early in bringup before it is turned
316+
* online.
317+
*/
318+
void cpu_die_early(void)
319+
{
320+
int cpu = smp_processor_id();
321+
322+
pr_crit("CPU%d: will not boot\n", cpu);
323+
324+
/* Mark this CPU absent */
325+
set_cpu_present(cpu, 0);
326+
327+
#ifdef CONFIG_HOTPLUG_CPU
328+
/* Check if we can park ourselves */
329+
if (cpu_ops[cpu] && cpu_ops[cpu]->cpu_die)
330+
cpu_ops[cpu]->cpu_die(cpu);
331+
#endif
332+
333+
cpu_park_loop();
334+
}
335+
314336
static void __init hyp_mode_check(void)
315337
{
316338
if (is_hyp_mode_available())

0 commit comments

Comments
 (0)