From patchwork Mon Mar 16 12:00:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kapileshwar Singh X-Patchwork-Id: 6017311 X-Patchwork-Delegate: rui.zhang@intel.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 73478BF90F for ; Mon, 16 Mar 2015 12:01:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 93C7D204A7 for ; Mon, 16 Mar 2015 12:01:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A79C720495 for ; Mon, 16 Mar 2015 12:01:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751875AbbCPMBL (ORCPT ); Mon, 16 Mar 2015 08:01:11 -0400 Received: from foss.arm.com ([217.140.101.70]:56221 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751475AbbCPMBL (ORCPT ); Mon, 16 Mar 2015 08:01:11 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 361A25F7; Mon, 16 Mar 2015 05:01:23 -0700 (PDT) Received: from e105702-lin.cambridge.arm.com (e105702-lin.cambridge.arm.com [10.2.131.212]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id D15673F25E; Mon, 16 Mar 2015 05:01:09 -0700 (PDT) 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 v2 1/2] thermal: cpu_cooling: Remove cpu_dev update on policy CPU update Date: Mon, 16 Mar 2015 12:00:50 +0000 Message-Id: <1426507251-26613-2-git-send-email-kapileshwar.singh@arm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1426507251-26613-1-git-send-email-kapileshwar.singh@arm.com> References: <1426507251-26613-1-git-send-email-kapileshwar.singh@arm.com> 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 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. Fixes: e0128d8ab423 ("thermal: cpu_cooling: implement the power cooling device API") 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; }