Skip to content

Commit cad450d

Browse files
dlezcanorafaeljw
authored andcommitted
thermal/drivers/acerhdf: Make interval setting only at module load time
The thermal zone device structure is in the process of being private to the thermal framework core code. This driver is directly accessing and changing the monitoring polling rate. After discussing with the maintainers of this driver, having the polling interval at module loading time is enough for their purpose. Change the code to take into account the interval when the module is loaded but restrict the permissions so the value can not be changed afterwards. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Acked-by: Peter Kaestle <peter@piie.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 0cf321c commit cad450d

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

drivers/platform/x86/acerhdf.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ static unsigned int list_supported;
7979
static unsigned int fanstate = ACERHDF_FAN_AUTO;
8080
static char force_bios[16];
8181
static char force_product[16];
82-
static unsigned int prev_interval;
8382
static struct thermal_zone_device *thz_dev;
8483
static struct thermal_cooling_device *cl_dev;
8584
static struct platform_device *acerhdf_dev;
@@ -346,20 +345,15 @@ static void acerhdf_check_param(struct thermal_zone_device *thermal)
346345
trips[0].temperature = fanon;
347346
trips[0].hysteresis = fanon - fanoff;
348347

349-
if (kernelmode && prev_interval != interval) {
348+
if (kernelmode) {
350349
if (interval > ACERHDF_MAX_INTERVAL) {
351350
pr_err("interval too high, set to %d\n",
352351
ACERHDF_MAX_INTERVAL);
353352
interval = ACERHDF_MAX_INTERVAL;
354353
}
354+
355355
if (verbose)
356356
pr_notice("interval changed to: %d\n", interval);
357-
358-
if (thermal)
359-
thermal->polling_delay_jiffies =
360-
round_jiffies(msecs_to_jiffies(interval * 1000));
361-
362-
prev_interval = interval;
363357
}
364358
}
365359

@@ -801,5 +795,5 @@ static const struct kernel_param_ops interval_ops = {
801795
.get = param_get_uint,
802796
};
803797

804-
module_param_cb(interval, &interval_ops, &interval, 0600);
798+
module_param_cb(interval, &interval_ops, &interval, 0000);
805799
MODULE_PARM_DESC(interval, "Polling interval of temperature check");

0 commit comments

Comments
 (0)