2020-04-21 20:13:52 +00:00
|
|
|
From 267418caf8f37f685310bb311fe5fa28e3e25dfe Mon Sep 17 00:00:00 2001
|
2019-11-25 00:04:39 +00:00
|
|
|
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
|
|
|
|
Date: Fri, 20 Sep 2019 17:50:53 -0400
|
2020-04-21 20:13:52 +00:00
|
|
|
Subject: [PATCH 282/325] revert-thermal
|
|
|
|
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.115-rt48.tar.xz
|
2019-11-25 00:04:39 +00:00
|
|
|
|
|
|
|
Revert: thermal: Defer thermal wakups to threads
|
|
|
|
|
|
|
|
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
|
|
---
|
|
|
|
drivers/thermal/x86_pkg_temp_thermal.c | 52 ++------------------------
|
|
|
|
1 file changed, 3 insertions(+), 49 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/drivers/thermal/x86_pkg_temp_thermal.c b/drivers/thermal/x86_pkg_temp_thermal.c
|
|
|
|
index a5991cbb408f..1ef937d799e4 100644
|
|
|
|
--- a/drivers/thermal/x86_pkg_temp_thermal.c
|
|
|
|
+++ b/drivers/thermal/x86_pkg_temp_thermal.c
|
|
|
|
@@ -29,7 +29,6 @@
|
|
|
|
#include <linux/pm.h>
|
|
|
|
#include <linux/thermal.h>
|
|
|
|
#include <linux/debugfs.h>
|
|
|
|
-#include <linux/swork.h>
|
|
|
|
#include <asm/cpu_device_id.h>
|
|
|
|
#include <asm/mce.h>
|
|
|
|
|
|
|
|
@@ -330,7 +329,7 @@ static void pkg_thermal_schedule_work(int cpu, struct delayed_work *work)
|
|
|
|
schedule_delayed_work_on(cpu, work, ms);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static void pkg_thermal_notify_work(struct swork_event *event)
|
|
|
|
+static int pkg_thermal_notify(u64 msr_val)
|
|
|
|
{
|
|
|
|
int cpu = smp_processor_id();
|
|
|
|
struct pkg_device *pkgdev;
|
|
|
|
@@ -349,47 +348,9 @@ static void pkg_thermal_notify_work(struct swork_event *event)
|
|
|
|
}
|
|
|
|
|
|
|
|
spin_unlock_irqrestore(&pkg_temp_lock, flags);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-#ifdef CONFIG_PREEMPT_RT_FULL
|
|
|
|
-static struct swork_event notify_work;
|
|
|
|
-
|
|
|
|
-static int pkg_thermal_notify_work_init(void)
|
|
|
|
-{
|
|
|
|
- int err;
|
|
|
|
-
|
|
|
|
- err = swork_get();
|
|
|
|
- if (err)
|
|
|
|
- return err;
|
|
|
|
-
|
|
|
|
- INIT_SWORK(¬ify_work, pkg_thermal_notify_work);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static void pkg_thermal_notify_work_cleanup(void)
|
|
|
|
-{
|
|
|
|
- swork_put();
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-static int pkg_thermal_notify(u64 msr_val)
|
|
|
|
-{
|
|
|
|
- swork_queue(¬ify_work);
|
|
|
|
- return 0;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-#else /* !CONFIG_PREEMPT_RT_FULL */
|
|
|
|
-
|
|
|
|
-static int pkg_thermal_notify_work_init(void) { return 0; }
|
|
|
|
-
|
|
|
|
-static void pkg_thermal_notify_work_cleanup(void) { }
|
|
|
|
-
|
|
|
|
-static int pkg_thermal_notify(u64 msr_val)
|
|
|
|
-{
|
|
|
|
- pkg_thermal_notify_work(NULL);
|
|
|
|
- return 0;
|
|
|
|
-}
|
|
|
|
-#endif /* CONFIG_PREEMPT_RT_FULL */
|
|
|
|
-
|
|
|
|
static int pkg_temp_thermal_device_add(unsigned int cpu)
|
|
|
|
{
|
|
|
|
int pkgid = topology_logical_package_id(cpu);
|
|
|
|
@@ -554,16 +515,11 @@ static int __init pkg_temp_thermal_init(void)
|
|
|
|
if (!x86_match_cpu(pkg_temp_thermal_ids))
|
|
|
|
return -ENODEV;
|
|
|
|
|
|
|
|
- if (!pkg_thermal_notify_work_init())
|
|
|
|
- return -ENODEV;
|
|
|
|
-
|
|
|
|
max_packages = topology_max_packages();
|
|
|
|
packages = kcalloc(max_packages, sizeof(struct pkg_device *),
|
|
|
|
GFP_KERNEL);
|
|
|
|
- if (!packages) {
|
|
|
|
- ret = -ENOMEM;
|
|
|
|
- goto err;
|
|
|
|
- }
|
|
|
|
+ if (!packages)
|
|
|
|
+ return -ENOMEM;
|
|
|
|
|
|
|
|
ret = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "thermal/x86_pkg:online",
|
|
|
|
pkg_thermal_cpu_online, pkg_thermal_cpu_offline);
|
|
|
|
@@ -581,7 +537,6 @@ static int __init pkg_temp_thermal_init(void)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
err:
|
|
|
|
- pkg_thermal_notify_work_cleanup();
|
|
|
|
kfree(packages);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
@@ -595,7 +550,6 @@ static void __exit pkg_temp_thermal_exit(void)
|
|
|
|
cpuhp_remove_state(pkg_thermal_hp_state);
|
|
|
|
debugfs_remove_recursive(debugfs);
|
|
|
|
kfree(packages);
|
|
|
|
- pkg_thermal_notify_work_cleanup();
|
|
|
|
}
|
|
|
|
module_exit(pkg_temp_thermal_exit)
|
|
|
|
|
2020-01-03 23:36:11 +00:00
|
|
|
--
|
2020-04-09 19:44:24 +00:00
|
|
|
2.25.1
|
2020-01-03 23:36:11 +00:00
|
|
|
|