Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2293500rdg; Sun, 15 Oct 2023 22:19:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEdQ2KgHH6lGvMqX9NDtKJEBBALD9a6pwkxUhV+W5K2CbOGOJCjbSS09KWxeH7zF/sC+Sa4 X-Received: by 2002:a05:6a00:1630:b0:6b3:f29c:dde1 with SMTP id e16-20020a056a00163000b006b3f29cdde1mr5071678pfc.21.1697433576845; Sun, 15 Oct 2023 22:19:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697433576; cv=none; d=google.com; s=arc-20160816; b=ThDJctbEMvPnocWfxV188bvXUnJYPweFM3bdaQljR0nnAmZqFMOyuDeK+yYAn0iZ4H oSYqzGO4bTa5fVBC+cXgvexhT+9a1MVxDPiVu36qmHnHwBVoFLTg9r6k7csPA6nX+QqQ IP3PmR9ZdGMtLv3tIJorsujrxAhwNRyOKxZu+hWSefgj25jX4j9G4yeZv6XjtFzaIKQO 9amYeCqwzJBIhpjz5ucOWYqF+VDHkMxCIwQszu5hNXk8450P3FgQ77iIIcLUUGHXi2CC ipntldgTjB3PLd5ovAB5Aqi6srs5wu3WRUBIR4w80OfnpL1FRxZTxKcIOabwTXZRkUdI 0cuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=84IjWES4NlZNq0zAo2UaGKzhd/8FqYzYRf4g+hayiP4=; fh=eAscqywYjqgpJTAvnU7irgk56EnVDBWPRqoUF5p/0uU=; b=bYG4y3Q0vylCihJZeSR1mbDlY72vDx/ju18rzg75Y6sGWPAfKiouiHZ+tamnfe3NKH Mw+8DYm0R2t8v9rk0XHNFCIyxg300SQuBF4FB/SvMkqu9SsiyQbXsxQgmzLgiPsQWUhd oOOlFIg5+6N9Id6L3MFf7FxvRQVPBr9CeuFGvG7ISxo4ljm5sIRXCsGciEZEyaTL34Po UboARcmaVzNa2Rq/adwyqJLbGXNGKWzu2cFVdkm+B0YuHyiz4+PcioZqPr5fSez/rwU2 hy9hKmiKCZOp7kwWgefCH2EraOBVrmejSWxdRNN9mKyHxFPwwmPDuaHPtKnr+na4ZnqW yrHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Le0FQsGO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id fa27-20020a056a002d1b00b0068e48477befsi3159288pfb.211.2023.10.15.22.19.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Oct 2023 22:19:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Le0FQsGO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id BF3168057B05; Sun, 15 Oct 2023 22:19:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229834AbjJPFTZ (ORCPT + 99 others); Mon, 16 Oct 2023 01:19:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229478AbjJPFTX (ORCPT ); Mon, 16 Oct 2023 01:19:23 -0400 Received: from mail-yw1-x1132.google.com (mail-yw1-x1132.google.com [IPv6:2607:f8b0:4864:20::1132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF927E8 for ; Sun, 15 Oct 2023 22:19:21 -0700 (PDT) Received: by mail-yw1-x1132.google.com with SMTP id 00721157ae682-5a7c93507d5so48794857b3.2 for ; Sun, 15 Oct 2023 22:19:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697433559; x=1698038359; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=84IjWES4NlZNq0zAo2UaGKzhd/8FqYzYRf4g+hayiP4=; b=Le0FQsGO828GcvmeiBCAo4NiB3IxL4HAvgwlJFEFS23RKWoHPi6S5vpc95ZXix6vhS gFtyeGgG8ZrHeC8mMDM5KsmoKywM2JKPtJOJXnmJYmCcFKBb7ZBNO31uMORtyBEF5R8u 7qGHHx1vM63ARvOgVfKEowt2JuMdIer2cLCp2ru0pml8Vhf79kSSGfBS6/yQA2m+dZw6 QtJ9TFlfe4uoUdwhW8e7xvmmCnzKR6z0W6oBdg6nGW740URiOa0Kn6pgfVZDah759n6J x3tiG3s+Ayqx5KEKE+Mvl8bfC/Xedy+rBOAmHZUss20pER0AOeUftz4BRfpf7tQxPzxR F9lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697433559; x=1698038359; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=84IjWES4NlZNq0zAo2UaGKzhd/8FqYzYRf4g+hayiP4=; b=gKBG9uqgEcnWLo7DqJekku2JjKRCcuXCzc/95KzPaPnsVuIpHdDi3s1GjZH92bBoVm T+9ARgfBVkhMAyMailFtnEU0qDXtcwdXUhDtUz7+2BnbKEXZRe7PUEv4m83MGA3kUkqR 01G2FOVMQGZLL28xMXDeK7z7WuqRsueUddEEzhirtYfGdymAwngytsPIT1AAqbzI0VxS DeNINeWx2NPgFmX4iirBNczyKhOi513sqFlYBf3CFlZewkaHwKoqQe9QhfM9xl+fMWrv DE9E1VG8iccUHWG7/BQl4GkIWlwcFPrk6GawjwJvDO44inRVYtgx1WJFr8VZArvg0htv w7Kg== X-Gm-Message-State: AOJu0YwpH9t0vr51pYkqHJ5EhBGLaBdNy2RNxBwdVnb6r37sx5lqpxDy y4Zix9rHl0vcn0EiJwG8C0fhHDdYT+F9a1sE5etRFQ== X-Received: by 2002:a05:690c:ec8:b0:5a8:19b0:513f with SMTP id cs8-20020a05690c0ec800b005a819b0513fmr12200346ywb.14.1697433559519; Sun, 15 Oct 2023 22:19:19 -0700 (PDT) MIME-Version: 1.0 References: <1695218113-31198-1-git-send-email-quic_msarkar@quicinc.com> <1695218113-31198-2-git-send-email-quic_msarkar@quicinc.com> <20230921183850.GA762694-robh@kernel.org> <28bf111f-b965-4d38-884b-bc3a0b68a6cc@quicinc.com> <8effa7e5-a223-081b-75b8-7b94400d42e6@quicinc.com> <31e6aab6-73f9-a421-9dfa-292d9d0e9649@quicinc.com> In-Reply-To: <31e6aab6-73f9-a421-9dfa-292d9d0e9649@quicinc.com> From: Dmitry Baryshkov Date: Mon, 16 Oct 2023 08:19:08 +0300 Message-ID: Subject: Re: [PATCH v1 1/5] dt-bindings: PCI: qcom-ep: Add support for SA8775P SoC To: Mrinmay Sarkar Cc: Shazad Hussain , Rob Herring , agross@kernel.org, andersson@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, konrad.dybcio@linaro.org, mani@kernel.org, quic_nitegupt@quicinc.com, quic_ramkri@quicinc.com, quic_nayiluri@quicinc.com, quic_krichai@quicinc.com, quic_vbadigan@quicinc.com, quic_parass@quicinc.com, Bjorn Helgaas , Lorenzo Pieralisi , =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= , Kishon Vijay Abraham I , Vinod Koul , linux-pci@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, mhi@lists.linux.dev, linux-phy@lists.infradead.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sun, 15 Oct 2023 22:19:34 -0700 (PDT) On Fri, 13 Oct 2023 at 15:55, Mrinmay Sarkar wrote: > > > On 10/11/2023 5:13 PM, Dmitry Baryshkov wrote: > > On Wed, 11 Oct 2023 at 14:14, Mrinmay Sarkar wrote: > >> > >> On 10/6/2023 4:24 PM, Shazad Hussain wrote: > >>> > >>> On 9/22/2023 12:08 AM, Rob Herring wrote: > >>>> On Wed, Sep 20, 2023 at 07:25:08PM +0530, Mrinmay Sarkar wrote: > >>>>> Add devicetree bindings support for SA8775P SoC. > >>>>> Define reg and interrupt per platform. > >>>>> > >>>>> Signed-off-by: Mrinmay Sarkar > >>>>> --- > >>>>> .../devicetree/bindings/pci/qcom,pcie-ep.yaml | 130 > >>>>> +++++++++++++++++---- > >>>>> 1 file changed, 108 insertions(+), 22 deletions(-) > >>>>> > >>>>> diff --git a/Documentation/devicetree/bindings/pci/qcom,pcie-ep.yaml > >>>>> b/Documentation/devicetree/bindings/pci/qcom,pcie-ep.yaml > >>>>> index a223ce0..e860e8f 100644 > >>>>> --- a/Documentation/devicetree/bindings/pci/qcom,pcie-ep.yaml > >>>>> +++ b/Documentation/devicetree/bindings/pci/qcom,pcie-ep.yaml > >>>>> @@ -13,6 +13,7 @@ properties: > >>>>> compatible: > >>>>> oneOf: > >>>>> - enum: > >>>>> + - qcom,sa8775p-pcie-ep > >>>>> - qcom,sdx55-pcie-ep > >>>>> - qcom,sm8450-pcie-ep > >>>>> - items: > >>>>> @@ -20,29 +21,19 @@ properties: > >>>>> - const: qcom,sdx55-pcie-ep > >>>>> reg: > >>>>> - items: > >>>>> - - description: Qualcomm-specific PARF configuration registers > >>>>> - - description: DesignWare PCIe registers > >>>>> - - description: External local bus interface registers > >>>>> - - description: Address Translation Unit (ATU) registers > >>>>> - - description: Memory region used to map remote RC address space > >>>>> - - description: BAR memory region > >>>>> + minItems: 6 > >>>>> + maxItems: 7 > >>>>> reg-names: > >>>>> - items: > >>>>> - - const: parf > >>>>> - - const: dbi > >>>>> - - const: elbi > >>>>> - - const: atu > >>>>> - - const: addr_space > >>>>> - - const: mmio > >>>>> + minItems: 6 > >>>>> + maxItems: 7 > >>>> Don't move these into if/then schemas. Then we are duplicating the > >>>> names, and there is no reason to keep them aligned for new compatibles. > >>>> > >>>> Rob > >>> Hi Rob, > >>> As we have one extra reg property (dma) required for sa8775p-pcie-ep, > >>> isn't it expected to be moved in if/then as per number of regs > >>> required. Anyways we would have duplication of some properties for new > >>> compatibles where the member numbers differs for a property. > >>> > >>> Are you suggesting to add the extra reg property (dma) in the existing > >>> reg and reg-names list, and add minItems/maxItems for all compatibles > >>> present in this file ? > > This is what we have been doing in other cases: if the list is an > > extension of the current list, there is no need to duplicate it. One > > can use min/maxItems instead. > Hi Dmitry > > we have tried using min/maxItems rather than duplicating but somehow > catch up with some warnings in dt_bindings check > > //local/mnt/workspace/Mrinmay/lemans/next-20230914/linux-next/out/Documentation/devicetree/bindings/pci/qcom,pcie-ep.example.dtb: > pcie-ep@1c00000: reg: [[29360128, 12288], [1073741824, 3869], > [1073745696, 200], [1073745920, 4096], [1073750016, 4096], [29372416, > 12288]] is too short// > // from schema $id: > http://devicetree.org/schemas/pci/qcom,pcie-ep.yaml#// > ///local/mnt/workspace/Mrinmay/lemans/next-20230914/linux-next/out/Documentation/devicetree/bindings/pci/qcom,pcie-ep.example.dtb: > pcie-ep@1c00000: reg-names: ['parf', 'dbi', 'elbi', 'atu', 'addr_space', > 'mmio'] is too short// > // from schema $id: > http://devicetree.org/schemas/pci/qcom,pcie-ep.yaml#// > ///local/mnt/workspace/Mrinmay/lemans/next-20230914/linux-next/out/Documentation/devicetree/bindings/pci/qcom,pcie-ep.example.dtb: > pcie-ep@1c00000: interrupts: [[0, 140, 4], [0, 145, 4]] is too short// > // from schema $id: > http://devicetree.org/schemas/pci/qcom,pcie-ep.yaml#// > ///local/mnt/workspace/Mrinmay/lemans/next-20230914/linux-next/out/Documentation/devicetree/bindings/pci/qcom,pcie-ep.example.dtb: > pcie-ep@1c00000: interrupt-names: ['global', 'doorbell'] is too short// > // from schema $id: > http://devicetree.org/schemas/pci/qcom,pcie-ep.yaml#// > / > > //local/mnt/workspace/Mrinmay/lemans/next-20230914/linux-next/out/Documentation/devicetree/bindings/pci/qcom,pcie-ep.example.dtb: > pcie-ep@1c00000: interrupt-names: ['global', 'doorbell'] is too short/ > > added the patch in attachment. Please, don't send patches as attachments. It is impossible to comment on it. So, few points I had to fix to make your patch to work: - Please, understand the difference between enum and items. You'd need to add your compat string to only one of them. Or to a new entry. But adding it to both entries is a definite mistake. - You have extended items for existing platforms (reg, reg-names, interrupts, interrupt-names). However you failed to add corresponding minItems, allowing existing platforms to use the list with less items in it. - You do not need to have maxItems:N, minItems:N with the same value. Please drop these minItems, it is the default. - You haven't reviewed the patch on your own. You have erroneously nested 'properties' clauses in two places. $ git diff --stat Documentation/devicetree/bindings/pci/qcom,pcie-ep.yaml | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) Hope this helps. -- With best wishes Dmitry