From 6d5b0905a70b46469af844768c33686b94892af1 Mon Sep 17 00:00:00 2001 From: Xin Date: Wed, 9 Oct 2019 11:13:29 +0800 Subject: [PATCH 1/2] Update x86_pkg_temp_thermal.c --- drivers/thermal/x86_pkg_temp_thermal.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/thermal/x86_pkg_temp_thermal.c b/drivers/thermal/x86_pkg_temp_thermal.c index 1ef937d799e4..4d0db66b07c3 100644 --- a/drivers/thermal/x86_pkg_temp_thermal.c +++ b/drivers/thermal/x86_pkg_temp_thermal.c @@ -242,12 +242,25 @@ static int sys_get_trip_type(struct thermal_zone_device *thermal, int trip, return 0; } +static int sys_set_emul_temp(struct thermal_zone_device *tz, int temp) +{ + if(temp > 110000 || temp < -40000){ + printk(KERN_DEBUG "invalid emul_temperature %d\n", temp); + }else{ + tz->emul_temperature = temp; + printk(KERN_DEBUG "emul_temperature %d\n", temp); + } + + return 0; +} + /* Thermal zone callback registry */ static struct thermal_zone_device_ops tzone_ops = { .get_temp = sys_get_curr_temp, .get_trip_temp = sys_get_trip_temp, .get_trip_type = sys_get_trip_type, .set_trip_temp = sys_set_trip_temp, + .set_emul_temp = sys_set_emul_temp, }; static bool pkg_thermal_rate_control(void) From 5d2b1ef0d9caa15d5a9861d223788db67e869b05 Mon Sep 17 00:00:00 2001 From: Xin Date: Wed, 9 Oct 2019 13:50:08 +0800 Subject: [PATCH 2/2] Update x86_pkg_temp_thermal.c --- drivers/thermal/x86_pkg_temp_thermal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/x86_pkg_temp_thermal.c b/drivers/thermal/x86_pkg_temp_thermal.c index 4d0db66b07c3..f890793fe897 100644 --- a/drivers/thermal/x86_pkg_temp_thermal.c +++ b/drivers/thermal/x86_pkg_temp_thermal.c @@ -245,10 +245,10 @@ static int sys_get_trip_type(struct thermal_zone_device *thermal, int trip, static int sys_set_emul_temp(struct thermal_zone_device *tz, int temp) { if(temp > 110000 || temp < -40000){ - printk(KERN_DEBUG "invalid emul_temperature %d\n", temp); + printk(KERN_ERROR "invalid emul_temperature %d\n", temp); }else{ tz->emul_temperature = temp; - printk(KERN_DEBUG "emul_temperature %d\n", temp); + printk(KERN_ERROR "emul_temperature %d\n", temp); } return 0;