diff options
Diffstat (limited to 'arch/x86/kernel/apic/x2apic_cluster.c')
-rw-r--r-- | arch/x86/kernel/apic/x2apic_cluster.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/arch/x86/kernel/apic/x2apic_cluster.c b/arch/x86/kernel/apic/x2apic_cluster.c index 6368fa69d2af..54f35d988025 100644 --- a/arch/x86/kernel/apic/x2apic_cluster.c +++ b/arch/x86/kernel/apic/x2apic_cluster.c | |||
@@ -155,7 +155,7 @@ static void init_x2apic_ldr(void) | |||
155 | /* | 155 | /* |
156 | * At CPU state changes, update the x2apic cluster sibling info. | 156 | * At CPU state changes, update the x2apic cluster sibling info. |
157 | */ | 157 | */ |
158 | int x2apic_prepare_cpu(unsigned int cpu) | 158 | static int x2apic_prepare_cpu(unsigned int cpu) |
159 | { | 159 | { |
160 | if (!zalloc_cpumask_var(&per_cpu(cpus_in_cluster, cpu), GFP_KERNEL)) | 160 | if (!zalloc_cpumask_var(&per_cpu(cpus_in_cluster, cpu), GFP_KERNEL)) |
161 | return -ENOMEM; | 161 | return -ENOMEM; |
@@ -168,7 +168,7 @@ int x2apic_prepare_cpu(unsigned int cpu) | |||
168 | return 0; | 168 | return 0; |
169 | } | 169 | } |
170 | 170 | ||
171 | int x2apic_dead_cpu(unsigned int this_cpu) | 171 | static int x2apic_dead_cpu(unsigned int this_cpu) |
172 | { | 172 | { |
173 | int cpu; | 173 | int cpu; |
174 | 174 | ||
@@ -186,13 +186,18 @@ int x2apic_dead_cpu(unsigned int this_cpu) | |||
186 | static int x2apic_cluster_probe(void) | 186 | static int x2apic_cluster_probe(void) |
187 | { | 187 | { |
188 | int cpu = smp_processor_id(); | 188 | int cpu = smp_processor_id(); |
189 | int ret; | ||
189 | 190 | ||
190 | if (!x2apic_mode) | 191 | if (!x2apic_mode) |
191 | return 0; | 192 | return 0; |
192 | 193 | ||
194 | ret = cpuhp_setup_state(CPUHP_X2APIC_PREPARE, "X2APIC_PREPARE", | ||
195 | x2apic_prepare_cpu, x2apic_dead_cpu); | ||
196 | if (ret < 0) { | ||
197 | pr_err("Failed to register X2APIC_PREPARE\n"); | ||
198 | return 0; | ||
199 | } | ||
193 | cpumask_set_cpu(cpu, per_cpu(cpus_in_cluster, cpu)); | 200 | cpumask_set_cpu(cpu, per_cpu(cpus_in_cluster, cpu)); |
194 | cpuhp_setup_state(CPUHP_X2APIC_PREPARE, "X2APIC_PREPARE", | ||
195 | x2apic_prepare_cpu, x2apic_dead_cpu); | ||
196 | return 1; | 201 | return 1; |
197 | } | 202 | } |
198 | 203 | ||