diff options
Diffstat (limited to 'drivers/acpi/acpi_processor.c')
-rw-r--r-- | drivers/acpi/acpi_processor.c | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c index f29e06efa479..3c1d6b0c09a4 100644 --- a/drivers/acpi/acpi_processor.c +++ b/drivers/acpi/acpi_processor.c | |||
@@ -140,15 +140,11 @@ static int acpi_processor_errata_piix4(struct pci_dev *dev) | |||
140 | return 0; | 140 | return 0; |
141 | } | 141 | } |
142 | 142 | ||
143 | static int acpi_processor_errata(struct acpi_processor *pr) | 143 | static int acpi_processor_errata(void) |
144 | { | 144 | { |
145 | int result = 0; | 145 | int result = 0; |
146 | struct pci_dev *dev = NULL; | 146 | struct pci_dev *dev = NULL; |
147 | 147 | ||
148 | |||
149 | if (!pr) | ||
150 | return -EINVAL; | ||
151 | |||
152 | /* | 148 | /* |
153 | * PIIX4 | 149 | * PIIX4 |
154 | */ | 150 | */ |
@@ -181,7 +177,7 @@ static int acpi_processor_hotadd_init(struct acpi_processor *pr) | |||
181 | cpu_maps_update_begin(); | 177 | cpu_maps_update_begin(); |
182 | cpu_hotplug_begin(); | 178 | cpu_hotplug_begin(); |
183 | 179 | ||
184 | ret = acpi_map_lsapic(pr->handle, &pr->id); | 180 | ret = acpi_map_lsapic(pr->handle, pr->apic_id, &pr->id); |
185 | if (ret) | 181 | if (ret) |
186 | goto out; | 182 | goto out; |
187 | 183 | ||
@@ -219,11 +215,9 @@ static int acpi_processor_get_info(struct acpi_device *device) | |||
219 | int cpu_index, device_declaration = 0; | 215 | int cpu_index, device_declaration = 0; |
220 | acpi_status status = AE_OK; | 216 | acpi_status status = AE_OK; |
221 | static int cpu0_initialized; | 217 | static int cpu0_initialized; |
218 | unsigned long long value; | ||
222 | 219 | ||
223 | if (num_online_cpus() > 1) | 220 | acpi_processor_errata(); |
224 | errata.smp = TRUE; | ||
225 | |||
226 | acpi_processor_errata(pr); | ||
227 | 221 | ||
228 | /* | 222 | /* |
229 | * Check to see if we have bus mastering arbitration control. This | 223 | * Check to see if we have bus mastering arbitration control. This |
@@ -247,18 +241,12 @@ static int acpi_processor_get_info(struct acpi_device *device) | |||
247 | return -ENODEV; | 241 | return -ENODEV; |
248 | } | 242 | } |
249 | 243 | ||
250 | /* | ||
251 | * TBD: Synch processor ID (via LAPIC/LSAPIC structures) on SMP. | ||
252 | * >>> 'acpi_get_processor_id(acpi_id, &id)' in | ||
253 | * arch/xxx/acpi.c | ||
254 | */ | ||
255 | pr->acpi_id = object.processor.proc_id; | 244 | pr->acpi_id = object.processor.proc_id; |
256 | } else { | 245 | } else { |
257 | /* | 246 | /* |
258 | * Declared with "Device" statement; match _UID. | 247 | * Declared with "Device" statement; match _UID. |
259 | * Note that we don't handle string _UIDs yet. | 248 | * Note that we don't handle string _UIDs yet. |
260 | */ | 249 | */ |
261 | unsigned long long value; | ||
262 | status = acpi_evaluate_integer(pr->handle, METHOD_NAME__UID, | 250 | status = acpi_evaluate_integer(pr->handle, METHOD_NAME__UID, |
263 | NULL, &value); | 251 | NULL, &value); |
264 | if (ACPI_FAILURE(status)) { | 252 | if (ACPI_FAILURE(status)) { |
@@ -270,7 +258,9 @@ static int acpi_processor_get_info(struct acpi_device *device) | |||
270 | device_declaration = 1; | 258 | device_declaration = 1; |
271 | pr->acpi_id = value; | 259 | pr->acpi_id = value; |
272 | } | 260 | } |
273 | cpu_index = acpi_get_cpuid(pr->handle, device_declaration, pr->acpi_id); | 261 | pr->apic_id = acpi_get_apicid(pr->handle, device_declaration, |
262 | pr->acpi_id); | ||
263 | cpu_index = acpi_map_cpuid(pr->apic_id, pr->acpi_id); | ||
274 | 264 | ||
275 | /* Handle UP system running SMP kernel, with no LAPIC in MADT */ | 265 | /* Handle UP system running SMP kernel, with no LAPIC in MADT */ |
276 | if (!cpu0_initialized && (cpu_index == -1) && | 266 | if (!cpu0_initialized && (cpu_index == -1) && |
@@ -332,9 +322,9 @@ static int acpi_processor_get_info(struct acpi_device *device) | |||
332 | * ensure we get the right value in the "physical id" field | 322 | * ensure we get the right value in the "physical id" field |
333 | * of /proc/cpuinfo | 323 | * of /proc/cpuinfo |
334 | */ | 324 | */ |
335 | status = acpi_evaluate_object(pr->handle, "_SUN", NULL, &buffer); | 325 | status = acpi_evaluate_integer(pr->handle, "_SUN", NULL, &value); |
336 | if (ACPI_SUCCESS(status)) | 326 | if (ACPI_SUCCESS(status)) |
337 | arch_fix_phys_package_id(pr->id, object.integer.value); | 327 | arch_fix_phys_package_id(pr->id, value); |
338 | 328 | ||
339 | return 0; | 329 | return 0; |
340 | } | 330 | } |