From patchwork Mon Jun 8 09:30:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 11592849 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 141CD1392 for ; Mon, 8 Jun 2020 09:30:55 +0000 (UTC) Received: from web01.groups.io (web01.groups.io [66.175.222.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E279C2072F for ; Mon, 8 Jun 2020 09:30:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=lists.cip-project.org header.i=@lists.cip-project.org header.b="NV0ZBSx0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E279C2072F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csie.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=bounce+64572+4739+4520428+8129116@lists.cip-project.org X-Received: by 127.0.0.2 with SMTP id HZW0YY4521763xfnVUfAxlWC; Mon, 08 Jun 2020 02:30:54 -0700 X-Received: from wens.tw (wens.tw [140.112.30.76]) by mx.groups.io with SMTP id smtpd.web10.26292.1591608653817530537 for ; Mon, 08 Jun 2020 02:30:54 -0700 X-Received: by wens.tw (Postfix, from userid 1000) id 44C8A60092; Mon, 8 Jun 2020 17:30:50 +0800 (CST) From: "Chen-Yu Tsai (Moxa)" To: nobuhiro1.iwamatsu@toshiba.co.jp, pavel@denx.de Cc: cip-dev@lists.cip-project.org, JohnsonCH.Chen@moxa.com Subject: [cip-dev] [PATCH 4.4.y-cip v2 10/15] PM / OPP: Set cpu_dev->id in cpumask first Date: Mon, 8 Jun 2020 17:30:23 +0800 Message-Id: <20200608093028.21612-11-wens@csie.org> In-Reply-To: <20200608093028.21612-1-wens@csie.org> References: <20200608093028.21612-1-wens@csie.org> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: cip-dev@lists.cip-project.org List-Id: Mailing-List: list cip-dev@lists.cip-project.org; contact cip-dev+owner@lists.cip-project.org Delivered-To: mailing list cip-dev@lists.cip-project.org Reply-To: cip-dev@lists.cip-project.org X-Gm-Message-State: 0Tr98Cf2Rin2O6KLHFnLofRex4520428AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.cip-project.org; q=dns/txt; s=20140610; t=1591608654; bh=m5us2N1ukrZ4A9FkqwJEK3AxtRbutk5l0ZeTaa7oDqI=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=NV0ZBSx0JA0p1nOCrlGB/K25k6axkN+XOuN8CDHQFuU7SmDN5+eQlq8xLaej0PNvPiK 8Y75fi/DCPQAQm7XXhxI3qh0mf8N4CRAj0tdZp0QyVtkma9kaBvBAmH6QgOASY69zCwAF UIeSM2RAsgB1dTqZZKM/g8fr5q7bfgGSvbY= From: Pi-Cheng Chen commit d9de19b1cc013433ad293365b5b3902ec73dfd60 upstream. 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 Signed-off-by: Rafael J. Wysocki Signed-off-by: Chen-Yu Tsai (Moxa) --- 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 1a2e8f260b060..a0db8b3575f38 100644 --- a/drivers/base/power/opp/cpu.c +++ b/drivers/base/power/opp/cpu.c @@ -218,7 +218,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) @@ -234,6 +233,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;