Message ID | 20230418150606.1528107-1-robh@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2933200vqo; Tue, 18 Apr 2023 08:19:27 -0700 (PDT) X-Google-Smtp-Source: AKy350ZMA+u6eF/6DjeRgSDrPVvga3+KNqi12zMZazQipJy4GB1DvK2qKNDJLdSDK1m3oQmD4kmu X-Received: by 2002:a05:6a20:4292:b0:f0:2893:8a30 with SMTP id o18-20020a056a20429200b000f028938a30mr33147pzj.43.1681831166875; Tue, 18 Apr 2023 08:19:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681831166; cv=none; d=google.com; s=arc-20160816; b=qf/oM2lV9DxWMfozxqunsfALQgxyJhIa6ZDrO+w/wWKwYGE+xD4AaADmagdz/UE+sk H9g5tUqTT4TBIy8UuTxPkXklgvNJ6/7URuViBdh6jlxHTZ/g/oWVvdjslZrpKRqh9hga Kw8m8bPvWFlrhlUZb4ZG9PHTWdD22CadQislg++37eIE/riFozGskYpC/8gfgaP9Ma96 U0moBf48HImEe66khDZsc2dVn3ih5doE8mZjTn8UFruGxXswj77QMVvF/W6yE+UPXIbY U2bsYKxlu4AI0h+uDzjsHWU54gAIjoULsTnV4Vn06rTHPd4fS/WE/BJqx+qazD9h9Dio DmXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=grZMSKokWBxTMT6BuCDaQ21smq7KTeNGJhRCrqdfwnY=; b=dqcy6MF50zvSy3u8CJva55mQNblNUKPkEEtLhxbjc090B1VT22KEbxQcAUHGjeJ6mB AB0ywX3JFE931xjUdzsu4XP4poVjW5W5FBT6m/GMA9grx+ZmfnNhD7HzHTIU26u9QK/c Hfap2cNgcrUxSNLiP4UZMs2w+ja3BupXERMdQPKqxB1QYWeyWGB5DMGlv9SoPHj2Ejfv /5F/02Ag0OUcN642nhFzxMo+RDAaV11IlhxKJWr2338fY/B1CK+Yofb8fcH/2oLt+2Z0 1j+CMqE51qhFVpS6OnnGGytf7wMQO05cJpugqctoAsA4H/U2+0PYby7bXYJGwpMa6fPa 9Q2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y6-20020a655286000000b0051b15b58764si13423616pgp.343.2023.04.18.08.19.09; Tue, 18 Apr 2023 08:19:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232149AbjDRPGk (ORCPT <rfc822;leviz.kernel.dev@gmail.com> + 99 others); Tue, 18 Apr 2023 11:06:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230389AbjDRPGi (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 18 Apr 2023 11:06:38 -0400 Received: from mail-oi1-f178.google.com (mail-oi1-f178.google.com [209.85.167.178]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A142997; Tue, 18 Apr 2023 08:06:37 -0700 (PDT) Received: by mail-oi1-f178.google.com with SMTP id 5614622812f47-38c35975545so447616b6e.1; Tue, 18 Apr 2023 08:06:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681830397; x=1684422397; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=grZMSKokWBxTMT6BuCDaQ21smq7KTeNGJhRCrqdfwnY=; b=V06SPmeFVDIDD9NQ2XpVIE87cRIMXpzRhEAjqmYRj9+NkOv5iRomRQU30VYU+k1vI/ QaM4b0fxItAjT0VyoPgbbt+z4x9raFfaWfjAWcvAMhoYx8MfPojBfPY2A4j8QY9pV/h5 cv4RHfGONWpR6dFe77V6m2lO1AFVt7HcMI8PsOf8E3FXT0xY5fMXY4UGiV7NIX/We5ay bT73VHe+u4FJkgLSQ8Z80j8TFmDIIaYLLnCv3c2f3EDwTwWVSl4wzgAQtm9qI7CUzq2X 2gnDhd7MhKuCsX8RDj1DkD2wRziWDYQVJ7R/XaKYBnGgt/L30uAfT8UuTVeoJwYW90qu chqg== X-Gm-Message-State: AAQBX9dBKhBBmNEbALYn/TStmr9vRI7daWM571uXSE4FJ/tfdf/dzjnT 0i5ao0QNyVHEY4HcZJs07Q== X-Received: by 2002:a54:4719:0:b0:38b:c1ae:cb1a with SMTP id k25-20020a544719000000b0038bc1aecb1amr1147526oik.22.1681830396798; Tue, 18 Apr 2023 08:06:36 -0700 (PDT) Received: from robh_at_kernel.org (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id z64-20020aca3343000000b0038e1564951fsm1809406oiz.55.2023.04.18.08.06.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Apr 2023 08:06:11 -0700 (PDT) Received: (nullmailer pid 1528206 invoked by uid 1000); Tue, 18 Apr 2023 15:06:10 -0000 From: Rob Herring <robh@kernel.org> To: Andy Gross <agross@kernel.org>, Bjorn Andersson <andersson@kernel.org>, Konrad Dybcio <konrad.dybcio@linaro.org>, Linus Walleij <linus.walleij@linaro.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org> Cc: linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] dt-bindings: pinctrl: qcom,pmic-mpp: Fix schema for "qcom,paired" Date: Tue, 18 Apr 2023 10:06:06 -0500 Message-Id: <20230418150606.1528107-1-robh@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763527797690972406?= X-GMAIL-MSGID: =?utf-8?q?1763527797690972406?= |
Series |
dt-bindings: pinctrl: qcom,pmic-mpp: Fix schema for "qcom,paired"
|
|
Commit Message
Rob Herring
April 18, 2023, 3:06 p.m. UTC
The "qcom,paired" schema is all wrong. First, it's a list rather than an
object(dictionary). Second, it is missing a required type. The meta-schema
normally catches this, but schemas under "$defs" was not getting checked.
A fix for that is pending.
Signed-off-by: Rob Herring <robh@kernel.org>
---
Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
Comments
On 18/04/2023 17:06, Rob Herring wrote: > The "qcom,paired" schema is all wrong. First, it's a list rather than an > object(dictionary). Second, it is missing a required type. The meta-schema > normally catches this, but schemas under "$defs" was not getting checked. > A fix for that is pending. > > Signed-off-by: Rob Herring <robh@kernel.org> > --- > Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml > index 9412b9362328..4c3e9ff82105 100644 > --- a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml > +++ b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml > @@ -144,8 +144,9 @@ $defs: > enum: [0, 1, 2, 3, 4, 5, 6, 7] > > qcom,paired: > - - description: > - Indicates that the pin should be operating in paired mode. > + type: boolean > + description: > + Indicates that the pin should be operating in paired mode. Current Linux implementation uses it as a generic pinconf param pinconf_generic_params which is parsed by: pinconf_generic_parse_dt_config() -> parse_dt_cfg() -> of_property_read_u32() The pinctrl-spmi-mpp.c driver, using this schema, treat it as a bool, but I still wonder how the code will parse bool with of_property_read_u32(). Maybe it should be uint32 with value of 0 and 1? Best regards, Krzysztof
On Wed, Apr 19, 2023 at 2:56 PM Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > > On 18/04/2023 17:06, Rob Herring wrote: > > The "qcom,paired" schema is all wrong. First, it's a list rather than an > > object(dictionary). Second, it is missing a required type. The meta-schema > > normally catches this, but schemas under "$defs" was not getting checked. > > A fix for that is pending. > > > > Signed-off-by: Rob Herring <robh@kernel.org> > > --- > > Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml | 5 +++-- > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml > > index 9412b9362328..4c3e9ff82105 100644 > > --- a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml > > +++ b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml > > @@ -144,8 +144,9 @@ $defs: > > enum: [0, 1, 2, 3, 4, 5, 6, 7] > > > > qcom,paired: > > - - description: > > - Indicates that the pin should be operating in paired mode. > > + type: boolean > > + description: > > + Indicates that the pin should be operating in paired mode. > > Current Linux implementation uses it as a generic pinconf param > pinconf_generic_params which is parsed by: > > pinconf_generic_parse_dt_config() -> parse_dt_cfg() -> > of_property_read_u32() > > > The pinctrl-spmi-mpp.c driver, using this schema, treat it as a bool, > but I still wonder how the code will parse bool with > of_property_read_u32(). Maybe it should be uint32 with value of 0 and 1? That should be an error because the length is too short so it should go with some default from the code. Looks like there is no user, though no property could mean keep the default/bootloader setting. Can you sort out which type is really desired here and hopefully we can get rid of the other type. It's not the first case of pinctrl properties with multiple types, but we don't really need more. Rob
On Fri, Apr 21, 2023 at 1:48 PM Rob Herring <robh@kernel.org> wrote: > > On Wed, Apr 19, 2023 at 2:56 PM Krzysztof Kozlowski > <krzysztof.kozlowski@linaro.org> wrote: > > > > On 18/04/2023 17:06, Rob Herring wrote: > > > The "qcom,paired" schema is all wrong. First, it's a list rather than an > > > object(dictionary). Second, it is missing a required type. The meta-schema > > > normally catches this, but schemas under "$defs" was not getting checked. > > > A fix for that is pending. > > > > > > Signed-off-by: Rob Herring <robh@kernel.org> > > > --- > > > Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml | 5 +++-- > > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > > > diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml > > > index 9412b9362328..4c3e9ff82105 100644 > > > --- a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml > > > +++ b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml > > > @@ -144,8 +144,9 @@ $defs: > > > enum: [0, 1, 2, 3, 4, 5, 6, 7] > > > > > > qcom,paired: > > > - - description: > > > - Indicates that the pin should be operating in paired mode. > > > + type: boolean > > > + description: > > > + Indicates that the pin should be operating in paired mode. > > > > Current Linux implementation uses it as a generic pinconf param > > pinconf_generic_params which is parsed by: > > > > pinconf_generic_parse_dt_config() -> parse_dt_cfg() -> > > of_property_read_u32() > > > > > > The pinctrl-spmi-mpp.c driver, using this schema, treat it as a bool, > > but I still wonder how the code will parse bool with > > of_property_read_u32(). Maybe it should be uint32 with value of 0 and 1? > > That should be an error because the length is too short so it should > go with some default from the code. > > Looks like there is no user, though no property could mean keep the > default/bootloader setting. Can you sort out which type is really > desired here and hopefully we can get rid of the other type. It's not > the first case of pinctrl properties with multiple types, but we don't > really need more. Still an issue here. Please sort out what functionality QCom wants here. dtschema (main br) will now throw a warning on it. Rob
On 09/06/2023 23:34, Rob Herring wrote: > On Fri, Apr 21, 2023 at 1:48 PM Rob Herring <robh@kernel.org> wrote: >> >> On Wed, Apr 19, 2023 at 2:56 PM Krzysztof Kozlowski >> <krzysztof.kozlowski@linaro.org> wrote: >>> >>> On 18/04/2023 17:06, Rob Herring wrote: >>>> The "qcom,paired" schema is all wrong. First, it's a list rather than an >>>> object(dictionary). Second, it is missing a required type. The meta-schema >>>> normally catches this, but schemas under "$defs" was not getting checked. >>>> A fix for that is pending. >>>> >>>> Signed-off-by: Rob Herring <robh@kernel.org> >>>> --- >>>> Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml | 5 +++-- >>>> 1 file changed, 3 insertions(+), 2 deletions(-) >>>> >>>> diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml >>>> index 9412b9362328..4c3e9ff82105 100644 >>>> --- a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml >>>> +++ b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml >>>> @@ -144,8 +144,9 @@ $defs: >>>> enum: [0, 1, 2, 3, 4, 5, 6, 7] >>>> >>>> qcom,paired: >>>> - - description: >>>> - Indicates that the pin should be operating in paired mode. >>>> + type: boolean >>>> + description: >>>> + Indicates that the pin should be operating in paired mode. >>> >>> Current Linux implementation uses it as a generic pinconf param >>> pinconf_generic_params which is parsed by: >>> >>> pinconf_generic_parse_dt_config() -> parse_dt_cfg() -> >>> of_property_read_u32() >>> >>> >>> The pinctrl-spmi-mpp.c driver, using this schema, treat it as a bool, >>> but I still wonder how the code will parse bool with >>> of_property_read_u32(). Maybe it should be uint32 with value of 0 and 1? >> >> That should be an error because the length is too short so it should >> go with some default from the code. >> >> Looks like there is no user, though no property could mean keep the >> default/bootloader setting. Can you sort out which type is really >> desired here and hopefully we can get rid of the other type. It's not >> the first case of pinctrl properties with multiple types, but we don't >> really need more. > > Still an issue here. Please sort out what functionality QCom wants here. > > dtschema (main br) will now throw a warning on it. I think we can go with your patch, after double checking my previous concerns are not relevant here - driver reads it as bool just like other bool properties. Best regards, Krzysztof
On 18/04/2023 17:06, Rob Herring wrote: > The "qcom,paired" schema is all wrong. First, it's a list rather than an > object(dictionary). Second, it is missing a required type. The meta-schema > normally catches this, but schemas under "$defs" was not getting checked. > A fix for that is pending. > > Signed-off-by: Rob Herring <robh@kernel.org> > --- Linus, Could you take it for current fixes? The code was wrong and dtschema is warning now about this. Fixes: f9a06b810951 ("dt-bindings: pinctrl: qcom,pmic-mpp: Convert qcom pmic mpp bindings to YAML") Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Best regards, Krzysztof
On Tue, Jun 13, 2023 at 12:50 AM Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > > On 18/04/2023 17:06, Rob Herring wrote: > > The "qcom,paired" schema is all wrong. First, it's a list rather than an > > object(dictionary). Second, it is missing a required type. The meta-schema > > normally catches this, but schemas under "$defs" was not getting checked. > > A fix for that is pending. > > > > Signed-off-by: Rob Herring <robh@kernel.org> > > --- > > Linus, > Could you take it for current fixes? The code was wrong and dtschema is > warning now about this. I have other things ready for 6.4, so I'll add this one. Thanks, Rob > > Fixes: f9a06b810951 ("dt-bindings: pinctrl: qcom,pmic-mpp: Convert qcom > pmic mpp bindings to YAML") > > > Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> > > Best regards, > Krzysztof >
On Tue, Jun 13, 2023 at 3:46 PM Rob Herring <robh@kernel.org> wrote: > On Tue, Jun 13, 2023 at 12:50 AM Krzysztof Kozlowski > <krzysztof.kozlowski@linaro.org> wrote: > > > > On 18/04/2023 17:06, Rob Herring wrote: > > > The "qcom,paired" schema is all wrong. First, it's a list rather than an > > > object(dictionary). Second, it is missing a required type. The meta-schema > > > normally catches this, but schemas under "$defs" was not getting checked. > > > A fix for that is pending. > > > > > > Signed-off-by: Rob Herring <robh@kernel.org> > > > --- > > > > Linus, > > Could you take it for current fixes? The code was wrong and dtschema is > > warning now about this. > > I have other things ready for 6.4, so I'll add this one. Thanks for picking this one Rob! Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Yours, Linus Walleij
diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml index 9412b9362328..4c3e9ff82105 100644 --- a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml +++ b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml @@ -144,8 +144,9 @@ $defs: enum: [0, 1, 2, 3, 4, 5, 6, 7] qcom,paired: - - description: - Indicates that the pin should be operating in paired mode. + type: boolean + description: + Indicates that the pin should be operating in paired mode. required: - pins