From patchwork Mon Jun 8 12:55:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 49615 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 784CD21419 for ; Mon, 8 Jun 2015 12:56:42 +0000 (UTC) Received: by lbbti3 with SMTP id ti3sf33487123lbb.1 for ; Mon, 08 Jun 2015 05:56:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=/3lyp+m5xoBdokDWt7haVX5tqNsjra5+ORRyTzQUmt4=; b=mABuNlV+g4y7SpswSLAEeXrVSufBw4QM/TBAFDfB3sKGyknrB0eEsMXYVeUaP24qz7 xqvYE6wG1v1NM51RPyNfUqzbluNCuIGBLVb52QOsAimjSPq33dQnwS6DicIJX4hf5R5Z 7lQHn2ZfFdJVaI857qgFoAf9WOahDSw5ILFM0a/UyRxBeCaLlcO+zBKknUaeWcdIkLLw M7UkAeqnZMz/VBSe98xcXCOt3ry3SQP/vBKNcj/4SFHKoqVCCQlWpvjfkau0qL7O1BEX pTx//iX8YWTmTtHGMJjOAgVQ7UMS5q1lww9qIvFAvQgnuydn3Vntld+Gc51ql8X3B6tl iIAg== X-Gm-Message-State: ALoCoQkMaWV93mxLmW9D6F12IxoL0LvVhkmm82kE7tnG/tjyq8UdS1s7t+eqqRtry66PeKe7zIeV X-Received: by 10.152.3.131 with SMTP id c3mr16999306lac.4.1433768201438; Mon, 08 Jun 2015 05:56:41 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.204.103 with SMTP id kx7ls683175lac.62.gmail; Mon, 08 Jun 2015 05:56:41 -0700 (PDT) X-Received: by 10.112.42.16 with SMTP id j16mr16219830lbl.98.1433768201001; Mon, 08 Jun 2015 05:56:41 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id ln2si2664473lac.42.2015.06.08.05.56.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jun 2015 05:56:40 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by lbbqq2 with SMTP id qq2so80042414lbb.3 for ; Mon, 08 Jun 2015 05:56:40 -0700 (PDT) X-Received: by 10.112.222.133 with SMTP id qm5mr16690505lbc.86.1433768200901; Mon, 08 Jun 2015 05:56:40 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1845140lbb; Mon, 8 Jun 2015 05:56:39 -0700 (PDT) X-Received: by 10.66.142.199 with SMTP id ry7mr29455875pab.14.1433768198716; Mon, 08 Jun 2015 05:56:38 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id df1si4029496pad.84.2015.06.08.05.56.37; Mon, 08 Jun 2015 05:56:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751496AbbFHM4b (ORCPT + 11 others); Mon, 8 Jun 2015 08:56:31 -0400 Received: from mail-pd0-f175.google.com ([209.85.192.175]:35606 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753187AbbFHM4P (ORCPT ); Mon, 8 Jun 2015 08:56:15 -0400 Received: by pdbnf5 with SMTP id nf5so104432316pdb.2 for ; Mon, 08 Jun 2015 05:56:14 -0700 (PDT) X-Received: by 10.66.136.109 with SMTP id pz13mr6486090pab.47.1433768174281; Mon, 08 Jun 2015 05:56:14 -0700 (PDT) Received: from localhost ([122.167.219.251]) by mx.google.com with ESMTPSA id pn6sm2582085pdb.72.2015.06.08.05.56.12 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 08 Jun 2015 05:56:13 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, sboyd@codeaurora.org, prarit@redhat.com, skannan@codeaurora.org, Srivatsa Bhat , Viresh Kumar Subject: [PATCH V7 6/6] cpufreq: Remove cpufreq_update_policy() Date: Mon, 8 Jun 2015 18:25:32 +0530 Message-Id: X-Mailer: git-send-email 2.4.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , cpufreq_update_policy() was kept as a separate routine earlier as it was handling migration of sysfs directories, which isn't the case anymore. It is only updating policy->cpu now and is called by a single caller. The WARN_ON() isn't really required anymore, as we are just updating the cpu now, not moving the sysfs directories. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq.c | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 5f1c3366fb8e..d0497f379e3a 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1126,6 +1126,10 @@ static struct cpufreq_policy *cpufreq_policy_restore(unsigned int cpu) if (likely(policy)) { /* Policy should be inactive here */ WARN_ON(!policy_is_inactive(policy)); + + down_write(&policy->rwsem); + policy->cpu = cpu; + up_write(&policy->rwsem); } return policy; @@ -1222,16 +1226,6 @@ static void cpufreq_policy_free(struct cpufreq_policy *policy, bool notify) kfree(policy); } -static void update_policy_cpu(struct cpufreq_policy *policy, unsigned int cpu) -{ - if (WARN_ON(cpu == policy->cpu)) - return; - - down_write(&policy->rwsem); - policy->cpu = cpu; - up_write(&policy->rwsem); -} - /** * cpufreq_add_dev - add a CPU device * @@ -1290,15 +1284,6 @@ static int cpufreq_add_dev(struct device *dev, struct subsys_interface *sif) goto nomem_out; } - /* - * In the resume path, since we restore a saved policy, the assignment - * to policy->cpu is like an update of the existing policy, rather than - * the creation of a brand new one. So we need to perform this update - * by invoking update_policy_cpu(). - */ - if (recover_policy && cpu != policy->cpu) - update_policy_cpu(policy, cpu); - cpumask_copy(policy->cpus, cpumask_of(cpu)); /* call driver. From then on the cpufreq must be able