thermal: add sched driven feature to thermal_instance
authorLukasz Luba <l.luba@partner.samsung.com>
Thu, 25 Oct 2018 16:24:46 +0000 (18:24 +0200)
committerLukasz Luba <l.luba@partner.samsung.com>
Fri, 17 May 2019 07:15:34 +0000 (09:15 +0200)
This patch adds a new flag and init function for thermal_instance
in order to provide connection with scheduler.

Signed-off-by: Lukasz Luba <l.luba@partner.samsung.com>
drivers/thermal/thermal_core.c
drivers/thermal/thermal_core.h

index 2fc143ac85526fe8f536dfb63249759d298ef6df..a3d80553b590fc4804bd17c78aabe7ed25c23e66 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/thermal.h>
 #include <linux/reboot.h>
 #include <linux/string.h>
+#include <linux/sched/power.h>
 #include <linux/of.h>
 #include <net/netlink.h>
 #include <net/genetlink.h>
@@ -837,6 +838,11 @@ update:
 }
 EXPORT_SYMBOL_GPL(thermal_cpu_cdev_set_weight);
 
+static void thermal_cpu_cdev_init_weight(int cpu, unsigned int weight)
+{
+       sched_power_cpu_reinit_weight(cpu, weight);
+}
+
 
 /**
  * thermal_zone_unbind_cooling_device() - unbind a cooling device from a
index 0df190ed82a70b342eea53ecca8407e3179df657..f6ccd8fc2ba520beeadf4d7c545db75b2f5b015f 100644 (file)
@@ -37,6 +37,7 @@ struct thermal_instance {
        struct list_head tz_node; /* node in tz->thermal_instances */
        struct list_head cdev_node; /* node in cdev->thermal_instances */
        unsigned int weight; /* The weight of the cooling device */
+       bool sched_driven;
 };
 
 #define to_thermal_zone(_dev) \