From patchwork Wed May 30 09:44:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 10438043 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 50A0B602BD for ; Wed, 30 May 2018 09:44:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D9B12888B for ; Wed, 30 May 2018 09:44:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3239D288E8; Wed, 30 May 2018 09:44:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D4DC2888B for ; Wed, 30 May 2018 09:44:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968964AbeE3Joo (ORCPT ); Wed, 30 May 2018 05:44:44 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:44454 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965381AbeE3Jol (ORCPT ); Wed, 30 May 2018 05:44:41 -0400 Received: by mail-pl0-f65.google.com with SMTP id z9-v6so7416045plk.11 for ; Wed, 30 May 2018 02:44:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=mBgODsxc2JmOzjBn7aZ9SBPw0tY3/8RWJRlFiuYR63o=; b=AbcPwarT/GUuJiLf08Bu7TH9tKrADLaNtTSpl58+EfrQTMF8JzMs55Wb2gVC9fBGOZ /jB1mPG5aLHxrV5eGD/GBtHnnJI4PVWC7lasAkI4mLyAFHIXBlb8ct0AoiTGHiCRE9k8 ve+V99eLFQXCUYjR2nAYPPTmQbcuoL0UvtrLM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=mBgODsxc2JmOzjBn7aZ9SBPw0tY3/8RWJRlFiuYR63o=; b=GajwVJidYDqFS6rG7bn/F6qI8orfTdVOchMXD7gGcUAfgu1m5ID2IrfR+Ma9dWITdS GtPshDfdrhtJodBSdmrPfhQI72r3GxQyH8/CEwBIphTcluwDZWnayhsUZ5OAMyhRKG61 eyQpFtXTl0pEM3K6bTuSxwVQH7/PVT0GYfhvPOrVj2imrpbuQBGc43FWyKqV02bpSyf9 Z19uogebiBOLOFQwSAo7Ozr7EonbYKGt6Xms4WpHU33xe1mToMu5m2+h3J2jIJq7ui+3 L+mFV9FPcwDLwfo+mHZjbzqetBYXiwYrFwKUY2qbxc9f6KrO3pEHcPqUfAfq+3FNpcYg FZKw== X-Gm-Message-State: ALKqPwdP2tH+mLbjeWaUPnVRpaufje7rScxsc19v+svTjCKMGHCGzs/R llJt7b13PMQNTK+2TZ7iSqloMdvqGKs= X-Google-Smtp-Source: ADUXVKLE3k7AZ9PJhYl7U6SIV5t+40jIB6TfBTn6lbZDBEO8MiD1PLDnegMB6Nv734x+Twp7U9jdPA== X-Received: by 2002:a17:902:8c92:: with SMTP id t18-v6mr2156607plo.337.1527673481216; Wed, 30 May 2018 02:44:41 -0700 (PDT) Received: from localhost ([122.172.63.23]) by smtp.gmail.com with ESMTPSA id g20-v6sm56142034pfi.163.2018.05.30.02.44.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 May 2018 02:44:40 -0700 (PDT) Date: Wed, 30 May 2018 15:14:38 +0530 From: Viresh Kumar To: Rajendra Nayak Cc: David Collins , sboyd@kernel.org, andy.gross@linaro.org, ulf.hansson@linaro.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Lina Iyer Subject: Re: [PATCH v2 5/6] soc: qcom: rpmh powerdomain driver Message-ID: <20180530094438.xnyukvhum7tc6roh@vireshk-i7> References: <20180525100121.28214-1-rnayak@codeaurora.org> <20180525100121.28214-6-rnayak@codeaurora.org> <215deee5-6472-d587-9a90-f7158162ed82@codeaurora.org> <6f8e5fe2-199d-ba1f-19d7-2faf276075f3@codeaurora.org> <36822404-bdf5-1915-03e7-e5ffcff05c9b@codeaurora.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <36822404-bdf5-1915-03e7-e5ffcff05c9b@codeaurora.org> User-Agent: NeoMutt/20180323-120-3dd1ac Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 30-05-18, 14:25, Rajendra Nayak wrote: > []... > > >>> +Required Properties: > >>> + - compatible: Should be one of the following > >>> + * qcom,sdm845-rpmhpd: RPMh powerdomain for the sdm845 family of SoC > >>> + - power-domain-cells: number of cells in power domain specifier > >>> + must be 1 > >>> + - operating-points-v2: Phandle to the OPP table for the power-domain. > >>> + Refer to Documentation/devicetree/bindings/power/power_domain.txt > >>> + and Documentation/devicetree/bindings/opp/qcom-opp.txt for more details > >>> + > >>> +Example: > >>> + > >>> + rpmhpd: power-controller { > >>> + compatible = "qcom,sdm845-rpmhpd"; > >>> + #power-domain-cells = <1>; > >>> + operating-points-v2 = <&rpmhpd_opp_table>, > >>> + <&rpmhpd_opp_table>, > >>> + <&rpmhpd_opp_table>, > >>> + <&rpmhpd_opp_table>, > >>> + <&rpmhpd_opp_table>, > >>> + <&rpmhpd_opp_table>, > >>> + <&rpmhpd_opp_table>, > >>> + <&rpmhpd_opp_table>, > >>> + <&rpmhpd_opp_table>; > >> > >> Can this be changed to simply: > >> operating-points-v2 = <&rpmhpd_opp_table>; > >> > >> The opp binding documentation [1] states that this should be ok: > >> > >> If only one phandle is available, then the same OPP table will be used > >> for all power domains provided by the power domain provider. > > > > thanks, I mentioned this to Viresh but didn't realize he fixed it up. > > Will remove the redundant entries. > > Looks like the kernel implementation does not handle this yet, and I get > an error adding the OPP tables for the powerdomains if I just specify > a single OPP table phandle. > > Viresh, is this expected with the latest patches in linux-next? > > It would be good if I can specify just one phandle instead of coping > the same phandle n times. Please try this untested hunk: --- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/opp/of.c b/drivers/opp/of.c index 6d15f05bfc28..7af0ddec936b 100644 --- a/drivers/opp/of.c +++ b/drivers/opp/of.c @@ -554,11 +554,24 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_of_add_table); int dev_pm_opp_of_add_table_indexed(struct device *dev, int index) { struct device_node *opp_np; - int ret; + int ret, count; +again: opp_np = _opp_of_get_opp_desc_node(dev->of_node, index); - if (!opp_np) + if (!opp_np) { + /* + * If only one phandle is present, then the same OPP table + * applies for all index requests. + */ + count = of_count_phandle_with_args(dev->of_node, + "operating-points-v2", NULL); + if (count == 1 && index) { + index = 0; + goto again; + } + return -ENODEV; + } ret = _of_add_opp_table_v2(dev, opp_np); of_node_put(opp_np);