Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

thermal/core: Use precomputed jiffies for the polling

The delays are also stored in jiffies based unit. Use them instead of
the ms.

Cc: Thara Gopinath <thara.gopinath@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Reviewed-by: Thara Gopinath <thara.gopinath@linaro.org>
Link: https://lore.kernel.org/r/20201216220337.839878-2-daniel.lezcano@linaro.org

+5 -10
+5 -10
drivers/thermal/thermal_core.c
··· 289 289 * - Critical trip point will cause a system shutdown. 290 290 */ 291 291 static void thermal_zone_device_set_polling(struct thermal_zone_device *tz, 292 - int delay) 292 + unsigned long delay) 293 293 { 294 - if (delay > 1000) 294 + if (delay) 295 295 mod_delayed_work(system_freezable_power_efficient_wq, 296 - &tz->poll_queue, 297 - round_jiffies(msecs_to_jiffies(delay))); 298 - else if (delay) 299 - mod_delayed_work(system_freezable_power_efficient_wq, 300 - &tz->poll_queue, 301 - msecs_to_jiffies(delay)); 296 + &tz->poll_queue, delay); 302 297 else 303 298 cancel_delayed_work(&tz->poll_queue); 304 299 } ··· 312 317 mutex_lock(&tz->lock); 313 318 314 319 if (!stop && tz->passive) 315 - thermal_zone_device_set_polling(tz, tz->passive_delay); 320 + thermal_zone_device_set_polling(tz, tz->passive_delay_jiffies); 316 321 else if (!stop && tz->polling_delay) 317 - thermal_zone_device_set_polling(tz, tz->polling_delay); 322 + thermal_zone_device_set_polling(tz, tz->polling_delay_jiffies); 318 323 else 319 324 thermal_zone_device_set_polling(tz, 0); 320 325