Lines Matching +full:milli +full:- +full:seconds
1 // SPDX-License-Identifier: GPL-2.0-only
34 * every 5 seconds under load will give us a significant
41 "User space notification delay in milli seconds.");
94 * - cpu hotplug: Read serialized by cpu hotplug lock
97 * - Other callsites: Must hold pkg_temp_lock
113 ret = intel_tcc_get_temp(zonedev->cpu, &val, true); in sys_get_curr_temp()
127 unsigned int trip_index = THERMAL_TRIP_PRIV_TO_INT(trip->priv); in sys_set_trip_temp()
131 tj_max = intel_tcc_get_tjmax(zonedev->cpu); in sys_set_trip_temp()
136 val = (tj_max - temp)/1000; in sys_set_trip_temp()
139 return -EINVAL; in sys_set_trip_temp()
141 ret = rdmsr_on_cpu(zonedev->cpu, MSR_IA32_PACKAGE_THERM_INTERRUPT, in sys_set_trip_temp()
167 return wrmsr_on_cpu(zonedev->cpu, MSR_IA32_PACKAGE_THERM_INTERRUPT, in sys_set_trip_temp()
226 zonedev->work_scheduled = false; in pkg_temp_thermal_threshold_work_fn()
229 tzone = zonedev->tzone; in pkg_temp_thermal_threshold_work_fn()
264 if (zonedev && !zonedev->work_scheduled) { in pkg_thermal_notify()
265 zonedev->work_scheduled = true; in pkg_thermal_notify()
266 pkg_thermal_schedule_work(zonedev->cpu, &zonedev->work); in pkg_thermal_notify()
298 tj_max - thres_reg_value * 1000 : THERMAL_TEMP_INVALID; in pkg_temp_thermal_trips_init()
321 return -ENOMEM; in pkg_temp_thermal_device_add()
326 return -ENODEV; in pkg_temp_thermal_device_add()
337 return -ENOMEM; in pkg_temp_thermal_device_add()
343 INIT_DELAYED_WORK(&zonedev->work, pkg_temp_thermal_threshold_work_fn); in pkg_temp_thermal_device_add()
344 zonedev->cpu = cpu; in pkg_temp_thermal_device_add()
345 zonedev->tzone = thermal_zone_device_register_with_trips("x86_pkg_temp", in pkg_temp_thermal_device_add()
348 if (IS_ERR(zonedev->tzone)) { in pkg_temp_thermal_device_add()
349 err = PTR_ERR(zonedev->tzone); in pkg_temp_thermal_device_add()
352 err = thermal_zone_device_enable(zonedev->tzone); in pkg_temp_thermal_device_add()
357 rdmsr(MSR_IA32_PACKAGE_THERM_INTERRUPT, zonedev->msr_pkg_therm_low, in pkg_temp_thermal_device_add()
358 zonedev->msr_pkg_therm_high); in pkg_temp_thermal_device_add()
360 cpumask_set_cpu(cpu, &zonedev->cpumask); in pkg_temp_thermal_device_add()
368 thermal_zone_device_unregister(zonedev->tzone); in pkg_temp_thermal_device_add()
383 target = cpumask_any_but(&zonedev->cpumask, cpu); in pkg_thermal_cpu_offline()
384 cpumask_clear_cpu(cpu, &zonedev->cpumask); in pkg_thermal_cpu_offline()
391 struct thermal_zone_device *tzone = zonedev->tzone; in pkg_thermal_cpu_offline()
400 zonedev->tzone = NULL; in pkg_thermal_cpu_offline()
414 was_target = zonedev->cpu == cpu; in pkg_thermal_cpu_offline()
415 zonedev->cpu = target; in pkg_thermal_cpu_offline()
427 zonedev->msr_pkg_therm_low, zonedev->msr_pkg_therm_high); in pkg_thermal_cpu_offline()
434 if (zonedev->work_scheduled && was_target) { in pkg_thermal_cpu_offline()
440 cancel_delayed_work_sync(&zonedev->work); in pkg_thermal_cpu_offline()
448 if (!lastcpu && zonedev->work_scheduled) in pkg_thermal_cpu_offline()
449 pkg_thermal_schedule_work(target, &zonedev->work); in pkg_thermal_cpu_offline()
468 return -ENODEV; in pkg_thermal_cpu_online()
472 cpumask_set_cpu(cpu, &zonedev->cpumask); in pkg_thermal_cpu_online()
489 return -ENODEV; in pkg_temp_thermal_init()
495 return -ENOMEM; in pkg_temp_thermal_init()