From patchwork Wed Mar 11 17:53:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kapileshwar Singh X-Patchwork-Id: 5988071 X-Patchwork-Delegate: eduardo.valentin@ti.com Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C3BE1BF90F for ; Wed, 11 Mar 2015 17:53:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 832BD20394 for ; Wed, 11 Mar 2015 17:53:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8BD0D20384 for ; Wed, 11 Mar 2015 17:53:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752363AbbCKRxr (ORCPT ); Wed, 11 Mar 2015 13:53:47 -0400 Received: from service87.mimecast.com ([91.220.42.44]:37270 "EHLO service87.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751052AbbCKRxr (ORCPT ); Wed, 11 Mar 2015 13:53:47 -0400 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by service87.mimecast.com; Wed, 11 Mar 2015 17:53:45 +0000 Received: from e105702-lin.cambridge.arm.com ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 11 Mar 2015 17:53:43 +0000 From: Kapileshwar Singh To: linux-pm@vger.kernel.org Cc: edubezval@gmail.com, rui.zhang@intel.com, Javi.Merino@arm.com, Punit.Agrawal@arm.com, kapileshwar.singh@arm.com Subject: [PATCH 1/2] thermal: cpu_cooling: Remove cpu_dev update on policy CPU update Date: Wed, 11 Mar 2015 17:53:36 +0000 Message-Id: <1426096417-27522-2-git-send-email-kapileshwar.singh@arm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1426096417-27522-1-git-send-email-kapileshwar.singh@arm.com> References: <1426096417-27522-1-git-send-email-kapileshwar.singh@arm.com> X-OriginalArrivalTime: 11 Mar 2015 17:53:43.0450 (UTC) FILETIME=[509897A0:01D05C24] X-MC-Unique: 115031117534505801 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It was initially understood that an update to the cpu_device (cached in cpufreq_cooling_device) was required to ascertain the correct operating point of the device on a cpufreq policy->cpu update or creation or deletion of a cpufreq policy. (e.g. when the existing policy CPU goes offline). This was added in: e0128d8ab423 - thermal: cpu_cooling: implement the power cooling device API This update is not required and it is possible to ascertain the OPPs from the leading CPU in a cpufreq domain even if the CPU is hotplugged out. Acked-by: Javi Merino Signed-off-by: Kapileshwar Singh --- drivers/thermal/cpu_cooling.c | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c index c4974144c787..2e15133b4793 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c @@ -199,39 +199,6 @@ unsigned long cpufreq_cooling_get_level(unsigned int cpu, unsigned int freq) } EXPORT_SYMBOL_GPL(cpufreq_cooling_get_level); -static void update_cpu_device(int cpu) -{ - struct cpufreq_cooling_device *cpufreq_dev; - - mutex_lock(&cooling_cpufreq_lock); - list_for_each_entry(cpufreq_dev, &cpufreq_dev_list, node) { - if (cpumask_test_cpu(cpu, &cpufreq_dev->allowed_cpus)) { - cpufreq_dev->cpu_dev = get_cpu_device(cpu); - if (!cpufreq_dev->cpu_dev) { - dev_warn(&cpufreq_dev->cool_dev->device, - "No cpu device for new policy cpu %d\n", - cpu); - } - break; - } - } - mutex_unlock(&cooling_cpufreq_lock); -} - -static void remove_cpu_device(int cpu) -{ - struct cpufreq_cooling_device *cpufreq_dev; - - mutex_lock(&cooling_cpufreq_lock); - list_for_each_entry(cpufreq_dev, &cpufreq_dev_list, node) { - if (cpumask_test_cpu(cpu, &cpufreq_dev->allowed_cpus)) { - cpufreq_dev->cpu_dev = NULL; - break; - } - } - mutex_unlock(&cooling_cpufreq_lock); -} - /** * cpufreq_thermal_notifier - notifier callback for cpufreq policy change. * @nb: struct notifier_block * with callback info. @@ -268,13 +235,6 @@ static int cpufreq_thermal_notifier(struct notifier_block *nb, } mutex_unlock(&cooling_cpufreq_lock); break; - - case CPUFREQ_CREATE_POLICY: - update_cpu_device(policy->cpu); - break; - case CPUFREQ_REMOVE_POLICY: - remove_cpu_device(policy->cpu); - break; default: return NOTIFY_DONE; }