Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1986060rwb; Fri, 11 Nov 2022 03:29:44 -0800 (PST) X-Google-Smtp-Source: AA0mqf7bLffglobHYrhVPuWsPP2AhkMlWNNi2xIHDzzlQFIrAUradvpx5f139Tmbss6Afw99yA+i X-Received: by 2002:a63:da43:0:b0:470:38f8:4b1a with SMTP id l3-20020a63da43000000b0047038f84b1amr1195716pgj.461.1668166184188; Fri, 11 Nov 2022 03:29:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668166184; cv=none; d=google.com; s=arc-20160816; b=auImzaH1+YSuBpFvACTDDqvoidZ1J4HA5NXVa6eHugOLHQTKbK0DLBaNEXvy0Mcczy zEPOOVJbAUU6tnx2HugVk8Rp9jPkhqwkGsYo7ze8148ObOx2370KeXTjyrnBbitjCdh3 rNPGYt7J0AATRyELtOoU9+kmgoIxo+AjCT4LS1JlAsBWwRgokdP3TETHwxvSg7X29u4V H8mtyFdRA7LUyRXMZ38HS6ZReO55pjooDvlxXKvjYZyYKLntBO2uyBEkYiU1ldx3TXEP kNB0Gs4PbL3Kw7kHAt2cKU1BR8w5cFnW3LdGmHl8ih3vilpbKiuRTJJ/+IQ/GovPc+zb LtCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=76BtwbFvEgk2Ooutx96DcencoxzI0YNwdpHtqJ9zpeA=; b=VktUG3azBwtJss9e1+iCwEHuQDSFVRudEaZRTdX/u7QFPUwKvcq8kLgb5fAipbKzUA yaERQsfyzPchs5GF6/cVD4xuE5anvMVkyCBn3Ve2LYpYmCUOq0PBu/wHIggNast2KIop cpv9GKwvrbsJlJhAKcGg0FsFDo/EAIM7DnEYrlYscqRog8NYRP5To4wWT3ik9dk+yfH7 HbwmsC+GeX/zmOBLBl4c3tNlV24PiEdSUbewCCrU6bH4lRohMWB7u1kc0P9F9RHCG/3q K3dNZAXkbIrvs3xN6aTX/St63q4VwSapqolth55CoBAw0xXppUJgpBYKfPv43URq9Etg T5TQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=nXtR+qxM; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a3-20020a63e843000000b0043c1481a835si2172383pgk.267.2022.11.11.03.29.32; Fri, 11 Nov 2022 03:29:44 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=nXtR+qxM; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231778AbiKKLBF (ORCPT + 92 others); Fri, 11 Nov 2022 06:01:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233602AbiKKLAx (ORCPT ); Fri, 11 Nov 2022 06:00:53 -0500 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E756EB7E6; Fri, 11 Nov 2022 03:00:51 -0800 (PST) Received: by mail-lf1-x12b.google.com with SMTP id b3so7818327lfv.2; Fri, 11 Nov 2022 03:00:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=76BtwbFvEgk2Ooutx96DcencoxzI0YNwdpHtqJ9zpeA=; b=nXtR+qxMq0XgeDJtDFVMdSUiQN1YYiLwdpQISUE9AmHgjBSYmDze3Gk+8SFABBQD+G OOGZKAeZ51uvcfTozUAjWmulLtvR+IMTNP4pRiwu/4FBsZH0qfbcrsPRUo5wAyxV1kwn 6HewTOy6jBq0a/Vj8QHi9clu/v6wcfrbIUBBOqDrCLKqX8ppkkMIgJxodwHwlalHXqtU K4wHeUCbE2UN2MOTpjg5YOl9MTtV9kWxRZy9R1uh62ocNbBj9GDNgWgMEAX7rxUYpyVq tSVA4HI4R7aRc17NKxW0jggLp84KpRroSRLUN1g5GMZx/zfyOZM8S+b5EMug5wUdqtcj PzQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=76BtwbFvEgk2Ooutx96DcencoxzI0YNwdpHtqJ9zpeA=; b=COYvxorFmqE52eFnkyOF6doEYpzt5Vxn9lAuAKsBZb+8P8Q6NhvhGrG+9bGGptNyxA iw7k6dCiDNMH/gLMWWpIavBBM4YXRtFUJ7LE1T8fAhJ0MFRegbgC6BumR3dEZZOqI7BA K18s91fQxm8I9u1ezUV3W4SttglySUIujhie6og4lvvUZJzrg1+5zaun8eHzbt+jUFAD L1AjyfDLfjqmeBtefFpK1cPMohVTLHWnl9CrXhdfmKr13hFgkLUBDiu3mNyxZ37EywYx GGq1FdmgucnsQM83lwXqfiA36sn0e7vKI2NIFISzDin9pzJgp5Y2Qq458xS9bt3HsQmx 1wQg== X-Gm-Message-State: ANoB5pnr1S9bYRzSqfo1UKDLf0nz7ivMlpPem1e4FjS63l0Aqp1uyS/j Cky6UL8nMMQZZXIznM7VJGxxIEHfMi488A== X-Received: by 2002:a19:500f:0:b0:4a3:9533:f4c9 with SMTP id e15-20020a19500f000000b004a39533f4c9mr580057lfb.615.1668164450136; Fri, 11 Nov 2022 03:00:50 -0800 (PST) Received: from mobilestation ([95.79.133.202]) by smtp.gmail.com with ESMTPSA id p3-20020a2eb103000000b002770566d642sm351039ljl.17.2022.11.11.03.00.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Nov 2022 03:00:49 -0800 (PST) Date: Fri, 11 Nov 2022 14:00:46 +0300 From: Serge Semin To: Rob Herring Cc: Serge Semin , Krzysztof Kozlowski , Bjorn Helgaas , Lorenzo Pieralisi , Cai Huoqing , Robin Murphy , Jingoo Han , Gustavo Pimentel , Richard Zhu , Lucas Stach , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Alexey Malahov , Pavel Parkhomenko , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Frank Li , Manivannan Sadhasivam , caihuoqing , Vinod Koul , linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Alexander Stein , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v6 01/20] dt-bindings: imx6q-pcie: Fix clock names for imx6sx and imx8mq Message-ID: <20221111110046.rqjl2zaapipsgkpa@mobilestation> References: <20221107204934.32655-1-Sergey.Semin@baikalelectronics.ru> <20221107204934.32655-2-Sergey.Semin@baikalelectronics.ru> <20221110210104.GA963064-robh@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221110210104.GA963064-robh@kernel.org> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 10, 2022 at 03:01:04PM -0600, Rob Herring wrote: > On Mon, Nov 07, 2022 at 11:49:15PM +0300, Serge Semin wrote: > > Originally as it was defined the legacy bindings the pcie_inbound_axi and > > pcie_aux clock names were supposed to be used in the fsl,imx6sx-pcie and > > fsl,imx8mq-pcie devices respectively. But the bindings conversion has been > > incorrectly so now the fourth clock name is defined as "pcie_inbound_axi > > for imx6sx-pcie, pcie_aux for imx8mq-pcie", which is completely wrong. > > Let's fix that by conditionally apply the clock-names constraints based on > > the compatible string content. > > > > Fixes: 751ca492f131 ("dt-bindings: PCI: imx6: convert the imx pcie controller to dtschema") > > Signed-off-by: Serge Semin > > Acked-by: Alexander Stein > > > > --- > > > > Changelog v5: > > - This is a new patch added on the v5 release of the patchset. > > --- > > .../bindings/pci/fsl,imx6q-pcie.yaml | 47 +++++++++++++++++-- > > 1 file changed, 42 insertions(+), 5 deletions(-) > > > > diff --git a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml > > index 376e739bcad4..ebfe75f1576e 100644 > > --- a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml > > +++ b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml > > @@ -16,6 +16,47 @@ description: |+ > > > > allOf: > > - $ref: /schemas/pci/snps,dw-pcie.yaml# > > + - if: > > + properties: > > + compatible: > > + contains: > > + const: fsl,imx6sx-pcie > > + then: > > + properties: > > + clock-names: > > + items: > > + - const: pcie > > + - const: pcie_bus > > + - const: pcie_phy > > + - const: pcie_inbound_axi > > + - if: > > + properties: > > + compatible: > > + contains: > > + const: fsl,imx8mq-pcie > > + then: > > + properties: > > + clock-names: > > + items: > > + - const: pcie > > + - const: pcie_bus > > + - const: pcie_phy > > + - const: pcie_aux > > + - if: > > + properties: > > + compatible: > > + not: > > + contains: > > + enum: > > + - fsl,imx6sx-pcie > > + - fsl,imx8mq-pcie > > + then: > > + properties: > > + clock-names: > > + items: > > + - const: pcie > > + - const: pcie_bus > > + - const: pcie_phy > > > > properties: > > compatible: > > @@ -57,11 +98,7 @@ properties: > > > > clock-names: > > minItems: 3 > > - items: > > - - const: pcie > > - - const: pcie_bus > > - - const: pcie_phy > > - - const: pcie_inbound_axi for imx6sx-pcie, pcie_aux for imx8mq-pcie > > This should have been just 'enum: [ pcie_inbound_axi, pcie_aux ]' > > And then do: > > - if: > properties: > compatible: > contains: > const: fsl,imx8mq-pcie > then: > properties: > clock-names: > items: > - {} > - {} > - {} > - const: pcie_aux > > > And then another if/then with 'maxItems: 3' Ok. Will fix it in v7. But IMO it looks a bit less descriptive especially with the '{}' pattern and a need to look in two different places to comprehend the whole constraint. I understand though what is an intention of such construction. It's to place as much info into the schema body and isolate the platform-specific constraints in the allOf clause. Pretty neat anyway. -Sergey