From patchwork Mon Dec 28 13:06:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "pi-cheng.chen" X-Patchwork-Id: 7926021 Return-Path: X-Original-To: patchwork-linux-mediatek@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 D522FBEEE5 for ; Mon, 28 Dec 2015 13:06:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 09CB420160 for ; Mon, 28 Dec 2015 13:06:51 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 022172017E for ; Mon, 28 Dec 2015 13:06:50 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aDXVh-0002tk-Mn; Mon, 28 Dec 2015 13:06:49 +0000 Received: from mail-pa0-x229.google.com ([2607:f8b0:400e:c03::229]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aDXVf-0002rb-G2 for linux-mediatek@lists.infradead.org; Mon, 28 Dec 2015 13:06:48 +0000 Received: by mail-pa0-x229.google.com with SMTP id cy9so110091098pac.0 for ; Mon, 28 Dec 2015 05:06:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KBBJk7Xeo1Vc9Ye79bSU6KaphmhyBVYbykbnnPDlMdY=; b=Jdm7BqlWYtyjkiNfRk1p07X51dDUf8Mv4VL9Ojzp2g2BK5kAk4HUsirjD1W9XN8Sq9 CyaSKgpWAsokDiYkBRn+WP9ZBFptzu8h2a6BJKq/yWuv/21B/IGElHDSbkp6DqJ5OOST 1HRXGeTQPmmdyAh5mMA8cVY7/MwWAvtp6OHZc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=KBBJk7Xeo1Vc9Ye79bSU6KaphmhyBVYbykbnnPDlMdY=; b=YFxCAq2hjRmmWdpvRBbk0mMWt5RV3ts0RpGx3ujFrR5KCxqNqETiXFkx893tqIYdtD U3uzYrdzSg3YSz4rJn5FgpeA3rxXLnDhaLoBozAKVBbcPuLQawcp80oopw06BARcydZ8 BegzPCMykecG/4Y9mJp53GBO0XBSdMVIO8Yi1uHvL2AenulCM/VatxzoQBitFTftRD89 VhH0+ZW7RoV1+rNwcQmroX9Ci6E9Wj00QI07nW1ii8OKPm/ESCaUM/em5avs70w054V0 ZSQC99Z2CRaxNhT/bdijrTqwUqoCXR/RxNafX3ROsDJdjPMUO7Tn9qeijWlrpcki0T0p TJLg== X-Gm-Message-State: ALoCoQk0CCX6s1jVzlSZ2bQqeFJWar+WJdE8/yfK/XCg6c9QnGZ0h5P/DCy+BOeSEonJzN4zmzCrH3MFeaTzC+p1zcdwhcjx9w== X-Received: by 10.66.180.48 with SMTP id dl16mr77458718pac.39.1451307986223; Mon, 28 Dec 2015 05:06:26 -0800 (PST) Received: from localhost.localdomain ([124.219.30.17]) by smtp.googlemail.com with ESMTPSA id yl1sm81475955pac.35.2015.12.28.05.06.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 Dec 2015 05:06:25 -0800 (PST) From: Pi-Cheng Chen To: Viresh Kumar Subject: [PATCH v2] PM/OPP: Set cpu_dev->id in cpumask first Date: Mon, 28 Dec 2015 21:06:17 +0800 Message-Id: <1451307977-7427-1-git-send-email-pi-cheng.chen@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <20151228031123.GB3598@ubuntu> References: <20151228031123.GB3598@ubuntu> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151228_050647_602281_9EC2B324 X-CRM114-Status: GOOD ( 10.73 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, Michael Turquette , linux-mediatek@lists.infradead.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 Set cpu_dev->id in cpumask first when setting up cpumask for CPUs that share the same OPP table. This might be helpful when handling cpumask without the original CPU bitfield set. Signed-off-by: Pi-Cheng Chen Acked-by: Viresh Kumar --- v1->v2: - Set cpu_dev->id in cpumask at the top instead of skip it in the loop --- drivers/base/power/opp/cpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/base/power/opp/cpu.c b/drivers/base/power/opp/cpu.c index 7b445e8..9f0c155 100644 --- a/drivers/base/power/opp/cpu.c +++ b/drivers/base/power/opp/cpu.c @@ -214,7 +214,6 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_of_cpumask_add_table); /* * Works only for OPP v2 bindings. * - * cpumask should be already set to mask of cpu_dev->id. * Returns -ENOENT if operating-points-v2 bindings aren't supported. */ int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, cpumask_var_t cpumask) @@ -230,6 +229,8 @@ int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, cpumask_var_t cpumask return -ENOENT; } + cpumask_set_cpu(cpu_dev->id, cpumask); + /* OPPs are shared ? */ if (!of_property_read_bool(np, "opp-shared")) goto put_cpu_node;