Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4287424imm; Wed, 30 May 2018 02:47:14 -0700 (PDT) X-Google-Smtp-Source: ADUXVKInWJ8twqN5V8+yeRjn0Bpmu3KoeXBLWCrvut28OSsXe+KUCvP6h+yT/aoIgIzXgZrZxcku X-Received: by 2002:a17:902:8f97:: with SMTP id z23-v6mr2174183plo.329.1527673634238; Wed, 30 May 2018 02:47:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527673634; cv=none; d=google.com; s=arc-20160816; b=Mi6U833ck7ZQmQx/dsYYt4NgEdKGTRIQ0kNZ7Mi5zvAc235rcOOV5hypDOAQ1RbhkE c40UsMSbqGi60Ihp2uN5t5oBdslj2ObLKtrk9NgGtMCMWkuCCBi7y2cPBrhXLKE7I8TA +eXbpLLtUItKIeTQrLN8cuHOEsqkWnoucHy9MnVK5cFgMM/PtrdR50GYXRCGjhnM911Q hvX3dexN6gvnipAHkOO1PjnoTYS927Lbz6MtLM1AqffzZ3T6refTIqj9Gk7LV0c5lFY9 hSJrbFcckXNlUZ7MtETkdk6srYFatKCol3Kriyxn13yIkg2S+G+HoHkjIKITXxvAjE9e Db2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=mBgODsxc2JmOzjBn7aZ9SBPw0tY3/8RWJRlFiuYR63o=; b=V8bugM1kUtgE0ykyitP4I9utx16TG9vUumjwLWiMsaDfY1oxfyo+9Bi10YVViEBrEA gckXLwIlsSmKYume5RCCpGNkeaW2FjO7bfvxE7d+PpR+wRHPm6lxDlZRU1y+q/vhBFWH 69frWTuZI6dwzpwpSkhfdUebYO6Wcj/X3q+4piogtBoAqIJWZKzpeY49N0+Hh3ruz/DZ VDq+eemBq5Oqbm540EahinUuzUDHP7XJYYUlo1Klxy/TH/R9kQFC6hMjYXHAbQl9uj+d rHnt7MLjMzKlO3auyI1S3ukb7W43NiOEK+jIxQUNqhT/BtREx9Pylv9OHujoizeUUdRe K0Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AbcPwarT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v15-v6si12807312pfl.233.2018.05.30.02.47.00; Wed, 30 May 2018 02:47:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AbcPwarT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968979AbeE3Joo (ORCPT + 99 others); Wed, 30 May 2018 05:44:44 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:38158 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965077AbeE3Jol (ORCPT ); Wed, 30 May 2018 05:44:41 -0400 Received: by mail-pl0-f67.google.com with SMTP id c11-v6so10764217plr.5 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=OuDtMoQuSO+UEev+PDe9BmPV3bcpU1bWLqRUqH1v2onJDK2War9dKwBnL2Dyrxc4ky TQ0B4QYkl32FhZvv5fcsk6OaOPDmqGOfUG8yycIihx/IXwmCgbzlyye0MMPU2cAHXtV3 kirRHCbrIZ0QY+xqmyI4ENq1xutdS0QkfUlt3KiPJVaTNTmXz11r1BH8u3MsTJuavq4l B1TEkD0534Zvxx4aylE8IQrzzQkp2nl+rlagmWf5QcEVsc49nXGfLYZYOvL3OJVsCb4Z 62VOupmkuEVeh8a+xICgnt7NrUFjMeozrJCSN9oQON+gH9JjvPRjppMBP8LQsgmq3uQN TPpQ== X-Gm-Message-State: ALKqPwdBSCOKyDXD5CDKbeQIHh222rjXgKmR21onX87f+ALlgADsyRJM dIxns/VtbK2+gTmPs1TSSC2mcA== 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <36822404-bdf5-1915-03e7-e5ffcff05c9b@codeaurora.org> User-Agent: NeoMutt/20180323-120-3dd1ac Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: 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);