From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 78591C433EF for ; Thu, 16 Dec 2021 13:41:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:In-reply-to: Date:Subject:Cc:To:From:References:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UL4JEH/F7J/ErVmypARDdGHWWXZOcbhGul1UdkuAjqg=; b=lD5Yhj8wRjiuPA HdWRIj1oWhdstqNFgfnSl5ukMQ2ou1fU4AQjpxriFklcdDSeoH66DR8Qb/rBObHes1R4aTc/kQ5Bw LrkA/ZUTF/qNEMkVTdCvJdGeCyq/LTfyC651BCn4kM8OeJaCNrH1idR3Or0YiqoHVSGCRkfOf+vB4 bltGdy6ycK4HkpRs8Y5s2te522I9iB8yTBgDvJYPD9zq0CRx8fqDeUoWH4fu7o0q3ugDKe7fI3UNT 8i+AQZwReUD8wRJniOLzAGKMI5e23hPD8URIeVJXE4pgz0iamvFjdqhCw1oZIfEH+/mR7WWvy+Mr/ rC/IR670hIXaeeAHn1ng==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mxqya-005ryF-RE; Thu, 16 Dec 2021 13:39:17 +0000 Received: from guitar.tcltek.co.il ([84.110.109.230] helo=mx.tkos.co.il) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mxqn9-005mtt-5L for linux-arm-kernel@lists.infradead.org; Thu, 16 Dec 2021 13:27:29 +0000 Received: from tarshish (unknown [10.0.8.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx.tkos.co.il (Postfix) with ESMTPS id B9D09440850; Thu, 16 Dec 2021 15:27:18 +0200 (IST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tkos.co.il; s=default; t=1639661239; bh=GGW4oMJYRC69vd45cdk19A3Rm8Gj9iXkt/iwHmF4JMM=; h=References:From:To:Cc:Subject:Date:In-reply-to:From; b=lFkI0wVB3mBSuyWFka5umb5saMwVEhgbRH2CNfMTvaCPOeXIGbqjnUhdsz2tGEC1D Hbw4FbG7DYyGFH0MmlchCZogWVsCdlJYsBsbr82lE1T05Sch8JMsO5ARV8oWqS4ces ZAKxPJ40YEbmprw/XKzCRNFOmE3tvI7j7KN0Hjlux0fR7u73hzdWN2aoiNNgqjgTSz DCPc3AqSRvTOuRHshKCB7TkITKyRBgVs8nZEtVUF0NkhZAe+/Xvj1KvK6nB8QMDxnb C6cu+ST/6KwlqtImTEy8TMkO1qBMZIdgvLWJcZ4XJ50Dy6LWFkwPhUsBKiQm19C0Jt Y+tPVqe1usIRA== References: <8a744cfd96aff5754bfdcf7298d208ddca5b319a.1638862030.git.baruch@tkos.co.il> <281f0532-2f3b-362a-5df6-d9cbe302606a@gmail.com> User-agent: mu4e 1.6.10; emacs 27.1 From: Baruch Siach To: Florian Fainelli Cc: Andy Gross , Bjorn Andersson , linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Sricharan R Subject: Re: [PATCH] arm64: dts: qcom: ipq6018: Fix gpio-ranges property Date: Thu, 16 Dec 2021 14:11:32 +0200 In-reply-to: <281f0532-2f3b-362a-5df6-d9cbe302606a@gmail.com> Message-ID: <874k78n0hz.fsf@tarshish> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211216_052727_673738_4E2D0C7E X-CRM114-Status: GOOD ( 30.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Florian, On Wed, Dec 15 2021, Florian Fainelli wrote: > On 12/6/21 11:27 PM, Baruch Siach wrote: >> There must be three parameters in gpio-ranges property. Fixes this not >> very helpful error message: >> >> OF: /soc/pinctrl@1000000: (null) = 3 found 3 >> >> Fixes: 1e8277854b49 ("arm64: dts: Add ipq6018 SoC and CP01 board support") >> Cc: Sricharan R >> Signed-off-by: Baruch Siach >> --- >> >> The error message was improved in commit af3be70a321 ("of: Improve >> of_phandle_iterator_next() error message"), but there is evidently some >> more room for improvement. As I don't really understand the code, I >> added the commit author and the DT list to Cc. > > In the commit message you find what the error message was and then > became which tells you which property was used to determine the cell > size, and what count was obtained instead. > > In your particular case here however, since the proper was with the > 'gpio-ranges' property and there is no property that indicates the cell > size AFAICT, it might been more helpful to revert back to the old > message maybe? Thanks for taking a look. A few comment below. > So maybe something like which is hopefully the best of > both worlds: > > diff --git a/drivers/of/base.c b/drivers/of/base.c > index 372a177f3b80..63bff37bf035 100644 > --- a/drivers/of/base.c > +++ b/drivers/of/base.c > @@ -1378,9 +1378,13 @@ int of_phandle_iterator_next(struct > of_phandle_iterator *it) > * property data length > */ > if (it->cur + count > it->list_end) { > - pr_err("%pOF: %s = %d found %d\n", > - it->parent, it->cells_name, > - count, it->cell_count); > + if (it->cells_name) > + pr_err("%pOF: %s = %d found %d\n", > + it->parent, it->cells_name, > + count, it->cell_count); Thinking about it, shouldn't we have 'it->list_end - it->cur' instead of it->cell_count here? This change produces: OF: /soc/pinctrl@1000000: (null) = 3 found 2 which looks more correct. This is not related to my original issue, though it might have helped me back then. > + else > + pr_err("%pOF: arguments longer than > property\n", > + it->parent); > goto err; > } > } I think that the best aid would have been the property name. But as far as I can see struct of_phandle_iterator does not preserve the list_name parameter of of_phandle_iterator_init(). Second best would probably be the phandle name, that is of_node_full_name(it->node). It is a little confusing in this case because it->node is the same as it->parent. What do you think? baruch >> arch/arm64/boot/dts/qcom/ipq6018.dtsi | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/arch/arm64/boot/dts/qcom/ipq6018.dtsi b/arch/arm64/boot/dts/qcom/ipq6018.dtsi >> index 6a22bb5f42f4..a717fc17523d 100644 >> --- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi >> +++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi >> @@ -220,7 +220,7 @@ tlmm: pinctrl@1000000 { >> interrupts = ; >> gpio-controller; >> #gpio-cells = <2>; >> - gpio-ranges = <&tlmm 0 80>; >> + gpio-ranges = <&tlmm 0 0 80>; >> interrupt-controller; >> #interrupt-cells = <2>; >> >> -- ~. .~ Tk Open Systems =}------------------------------------------------ooO--U--Ooo------------{= - baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il - _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel