Lines Matching full:pr
40 struct acpi_processor *pr; in acpi_get_processor_handle() local
42 pr = per_cpu(processors, cpu); in acpi_get_processor_handle()
43 if (pr) in acpi_get_processor_handle()
44 return pr->handle; in acpi_get_processor_handle()
199 static int acpi_processor_set_per_cpu(struct acpi_processor *pr, in acpi_processor_set_per_cpu() argument
202 BUG_ON(pr->id >= nr_cpu_ids); in acpi_processor_set_per_cpu()
209 if (per_cpu(processor_device_array, pr->id) != NULL && in acpi_processor_set_per_cpu()
210 per_cpu(processor_device_array, pr->id) != device) { in acpi_processor_set_per_cpu()
213 pr->id); in acpi_processor_set_per_cpu()
220 per_cpu(processor_device_array, pr->id) = device; in acpi_processor_set_per_cpu()
221 per_cpu(processors, pr->id) = pr; in acpi_processor_set_per_cpu()
227 static int acpi_processor_hotadd_init(struct acpi_processor *pr, in acpi_processor_hotadd_init() argument
232 if (invalid_phys_cpuid(pr->phys_id)) in acpi_processor_hotadd_init()
238 ret = acpi_map_cpu(pr->handle, pr->phys_id, pr->acpi_id, &pr->id); in acpi_processor_hotadd_init()
242 ret = acpi_processor_set_per_cpu(pr, device); in acpi_processor_hotadd_init()
244 acpi_unmap_cpu(pr->id); in acpi_processor_hotadd_init()
248 ret = arch_register_cpu(pr->id); in acpi_processor_hotadd_init()
251 per_cpu(processors, pr->id) = NULL; in acpi_processor_hotadd_init()
252 acpi_unmap_cpu(pr->id); in acpi_processor_hotadd_init()
261 pr_info("CPU%d has been hot-added\n", pr->id); in acpi_processor_hotadd_init()
269 static inline int acpi_processor_hotadd_init(struct acpi_processor *pr, in acpi_processor_hotadd_init() argument
280 struct acpi_processor *pr = acpi_driver_data(device); in acpi_processor_get_info() local
294 pr->flags.bm_control = 1; in acpi_processor_get_info()
301 status = acpi_evaluate_object(pr->handle, NULL, NULL, &buffer); in acpi_processor_get_info()
309 pr->acpi_id = object.processor.proc_id; in acpi_processor_get_info()
314 status = acpi_evaluate_integer(pr->handle, METHOD_NAME__UID, in acpi_processor_get_info()
323 pr->acpi_id = value; in acpi_processor_get_info()
326 if (acpi_duplicate_processor_id(pr->acpi_id)) { in acpi_processor_get_info()
327 if (pr->acpi_id == 0xff) in acpi_processor_get_info()
333 pr->acpi_id); in acpi_processor_get_info()
337 pr->phys_id = acpi_get_phys_id(pr->handle, device_declaration, in acpi_processor_get_info()
338 pr->acpi_id); in acpi_processor_get_info()
339 if (invalid_phys_cpuid(pr->phys_id)) in acpi_processor_get_info()
342 pr->id = acpi_map_cpuid(pr->phys_id, pr->acpi_id); in acpi_processor_get_info()
349 if (!acpi_has_cpu_in_madt() && invalid_logical_cpuid(pr->id) && in acpi_processor_get_info()
351 pr->id = 0; in acpi_processor_get_info()
357 if (acpi_has_method(pr->handle, "_PCT")) in acpi_processor_get_info()
369 if (!get_cpu_device(pr->id)) in acpi_processor_get_info()
370 ret = acpi_processor_hotadd_init(pr, device); in acpi_processor_get_info()
372 ret = acpi_processor_set_per_cpu(pr, device); in acpi_processor_get_info()
385 sprintf(acpi_device_bid(device), "CPU%X", pr->id); in acpi_processor_get_info()
386 dev_dbg(&device->dev, "Processor [%d:%d]\n", pr->id, pr->acpi_id); in acpi_processor_get_info()
394 pr->throttling.address = object.processor.pblk_address; in acpi_processor_get_info()
395 pr->throttling.duty_offset = acpi_gbl_FADT.duty_offset; in acpi_processor_get_info()
396 pr->throttling.duty_width = acpi_gbl_FADT.duty_width; in acpi_processor_get_info()
398 pr->pblk = object.processor.pblk_address; in acpi_processor_get_info()
406 status = acpi_evaluate_integer(pr->handle, "_SUN", NULL, &value); in acpi_processor_get_info()
408 arch_fix_phys_package_id(pr->id, value); in acpi_processor_get_info()
422 struct acpi_processor *pr; in acpi_processor_add() local
429 pr = kzalloc(sizeof(struct acpi_processor), GFP_KERNEL); in acpi_processor_add()
430 if (!pr) in acpi_processor_add()
433 if (!zalloc_cpumask_var(&pr->throttling.shared_cpu_map, GFP_KERNEL)) { in acpi_processor_add()
438 pr->handle = device->handle; in acpi_processor_add()
441 device->driver_data = pr; in acpi_processor_add()
447 dev = get_cpu_device(pr->id); in acpi_processor_add()
457 pr->dev = dev; in acpi_processor_add()
467 per_cpu(processors, pr->id) = NULL; in acpi_processor_add()
470 free_cpumask_var(pr->throttling.shared_cpu_map); in acpi_processor_add()
472 kfree(pr); in acpi_processor_add()
480 struct acpi_processor *pr; in acpi_processor_post_eject() local
485 pr = acpi_driver_data(device); in acpi_processor_post_eject()
486 if (pr->id >= nr_cpu_ids) in acpi_processor_post_eject()
497 device_release_driver(pr->dev); in acpi_processor_post_eject()
498 acpi_unbind_one(pr->dev); in acpi_processor_post_eject()
504 arch_unregister_cpu(pr->id); in acpi_processor_post_eject()
505 acpi_unmap_cpu(pr->id); in acpi_processor_post_eject()
508 per_cpu(processor_device_array, pr->id) = NULL; in acpi_processor_post_eject()
509 per_cpu(processors, pr->id) = NULL; in acpi_processor_post_eject()
514 try_offline_node(cpu_to_node(pr->id)); in acpi_processor_post_eject()
517 free_cpumask_var(pr->throttling.shared_cpu_map); in acpi_processor_post_eject()
518 kfree(pr); in acpi_processor_post_eject()