From patchwork Sun Sep 22 01:21:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20516 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f198.google.com (mail-ve0-f198.google.com [209.85.128.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4D11425E85 for ; Sun, 22 Sep 2013 01:22:55 +0000 (UTC) Received: by mail-ve0-f198.google.com with SMTP id c14sf1935276vea.5 for ; Sat, 21 Sep 2013 18:22:55 -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 :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=X8Egpqld2DwuKuccBK6KrZSJURqylDWwi7PmL2WYe2Q=; b=kuQ5WSt8htdjJNEb8CLnoMASd+j6uvav1BU50w2mXrl9n11raKSCnWvMyhireckeRa /BE/dRc/3BElBTdSvptqwbRpV7RnzQc1YanJXASHS1YhH+y7emHjd2RpHc0tESwbf9wZ qeut7JcS/6s3aQ2+H//Lrn2uiYPfQFHFmOwq4yYoU0iNbqhlk8zirJtgUyILluuvk2by vb2uaiU85sA1S+ZjhVla3LUGOjo9IrgbFqTe/+SFLk5d5z2vNG0XKlH+gDY5xpPTkO/8 kL1ThsUqk7cpDp/2VUuO908CVkobYgozQCuBa66vX2rPZocFF5qhE1Bd46s4q/pPeQt2 C48g== X-Gm-Message-State: ALoCoQmGnWNG8At5tcNOzGwN+FNhahr2oheW1n+gcGHn1gFxf6JNZa/9h8ngKtVUW2BTqJDivphW X-Received: by 10.236.54.68 with SMTP id h44mr5119460yhc.21.1379812975125; Sat, 21 Sep 2013 18:22:55 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.29.167 with SMTP id l7ls775031qeh.47.gmail; Sat, 21 Sep 2013 18:22:55 -0700 (PDT) X-Received: by 10.58.137.167 with SMTP id qj7mr14006372veb.1.1379812975037; Sat, 21 Sep 2013 18:22:55 -0700 (PDT) Received: from mail-vb0-f42.google.com (mail-vb0-f42.google.com [209.85.212.42]) by mx.google.com with ESMTPS id zw10si4521911vdb.122.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 21 Sep 2013 18:22:55 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.42 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.42; Received: by mail-vb0-f42.google.com with SMTP id e12so1365337vbg.15 for ; Sat, 21 Sep 2013 18:22:55 -0700 (PDT) X-Received: by 10.52.161.231 with SMTP id xv7mr12032235vdb.1.1379812974951; Sat, 21 Sep 2013 18:22:54 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp91748vcz; Sat, 21 Sep 2013 18:22:54 -0700 (PDT) X-Received: by 10.66.161.138 with SMTP id xs10mr17187243pab.56.1379812974134; Sat, 21 Sep 2013 18:22:54 -0700 (PDT) Received: from mail-pd0-f176.google.com (mail-pd0-f176.google.com [209.85.192.176]) by mx.google.com with ESMTPS id is7si15840760pbc.149.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 21 Sep 2013 18:22:54 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.176 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.176; Received: by mail-pd0-f176.google.com with SMTP id q10so1821989pdj.7 for ; Sat, 21 Sep 2013 18:22:53 -0700 (PDT) X-Received: by 10.66.66.133 with SMTP id f5mr268949pat.123.1379812973697; Sat, 21 Sep 2013 18:22:53 -0700 (PDT) Received: from localhost ([122.167.152.64]) by mx.google.com with ESMTPSA id sn4sm20089220pbc.37.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 21 Sep 2013 18:22:53 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl, daniel.lezcano@linaro.org Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Viresh Kumar Subject: [PATCH 14/21] cpuidle: coupled: don't compare cpu masks unnecessarily Date: Sun, 22 Sep 2013 06:51:06 +0530 Message-Id: <564c8b1f073dc396b54866a2220b09b7869289f4.1379779777.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.42 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , In cpuidle_coupled_register_device() we do following: if (WARN_ON(!cpumask_equal(&dev->coupled_cpus, &coupled->coupled_cpus))) coupled->prevent++; This is only required to be done when we are using 'coupled' from an existing cpuidle_device and not when we have just done this: coupled->coupled_cpus = dev->coupled_cpus So, move this compare statement to the right place. Signed-off-by: Viresh Kumar --- drivers/cpuidle/coupled.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/cpuidle/coupled.c b/drivers/cpuidle/coupled.c index e952936..19a89eb 100644 --- a/drivers/cpuidle/coupled.c +++ b/drivers/cpuidle/coupled.c @@ -642,6 +642,10 @@ int cpuidle_coupled_register_device(struct cpuidle_device *dev) other_dev = per_cpu(cpuidle_devices, cpu); if (other_dev && other_dev->coupled) { coupled = other_dev->coupled; + + if (WARN_ON(!cpumask_equal(&dev->coupled_cpus, + &coupled->coupled_cpus))) + coupled->prevent++; goto have_coupled; } } @@ -655,9 +659,6 @@ int cpuidle_coupled_register_device(struct cpuidle_device *dev) have_coupled: dev->coupled = coupled; - if (WARN_ON(!cpumask_equal(&dev->coupled_cpus, &coupled->coupled_cpus))) - coupled->prevent++; - cpuidle_coupled_update_online_cpus(coupled); coupled->refcnt++;