Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 045f9d22 authored by Glauber Costa's avatar Glauber Costa Committed by Ingo Molnar
Browse files

x86: use remove_from_maps in cpu_disable



it is already used in x86_64. In i386, it only
removes from cpu_online_map

Signed-off-by: default avatarGlauber Costa <gcosta@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent fc25da9e
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -1041,6 +1041,11 @@ void __init native_smp_prepare_boot_cpu(void)
}
}


#ifdef CONFIG_HOTPLUG_CPU
#ifdef CONFIG_HOTPLUG_CPU
static void __ref remove_cpu_from_maps(int cpu)
{
	cpu_clear(cpu, cpu_online_map);
}

int __cpu_disable(void)
int __cpu_disable(void)
{
{
	cpumask_t map = cpu_online_map;
	cpumask_t map = cpu_online_map;
@@ -1066,7 +1071,7 @@ int __cpu_disable(void)


	remove_siblinginfo(cpu);
	remove_siblinginfo(cpu);


	cpu_clear(cpu, map);
	remove_cpu_from_maps(cpu);
	fixup_irqs(map);
	fixup_irqs(map);
	/* It's now safe to remove this processor from the online map */
	/* It's now safe to remove this processor from the online map */
	cpu_clear(cpu, cpu_online_map);
	cpu_clear(cpu, cpu_online_map);
+3 −5
Original line number Original line Diff line number Diff line
@@ -838,10 +838,9 @@ void __init native_smp_cpus_done(unsigned int max_cpus)
}
}


#ifdef CONFIG_HOTPLUG_CPU
#ifdef CONFIG_HOTPLUG_CPU
static void __ref remove_cpu_from_maps(void)
static void __ref remove_cpu_from_maps(int cpu)
{
{
	int cpu = smp_processor_id();
	cpu_clear(cpu, cpu_online_map);

	cpu_clear(cpu, cpu_callout_map);
	cpu_clear(cpu, cpu_callout_map);
	cpu_clear(cpu, cpu_callin_map);
	cpu_clear(cpu, cpu_callin_map);
	clear_bit(cpu, (unsigned long *)&cpu_initialized); /* was set by cpu_init() */
	clear_bit(cpu, (unsigned long *)&cpu_initialized); /* was set by cpu_init() */
@@ -880,8 +879,7 @@ int __cpu_disable(void)
	remove_siblinginfo(cpu);
	remove_siblinginfo(cpu);


	/* It's now safe to remove this processor from the online map */
	/* It's now safe to remove this processor from the online map */
	cpu_clear(cpu, cpu_online_map);
	remove_cpu_from_maps(cpu);
	remove_cpu_from_maps();
	fixup_irqs(cpu_online_map);
	fixup_irqs(cpu_online_map);
	return 0;
	return 0;
}
}