Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4304916imm; Wed, 30 May 2018 03:09:53 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI1n3fiteCLfB7qjrdN3QbqW0dHgCHYbAEtqP94vLoVsymqlrhM0w2h9w+bQlmwZNm5clNK X-Received: by 2002:a17:902:5a4b:: with SMTP id f11-v6mr2221488plm.85.1527674993929; Wed, 30 May 2018 03:09:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527674993; cv=none; d=google.com; s=arc-20160816; b=S/axkx3BwW81tmXMv4wgmWpHbPx4duFFMYqhA5imH8HWaaatUyqFcIH5ymS5Xf2lKe xqvrIirCBQDB+agfUJN2Xt4POJoUDorHKwscRyJ0WAsBIW8HKmKGgjZGTzr4LKm3Af2c MNR3W9rKabKQcfbvpZ4Smv6C7ZbnmU1n7KHmMM5g6YJKpgfOLJRWqYYIW+CckaKeUnQ+ YBKAIt2mA4ObGL1ny1et7EnTO1AuptHJV0oPtLh1KP9A5coIAm1TZ99TcMHLjDsDk8PG F2PJlGFlxL+2EcK/rW5twMeDDpGSly91J5R8CEgc7cYyserWLhvLRmcnrFEUtlCJYyeT oXqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature:arc-authentication-results; bh=JEJfPBhyE4jLJjUvCUHELfA+HY3k14iwFufe8IKwk3I=; b=UF/qRNPcSJs1Ebu/3nY5WQkTFFqT+SSHFgVhlWwkhyemhx5hg3o/qflzE0083oQjZa Tlbtjn12K4df9KpYN3DRCdLFn4xau3yP3+ANG/V2duGx38UpVAA0vjZf5t0yz01Yai1B dpaRlBaXV2+CUffW3XLYAIKl+vbxnZjCbjsqzbxPg/jEtPHHhUBV8YeclVeyyrnm1d00 lWJYRzR4YdQSeAdLtjmnOLhq3XQ9YgOOrtF52Mg3FZFkmXT5fM+vfIjz34bgw2N5scU2 +sE3XCvQj/HUJdt1Q30PvkDoPEXJ1UGDhxvUd95olA6jrZ2T9btzGlSMDN46VeG141V/ w2EQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=C1eOEFAv; dkim=pass header.i=@codeaurora.org header.s=default header.b=X4Y/n2Eg; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d11-v6si34923701pfh.131.2018.05.30.03.09.39; Wed, 30 May 2018 03:09:53 -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=@codeaurora.org header.s=default header.b=C1eOEFAv; dkim=pass header.i=@codeaurora.org header.s=default header.b=X4Y/n2Eg; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751976AbeE3KH7 (ORCPT + 99 others); Wed, 30 May 2018 06:07:59 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:48022 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750710AbeE3KH5 (ORCPT ); Wed, 30 May 2018 06:07:57 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 14E576063F; Wed, 30 May 2018 10:07:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1527674877; bh=3Uhn4KsMhni9fuA4ijoBg53v6/mI10BiRTydoR2UstE=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=C1eOEFAvneJXSEqtm6qB1QldozV2XkK3uhv6tlETlh0ARx7XrX9xfDOppLjairK7O 3b13BC7Lu5alQWj35zhPwGFxDjvAIQWhCnAUIbeLPkRozSpczCCxIlHyO8TCVbNLLk nDbecIc3idJIE1O5696Uw3xZPYobaViZJR8CVBjI= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [10.79.40.88] (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.18.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: rnayak@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 0BF806021C; Wed, 30 May 2018 10:07:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1527674876; bh=3Uhn4KsMhni9fuA4ijoBg53v6/mI10BiRTydoR2UstE=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=X4Y/n2EgEY8RzcYM3mpUFpoTGkdcDTTzLIdqfZOmNbxbmQFB03eLncfiRpkXdqWEf aKm6+2PKpfkDRoP5K7V8WEJpWgfe0cemBs11WCHo5gRHlKrkqiXc6HV3PO+gySv0IZ bR5LpvZkF6STatGzuHcOX139mDKfw2ZI+ute76+o= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 0BF806021C Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=rnayak@codeaurora.org Subject: Re: [PATCH v2 5/6] soc: qcom: rpmh powerdomain driver To: Viresh Kumar 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 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> <20180530094438.xnyukvhum7tc6roh@vireshk-i7> From: Rajendra Nayak Message-ID: <9b147942-8a6a-34c0-ba94-a6935b354b70@codeaurora.org> Date: Wed, 30 May 2018 15:37:51 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180530094438.xnyukvhum7tc6roh@vireshk-i7> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/30/2018 03:14 PM, Viresh Kumar wrote: > 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: yes, seems to work. > 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); > > -- > 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 > -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation