From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1175CC3A5A2 for ; Fri, 20 Sep 2019 21:56:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DD1EB218AE for ; Fri, 20 Sep 2019 21:56:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388199AbfITV4j (ORCPT ); Fri, 20 Sep 2019 17:56:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:47018 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730461AbfITV4Y (ORCPT ); Fri, 20 Sep 2019 17:56:24 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A558E20C01; Fri, 20 Sep 2019 21:56:22 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.92) (envelope-from ) id 1iBQt3-0005IN-SB; Fri, 20 Sep 2019 17:56:21 -0400 Message-Id: <20190920215621.753333463@goodmis.org> User-Agent: quilt/0.65 Date: Fri, 20 Sep 2019 17:53:14 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org, linux-rt-users Cc: Thomas Gleixner , Carsten Emde , Sebastian Andrzej Siewior , John Kacur , Paul Gortmaker , Julia Cartwright , Daniel Wagner , tom.zanussi@linux.intel.com Subject: [RFC][PATCH RT 3/7] revert-thermal References: <20190920215311.165260719@goodmis.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Steven Rostedt (VMware)" Revert: thermal: Defer thermal wakups to threads Signed-off-by: Steven Rostedt (VMware) --- 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 #include #include -#include #include #include @@ -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) -- 2.20.1