|
@@ -155,7 +155,7 @@ static void init_x2apic_ldr(void)
|
|
|
/*
|
|
|
* At CPU state changes, update the x2apic cluster sibling info.
|
|
|
*/
|
|
|
-int x2apic_prepare_cpu(unsigned int cpu)
|
|
|
+static int x2apic_prepare_cpu(unsigned int cpu)
|
|
|
{
|
|
|
if (!zalloc_cpumask_var(&per_cpu(cpus_in_cluster, cpu), GFP_KERNEL))
|
|
|
return -ENOMEM;
|
|
@@ -168,7 +168,7 @@ int x2apic_prepare_cpu(unsigned int cpu)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-int x2apic_dead_cpu(unsigned int this_cpu)
|
|
|
+static int x2apic_dead_cpu(unsigned int this_cpu)
|
|
|
{
|
|
|
int cpu;
|
|
|
|
|
@@ -186,13 +186,18 @@ int x2apic_dead_cpu(unsigned int this_cpu)
|
|
|
static int x2apic_cluster_probe(void)
|
|
|
{
|
|
|
int cpu = smp_processor_id();
|
|
|
+ int ret;
|
|
|
|
|
|
if (!x2apic_mode)
|
|
|
return 0;
|
|
|
|
|
|
+ ret = cpuhp_setup_state(CPUHP_X2APIC_PREPARE, "X2APIC_PREPARE",
|
|
|
+ x2apic_prepare_cpu, x2apic_dead_cpu);
|
|
|
+ if (ret < 0) {
|
|
|
+ pr_err("Failed to register X2APIC_PREPARE\n");
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
cpumask_set_cpu(cpu, per_cpu(cpus_in_cluster, cpu));
|
|
|
- cpuhp_setup_state(CPUHP_X2APIC_PREPARE, "X2APIC_PREPARE",
|
|
|
- x2apic_prepare_cpu, x2apic_dead_cpu);
|
|
|
return 1;
|
|
|
}
|
|
|
|