Lines Matching refs:cpu
120 *pkg_temp_thermal_get_phy_entry(unsigned int cpu) in pkg_temp_thermal_get_phy_entry() argument
122 u16 phys_proc_id = topology_physical_package_id(cpu); in pkg_temp_thermal_get_phy_entry()
142 static int get_tj_max(int cpu, u32 *tj_max) in get_tj_max() argument
148 err = rdmsr_safe_on_cpu(cpu, MSR_IA32_TEMPERATURE_TARGET, &eax, &edx); in get_tj_max()
319 int cpu = smp_processor_id(); in pkg_temp_thermal_threshold_work_fn() local
320 int phy_id = topology_physical_package_id(cpu); in pkg_temp_thermal_threshold_work_fn()
321 struct phy_dev_entry *phdev = pkg_temp_thermal_get_phy_entry(cpu); in pkg_temp_thermal_threshold_work_fn()
358 int cpu = smp_processor_id(); in pkg_temp_thermal_platform_thermal_notify() local
359 int phy_id = topology_physical_package_id(cpu); in pkg_temp_thermal_platform_thermal_notify()
378 schedule_delayed_work_on(cpu, in pkg_temp_thermal_platform_thermal_notify()
379 &per_cpu(pkg_temp_thermal_threshold_work, cpu), in pkg_temp_thermal_platform_thermal_notify()
384 static int find_siblings_cpu(int cpu) in find_siblings_cpu() argument
387 int id = topology_physical_package_id(cpu); in find_siblings_cpu()
390 if (i != cpu && topology_physical_package_id(i) == id) in find_siblings_cpu()
396 static int pkg_temp_thermal_device_add(unsigned int cpu) in pkg_temp_thermal_device_add() argument
411 if (topology_physical_package_id(cpu) > MAX_PKG_TEMP_ZONE_IDS) in pkg_temp_thermal_device_add()
416 err = get_tj_max(cpu, &tj_max); in pkg_temp_thermal_device_add()
429 if (topology_physical_package_id(cpu) > max_phy_id) in pkg_temp_thermal_device_add()
430 max_phy_id = topology_physical_package_id(cpu); in pkg_temp_thermal_device_add()
439 pkg_work_scheduled[topology_physical_package_id(cpu)] = 0; in pkg_temp_thermal_device_add()
442 phy_dev_entry->phys_proc_id = topology_physical_package_id(cpu); in pkg_temp_thermal_device_add()
443 phy_dev_entry->first_cpu = cpu; in pkg_temp_thermal_device_add()
456 rdmsr_on_cpu(cpu, MSR_IA32_PACKAGE_THERM_INTERRUPT, in pkg_temp_thermal_device_add()
462 phy_dev_entry->phys_proc_id, cpu); in pkg_temp_thermal_device_add()
477 static int pkg_temp_thermal_device_remove(unsigned int cpu) in pkg_temp_thermal_device_remove() argument
480 u16 phys_proc_id = topology_physical_package_id(cpu); in pkg_temp_thermal_device_remove()
482 pkg_temp_thermal_get_phy_entry(cpu); in pkg_temp_thermal_device_remove()
489 if (phdev->first_cpu == cpu) { in pkg_temp_thermal_device_remove()
490 phdev->first_cpu = find_siblings_cpu(cpu); in pkg_temp_thermal_device_remove()
502 phys_proc_id, cpu, phdev->ref_cnt); in pkg_temp_thermal_device_remove()
517 static int get_core_online(unsigned int cpu) in get_core_online() argument
519 struct cpuinfo_x86 *c = &cpu_data(cpu); in get_core_online()
520 struct phy_dev_entry *phdev = pkg_temp_thermal_get_phy_entry(cpu); in get_core_online()
527 if (pkg_temp_thermal_device_add(cpu)) in get_core_online()
533 cpu, phdev->ref_cnt); in get_core_online()
536 INIT_DELAYED_WORK(&per_cpu(pkg_temp_thermal_threshold_work, cpu), in get_core_online()
539 pr_debug("get_core_online: cpu %d successful\n", cpu); in get_core_online()
544 static void put_core_offline(unsigned int cpu) in put_core_offline() argument
546 if (!pkg_temp_thermal_device_remove(cpu)) in put_core_offline()
548 &per_cpu(pkg_temp_thermal_threshold_work, cpu)); in put_core_offline()
550 pr_debug("put_core_offline: cpu %d\n", cpu); in put_core_offline()
556 unsigned int cpu = (unsigned long) hcpu; in pkg_temp_thermal_cpu_callback() local
561 get_core_online(cpu); in pkg_temp_thermal_cpu_callback()
564 put_core_offline(cpu); in pkg_temp_thermal_cpu_callback()