Message ID | 0c3bdb11bedca250f4d60db7a1e1983e0f3d9072.1420181916.git.viresh.kumar@linaro.org |
---|---|
State | New |
Headers | show
Return-Path: <patchwork-forward+bncBCRIZROPVQPBBSMGTGSQKGQES6L7WYA@linaro.org> X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f200.google.com (mail-we0-f200.google.com [74.125.82.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9AF0C26CD1 for <linaro@patches.linaro.org>; Fri, 2 Jan 2015 07:05:46 +0000 (UTC) Received: by mail-we0-f200.google.com with SMTP id u56sf2043207wes.11 for <linaro@patches.linaro.org>; Thu, 01 Jan 2015 23:05:45 -0800 (PST) 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=d2R2pNHxbtdA6u04CDE8B+yNbm1kF4dT7wFVldh9Nnw=; b=Bj12LraiX0ziBARDLrBrQp3GcFbViHOcDMC44kmdt4ak0iouUu7niC7dnrQ3Sf4k+K ph5CDptQCfUEnSh3KTAQt0myfhXusOuGYzPySFV35kBx6eip6sW1k6JHPA1FCph7+DHW D7ZVAAjsTsx6iwXFpHkPih3vPFiJVt25tS4sEKpM2Ww6mvacoi+wfFJIaY40OXX0rnLx XVoTEHTlP4IGiyufpoXJ3HGOt3bzDExDrPVPy5+IJ/q3RwykjdBmwU8PnWutxqDW/a2V 8TaC5gbkgRtMI7PYY51mSCKVo31uF1fvLCTcLelcw/yjS5UOh3dcX5PyMxeeWacm2fVo DiEw== X-Gm-Message-State: ALoCoQmhYIKL/xtvo8Tafv2D9hHSg0uJDZdlSbjdsjwHC2htmNRKGhmxrZHWUVCkP2uejDBhxuug X-Received: by 10.112.42.104 with SMTP id n8mr10908lbl.19.1420182345851; Thu, 01 Jan 2015 23:05:45 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.3.202 with SMTP id e10ls2187439lae.86.gmail; Thu, 01 Jan 2015 23:05:45 -0800 (PST) X-Received: by 10.152.8.225 with SMTP id u1mr74904061laa.21.1420182345642; Thu, 01 Jan 2015 23:05:45 -0800 (PST) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id zd4si50431888lbb.75.2015.01.01.23.05.45 for <patchwork-forward@linaro.org> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 01 Jan 2015 23:05:45 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by mail-lb0-f170.google.com with SMTP id 10so14908538lbg.29 for <patchwork-forward@linaro.org>; Thu, 01 Jan 2015 23:05:45 -0800 (PST) X-Received: by 10.112.104.4 with SMTP id ga4mr5019580lbb.24.1420182345553; Thu, 01 Jan 2015 23:05:45 -0800 (PST) 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.9.200 with SMTP id c8csp126208lbb; Thu, 1 Jan 2015 23:05:44 -0800 (PST) X-Received: by 10.66.146.167 with SMTP id td7mr43924426pab.101.1420182343146; Thu, 01 Jan 2015 23:05:43 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dl1si29047854pbb.67.2015.01.01.23.05.41; Thu, 01 Jan 2015 23:05:43 -0800 (PST) Received-SPF: none (google.com: linux-pm-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750762AbbABHFk (ORCPT <rfc822;amit.pundir@linaro.org> + 12 others); Fri, 2 Jan 2015 02:05:40 -0500 Received: from mail-pd0-f172.google.com ([209.85.192.172]:56294 "EHLO mail-pd0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750744AbbABHFk (ORCPT <rfc822;linux-pm@vger.kernel.org>); Fri, 2 Jan 2015 02:05:40 -0500 Received: by mail-pd0-f172.google.com with SMTP id y13so23389956pdi.3 for <linux-pm@vger.kernel.org>; Thu, 01 Jan 2015 23:05:40 -0800 (PST) X-Received: by 10.66.157.40 with SMTP id wj8mr122411321pab.105.1420182340048; Thu, 01 Jan 2015 23:05:40 -0800 (PST) Received: from localhost ([122.167.116.151]) by mx.google.com with ESMTPSA id fp13sm43692933pdb.30.2015.01.01.23.05.38 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 01 Jan 2015 23:05:39 -0800 (PST) From: Viresh Kumar <viresh.kumar@linaro.org> To: Rafael Wysocki <rjw@rjwysocki.net> Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, prarit@redhat.com, skannan@codeaurora.org, Viresh Kumar <viresh.kumar@linaro.org> Subject: [PATCH 12/17] cpufreq: use light-weight cpufreq_cpu_get_raw() in __cpufreq_add_dev Date: Fri, 2 Jan 2015 12:34:33 +0530 Message-Id: <0c3bdb11bedca250f4d60db7a1e1983e0f3d9072.1420181916.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.2.0 In-Reply-To: <cover.1420181916.git.viresh.kumar@linaro.org> References: <cover.1420181916.git.viresh.kumar@linaro.org> In-Reply-To: <cover.1420181916.git.viresh.kumar@linaro.org> References: <cover.1420181916.git.viresh.kumar@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: list List-ID: <patchwork-forward.linaro.org> 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.170 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: <http://groups.google.com/a/linaro.org/group/patchwork-forward/post>, <mailto:patchwork-forward@linaro.org> List-Help: <http://support.google.com/a/linaro.org/bin/topic.py?topic=25838>, <mailto:patchwork-forward+help@linaro.org> List-Archive: <http://groups.google.com/a/linaro.org/group/patchwork-forward/> List-Unsubscribe: <mailto:googlegroups-manage+836684582541+unsubscribe@googlegroups.com>, <http://groups.google.com/a/linaro.org/group/patchwork-forward/subscribe> |
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 3061a5823e3c..788016cded33 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1109,11 +1109,9 @@ static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif) /* check whether a different CPU already registered this * CPU because it is in the same boat. */ - policy = cpufreq_cpu_get(cpu); - if (unlikely(policy)) { - cpufreq_cpu_put(policy); + policy = cpufreq_cpu_get_raw(cpu); + if (unlikely(policy)) return 0; - } if (!down_read_trylock(&cpufreq_rwsem)) return 0;
We just need to check if a 'policy' is already present for the cpu we are adding. We don't need to take all the locks and do kobject usage updates. Use the light-weight cpufreq_cpu_get_raw() routine instead. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> --- drivers/cpufreq/cpufreq.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)