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

thermal/core: Remove ms based delay fields

The code does no longer use the ms unit based fields to set the
delays as they are replaced by the jiffies.

Remove them and replace their user to use the jiffies version instead.

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: Peter Kästle <peter@piie.net>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20201216220337.839878-3-daniel.lezcano@linaro.org

+10 -16
+2 -1
drivers/platform/x86/acerhdf.c
··· 336 336 pr_notice("interval changed to: %d\n", interval); 337 337 338 338 if (thermal) 339 - thermal->polling_delay = interval*1000; 339 + thermal->polling_delay_jiffies = 340 + round_jiffies(msecs_to_jiffies(interval * 1000)); 340 341 341 342 prev_interval = interval; 342 343 }
+2 -2
drivers/thermal/da9062-thermal.c
··· 95 95 thermal_zone_device_update(thermal->zone, 96 96 THERMAL_EVENT_UNSPECIFIED); 97 97 98 - delay = msecs_to_jiffies(thermal->zone->passive_delay); 98 + delay = thermal->zone->passive_delay_jiffies; 99 99 queue_delayed_work(system_freezable_wq, &thermal->work, delay); 100 100 return; 101 101 } ··· 245 245 246 246 dev_dbg(&pdev->dev, 247 247 "TJUNC temperature polling period set at %d ms\n", 248 - thermal->zone->passive_delay); 248 + jiffies_to_msecs(thermal->zone->passive_delay_jiffies)); 249 249 250 250 ret = platform_get_irq_byname(pdev, "THERMAL"); 251 251 if (ret < 0) {
+1 -1
drivers/thermal/gov_power_allocator.c
··· 258 258 * power being applied, slowing down the controller) 259 259 */ 260 260 d = mul_frac(tz->tzp->k_d, err - params->prev_err); 261 - d = div_frac(d, tz->passive_delay); 261 + d = div_frac(d, jiffies_to_msecs(tz->passive_delay_jiffies)); 262 262 params->prev_err = err; 263 263 264 264 power_range = p + i + d;
+1 -3
drivers/thermal/thermal_core.c
··· 313 313 314 314 if (!stop && tz->passive) 315 315 thermal_zone_device_set_polling(tz, tz->passive_delay_jiffies); 316 - else if (!stop && tz->polling_delay) 316 + else if (!stop && tz->polling_delay_jiffies) 317 317 thermal_zone_device_set_polling(tz, tz->polling_delay_jiffies); 318 318 else 319 319 thermal_zone_device_set_polling(tz, 0); ··· 1307 1307 tz->device.class = &thermal_class; 1308 1308 tz->devdata = devdata; 1309 1309 tz->trips = trips; 1310 - tz->passive_delay = passive_delay; 1311 - tz->polling_delay = polling_delay; 1312 1310 1313 1311 thermal_set_delay_jiffies(&tz->passive_delay_jiffies, passive_delay); 1314 1312 thermal_set_delay_jiffies(&tz->polling_delay_jiffies, polling_delay);
+4 -2
drivers/thermal/ti-soc-thermal/ti-thermal-common.c
··· 166 166 char *domain) 167 167 { 168 168 struct ti_thermal_data *data; 169 + int interval; 169 170 170 171 data = ti_bandgap_get_sensor_data(bgp, id); 171 172 ··· 184 183 return PTR_ERR(data->ti_thermal); 185 184 } 186 185 186 + interval = jiffies_to_msecs(data->ti_thermal->polling_delay_jiffies); 187 + 187 188 ti_bandgap_set_sensor_data(bgp, id, data); 188 - ti_bandgap_write_update_interval(bgp, data->sensor_id, 189 - data->ti_thermal->polling_delay); 189 + ti_bandgap_write_update_interval(bgp, data->sensor_id, interval); 190 190 191 191 return 0; 192 192 }
-7
include/linux/thermal.h
··· 115 115 * @devdata: private pointer for device private data 116 116 * @trips: number of trip points the thermal zone supports 117 117 * @trips_disabled; bitmap for disabled trips 118 - * @passive_delay: number of milliseconds to wait between polls when 119 - * performing passive cooling. 120 118 * @passive_delay_jiffies: number of jiffies to wait between polls when 121 119 * performing passive cooling. 122 - * @polling_delay: number of milliseconds to wait between polls when 123 - * checking whether trip points have been crossed (0 for 124 - * interrupt driven systems) 125 120 * @polling_delay_jiffies: number of jiffies to wait between polls when 126 121 * checking whether trip points have been crossed (0 for 127 122 * interrupt driven systems) ··· 157 162 unsigned long trips_disabled; /* bitmap for disabled trips */ 158 163 unsigned long passive_delay_jiffies; 159 164 unsigned long polling_delay_jiffies; 160 - int passive_delay; 161 - int polling_delay; 162 165 int temperature; 163 166 int last_temperature; 164 167 int emul_temperature;