Lines Matching full:pr
171 static int acpi_processor_hotadd_init(struct acpi_processor *pr) in acpi_processor_hotadd_init() argument
177 if (invalid_phys_cpuid(pr->phys_id)) in acpi_processor_hotadd_init()
180 status = acpi_evaluate_integer(pr->handle, "_STA", NULL, &sta); in acpi_processor_hotadd_init()
187 ret = acpi_map_cpu(pr->handle, pr->phys_id, pr->acpi_id, &pr->id); in acpi_processor_hotadd_init()
191 ret = arch_register_cpu(pr->id); in acpi_processor_hotadd_init()
193 acpi_unmap_cpu(pr->id); in acpi_processor_hotadd_init()
202 pr_info("CPU%d has been hot-added\n", pr->id); in acpi_processor_hotadd_init()
203 pr->flags.need_hotplug_init = 1; in acpi_processor_hotadd_init()
211 static inline int acpi_processor_hotadd_init(struct acpi_processor *pr) in acpi_processor_hotadd_init() argument
221 struct acpi_processor *pr = acpi_driver_data(device); in acpi_processor_get_info() local
234 pr->flags.bm_control = 1; in acpi_processor_get_info()
241 status = acpi_evaluate_object(pr->handle, NULL, NULL, &buffer); in acpi_processor_get_info()
249 pr->acpi_id = object.processor.proc_id; in acpi_processor_get_info()
254 status = acpi_evaluate_integer(pr->handle, METHOD_NAME__UID, in acpi_processor_get_info()
263 pr->acpi_id = value; in acpi_processor_get_info()
266 if (acpi_duplicate_processor_id(pr->acpi_id)) { in acpi_processor_get_info()
267 if (pr->acpi_id == 0xff) in acpi_processor_get_info()
273 pr->acpi_id); in acpi_processor_get_info()
277 pr->phys_id = acpi_get_phys_id(pr->handle, device_declaration, in acpi_processor_get_info()
278 pr->acpi_id); in acpi_processor_get_info()
279 if (invalid_phys_cpuid(pr->phys_id)) in acpi_processor_get_info()
282 pr->id = acpi_map_cpuid(pr->phys_id, pr->acpi_id); in acpi_processor_get_info()
289 if (invalid_logical_cpuid(pr->id) && (num_online_cpus() == 1)) in acpi_processor_get_info()
290 pr->id = 0; in acpi_processor_get_info()
301 if (invalid_logical_cpuid(pr->id) || !cpu_present(pr->id)) { in acpi_processor_get_info()
302 int ret = acpi_processor_hotadd_init(pr); in acpi_processor_get_info()
317 sprintf(acpi_device_bid(device), "CPU%X", pr->id); in acpi_processor_get_info()
318 dev_dbg(&device->dev, "Processor [%d:%d]\n", pr->id, pr->acpi_id); in acpi_processor_get_info()
326 pr->throttling.address = object.processor.pblk_address; in acpi_processor_get_info()
327 pr->throttling.duty_offset = acpi_gbl_FADT.duty_offset; in acpi_processor_get_info()
328 pr->throttling.duty_width = acpi_gbl_FADT.duty_width; in acpi_processor_get_info()
330 pr->pblk = object.processor.pblk_address; in acpi_processor_get_info()
338 status = acpi_evaluate_integer(pr->handle, "_SUN", NULL, &value); in acpi_processor_get_info()
340 arch_fix_phys_package_id(pr->id, value); in acpi_processor_get_info()
356 struct acpi_processor *pr; in acpi_processor_add() local
360 pr = kzalloc(sizeof(struct acpi_processor), GFP_KERNEL); in acpi_processor_add()
361 if (!pr) in acpi_processor_add()
364 if (!zalloc_cpumask_var(&pr->throttling.shared_cpu_map, GFP_KERNEL)) { in acpi_processor_add()
369 pr->handle = device->handle; in acpi_processor_add()
372 device->driver_data = pr; in acpi_processor_add()
378 BUG_ON(pr->id >= nr_cpu_ids); in acpi_processor_add()
385 if (per_cpu(processor_device_array, pr->id) != NULL && in acpi_processor_add()
386 per_cpu(processor_device_array, pr->id) != device) { in acpi_processor_add()
389 pr->id); in acpi_processor_add()
397 per_cpu(processor_device_array, pr->id) = device; in acpi_processor_add()
398 per_cpu(processors, pr->id) = pr; in acpi_processor_add()
400 dev = get_cpu_device(pr->id); in acpi_processor_add()
410 pr->dev = dev; in acpi_processor_add()
420 free_cpumask_var(pr->throttling.shared_cpu_map); in acpi_processor_add()
422 per_cpu(processors, pr->id) = NULL; in acpi_processor_add()
424 kfree(pr); in acpi_processor_add()
432 struct acpi_processor *pr; in acpi_processor_remove() local
437 pr = acpi_driver_data(device); in acpi_processor_remove()
438 if (pr->id >= nr_cpu_ids) in acpi_processor_remove()
449 device_release_driver(pr->dev); in acpi_processor_remove()
450 acpi_unbind_one(pr->dev); in acpi_processor_remove()
453 per_cpu(processor_device_array, pr->id) = NULL; in acpi_processor_remove()
454 per_cpu(processors, pr->id) = NULL; in acpi_processor_remove()
460 arch_unregister_cpu(pr->id); in acpi_processor_remove()
461 acpi_unmap_cpu(pr->id); in acpi_processor_remove()
466 try_offline_node(cpu_to_node(pr->id)); in acpi_processor_remove()
469 free_cpumask_var(pr->throttling.shared_cpu_map); in acpi_processor_remove()
470 kfree(pr); in acpi_processor_remove()