Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3592989rdg; Tue, 17 Oct 2023 23:01:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH37UVnMC/VekOBdzZxdUEiIbMKbY4/E2z2r5CDi5Nk2VtnzDQm4a/vmreqqOK6vqRJkJc8 X-Received: by 2002:a05:6870:b18:b0:1a6:a547:ffe1 with SMTP id lh24-20020a0568700b1800b001a6a547ffe1mr4756658oab.21.1697608894960; Tue, 17 Oct 2023 23:01:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697608894; cv=none; d=google.com; s=arc-20160816; b=0dhIJC/VAbIQRwisnbXfKraRSq8Kkf9UYWRn5WFF0/+fPn6JfZoHUwFlO6R6bD7FqS AUKRJwdjpihb9Idn6z4BBqrm42xjT4BzskEzZ6jIHnk0yE9l4oLM/rpeSEd5Sd8LAyUP Ri6ZQ3knjzXSb5azSL+4aBzFjeM2LS2mDB4VraK8EFBmfY0cI5z7YVsj5F39567Rt/BU uiVZ0RQLKy6C2feS95KkIW60Krxnb+V5V1les+RhF/fXyAykg/VlbKUBWNPbR0tKX5Ly M/94GNDTR4jnDEAzAciACTqhrYSn4nX2ulm/Uk5hw43P1j41UpFMMSVYI/6wHMZQQh9q jDMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:autocrypt :from:references:cc:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=6jYUU/zMwQ57icTdluFdkVmoJdfusA7m4N1I0RAQAJ8=; fh=hi7p13FJhd+c6nwvq9d141s0PyTEbhkgQ1zkqRkG6DU=; b=u4sdTShC2FXjvoTfvcd6VqTxsg+cLMmKEkwa3pcMthvczen1Q6pfixo+QmPWIbw4HK VYrB7yqofFGkLo77zciq/BR0Hz7Kv0gaxrjV5e617W9HGazZIR8GSMJwiHU3GwyFbbSy U/xF2NtMoUd4QGJM+oHXEMRgFTjqwnGPMWbJbki0tPBcUuy7a5iihyjyEabCMgbDrrUz NRplKEzyIpzbizDmur74yFSGI/ToAk86k4rL1qXpow+lKOZYjwKxmoxF+NT+i36qIuWJ KqnUHwXvRC19xuzqWkTWFrnrsJsMFAoAvDnZGaaoeZGpDx5c58NAItUcj+qu9pyJ7D6B 3dyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SMW+4zZR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id bz39-20020a056a02062700b005641ddd0309si1691232pgb.599.2023.10.17.23.01.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 23:01:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SMW+4zZR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 532688070E04; Tue, 17 Oct 2023 23:00:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229610AbjJRGAm (ORCPT + 99 others); Wed, 18 Oct 2023 02:00:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229595AbjJRGAl (ORCPT ); Wed, 18 Oct 2023 02:00:41 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBF5FF9 for ; Tue, 17 Oct 2023 23:00:38 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-407c3adef8eso10881565e9.2 for ; Tue, 17 Oct 2023 23:00:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697608837; x=1698213637; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=6jYUU/zMwQ57icTdluFdkVmoJdfusA7m4N1I0RAQAJ8=; b=SMW+4zZRxBpo0dDRtVQcrjed634Z5Y/sGjZBrbdcU0HGjd4e7RGpNLR/VaSgKeJ40o pE+onUgqNbIEofkHB0KvK1Sa/IiIZdgJHVZaIy/8ylH6bi13x/JDnztldxDgtgzWg1py hmEUSQ2TpQq1RR2PaRpQf59I+C52JkJ/h2jaPghymUYwv0HZaJf/9QN5DiwBDauUwRiu 3E26Oy/IqqXLegFI7Uz2wFM6WLaZiTLnd4biR6PFjCT0yLzzEYQVL2tvSAGyNm3RIBZ0 dRQk3NaxCW2ng+K1OeUOMHq5OaYEqN6d+dzMB8rfTWJnhKI0Zq5Oxy+UMomSlnvMRVkC tmfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697608837; x=1698213637; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6jYUU/zMwQ57icTdluFdkVmoJdfusA7m4N1I0RAQAJ8=; b=jD8Nu3/YX1BrRRmKoQxrKmkecLkMeNHAse6TDF/XOHryZsk8FkNBoNRg5F5QQAcUfG Oh1H2af4d6QBhe3qs0rR58/UfXbhhb1cNX5otPJ4graD0boxlHp7F9VdS09fxOn6aArW LqD1warGZi/2A0gRMsZHosTnu/qL5xIFoIxszVCkt+ckrN8h5r60ZpTxm4y9f4MZnI9j GxUn8o3fVDUCNcWM4yVigARM1gVamTnAXsZcHxpHHFADIbQWsE2zxuiwEt7wMLR8hlyN Yrxta/lz2SB7LiJwAVY1ZkBiU2/4+bB6aV/hgrTltew3Q/vktMugVJQ9gcSPcLl7emTL 7k7Q== X-Gm-Message-State: AOJu0Yzmhw/uQPFQr2f1KYK18aPIF95916eQtVSnH8PDtKnjrN4+aaUI oiGcddZekxTf0C9FDkeOgmxNhw== X-Received: by 2002:a05:600c:19cc:b0:405:375d:b860 with SMTP id u12-20020a05600c19cc00b00405375db860mr3162436wmq.21.1697608837336; Tue, 17 Oct 2023 23:00:37 -0700 (PDT) Received: from [192.168.1.20] ([178.197.219.154]) by smtp.gmail.com with ESMTPSA id h5-20020a05600c350500b003fc0505be19sm722336wmq.37.2023.10.17.23.00.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 17 Oct 2023 23:00:36 -0700 (PDT) Message-ID: Date: Wed, 18 Oct 2023 08:00:35 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 10/12] dt-bindings: usb: qcom,dwc3: Introduce flattened qcom,dwc3 binding Content-Language: en-US To: Bjorn Andersson Cc: Bjorn Andersson , Konrad Dybcio , Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Wesley Cheng , Thinh Nguyen , Felipe Balbi , Philipp Zabel , linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , Krishna Kurapati PSSNV References: <20231016-dwc3-refactor-v1-0-ab4a84165470@quicinc.com> <20231016-dwc3-refactor-v1-10-ab4a84165470@quicinc.com> <9f53e647-7c38-435f-bc74-e4f417445830@linaro.org> <20231017225433.GW3553829@hu-bjorande-lv.qualcomm.com> From: Krzysztof Kozlowski Autocrypt: addr=krzysztof.kozlowski@linaro.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWqD06/RjI2AnjIq5fSEH/BIfXXfC68nMp9BZoy3So4ZsbOlBmtAPvMYX6U8VwD TNeBxJu5Ex0Izf1NV9CzC3nNaFUYOY8KfN01X5SExAoVTr09ewARAQABzTRLcnp5c3p0b2Yg S296bG93c2tpIDxrcnp5c3p0b2Yua296bG93c2tpQGxpbmFyby5vcmc+wsGUBBMBCgA+FiEE m9B+DgxR+NWWd7dUG5NDfTtBYpsFAmI+BxMCGwMFCRRfreEFCwkIBwIGFQoJCAsCBBYCAwEC HgECF4AACgkQG5NDfTtBYptgbhAAjAGunRoOTduBe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Fh+/Q== In-Reply-To: <20231017225433.GW3553829@hu-bjorande-lv.qualcomm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Tue, 17 Oct 2023 23:00:52 -0700 (PDT) On 18/10/2023 00:54, Bjorn Andersson wrote: > On Tue, Oct 17, 2023 at 08:11:45AM +0200, Krzysztof Kozlowski wrote: >> On 17/10/2023 05:11, Bjorn Andersson wrote: >>> diff --git a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml > [..] >>> +select: >>> + properties: >>> + compatible: >>> + items: >>> + - enum: >>> + - qcom,ipq4019-dwc3 > [..] >>> + - qcom,sm8550-dwc3 >> >> This enum could be replaced with '{}'. Alternatively, drop enum entire >> select replaced with: >> - contains >> - items: >> - const: qcom,dwc3 >> - const: snps,dwc3 >> > > I thought this would be what I needed as well, but unfortunately this > select matches either qcom,dwc3, snps,dwc3, or both. With the result > that e.g. the example in the snps,dwc3 binding matches against this and > as expected fails when validated against this binding. > > Taking yet another look at this, and reading more about json validation > I figured out that the following matches nodes with both the > compatibles: > > select: > properties: > compatible: > items: > - const: qcom,dwc3 > - const: snps,dwc3 > required: > - compatible > > [..] >>> + >>> +# Required child node: >> >> Drop >> > > Of course. > >> >> ... >> >>> diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml >>> index d81c2e849ca9..d6914b8cef6a 100644 >>> --- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml >>> +++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml >>> @@ -44,14 +44,18 @@ properties: >>> It's either a single common DWC3 interrupt (dwc_usb3) or individual >>> interrupts for the host, gadget and DRD modes. >>> minItems: 1 >>> - maxItems: 4 >>> + maxItems: 5 >>> >>> interrupt-names: >>> - minItems: 1 >>> - maxItems: 4 >>> oneOf: >>> - - const: dwc_usb3 >>> - - items: >>> + - minItems: 1 >>> + maxItems: 5 >>> + items: >>> + - const: dwc_usb3 >>> + additionalItems: true >> >> This is not correct change. Before, one dwc_usb3 interrupt was combined >> allowed, or a set of host+peripheral+otg+wakeup. Now, you allow combined >> dwc_usb3 with anything. >> > > My intention here is to make below list of 5 strings be valid according > to the snps,dwc3 (i.e. dwc_usb3 being the first item), and valid > according to the qcom,dwc3 binding with all 5 defined. > > interrupt-names = "dwc_usb3", "hs_phy_irq", "ss_phy_irq", > "dm_hs_phy_irq", "dp_hs_phy_irq"; > > When I express this as: > > interrupt-names: > minItems: 1 > maxItems: 5 > oneOf: > - const: dwc_usb3 > - items: > enum: [host, peripheral, otg, wakeup] > > I get: > > /local/mnt/workspace/bjorande/linux/Documentation/devicetree/bindings/usb/qcom,dwc3.example.dtb: usb@a600000: interrupt-names: 'oneOf' conditional failed, one must be fixed: > ['dwc_usb3', 'hs_phy_irq', 'ss_phy_irq', 'dm_hs_phy_irq', 'dp_hs_phy_irq'] is too long > 'dwc_usb3' is not one of ['host', 'peripheral', 'otg', 'wakeup'] > 'hs_phy_irq' is not one of ['host', 'peripheral', 'otg', 'wakeup'] > 'ss_phy_irq' is not one of ['host', 'peripheral', 'otg', 'wakeup'] > 'dm_hs_phy_irq' is not one of ['host', 'peripheral', 'otg', 'wakeup'] > 'dp_hs_phy_irq' is not one of ['host', 'peripheral', 'otg', 'wakeup'] > from schema $id: http://devicetree.org/schemas/usb/snps,dwc3.yaml# > > Which to me sounds like the two oneOf branches allow me a single entry, > or items from the set given here. In contrast, I believe that my > proposal allow 1-5 items, where the first needs to be dwc_usb3. > > But the proposal does look messy, so I'd appreciate some guidance on > this one. Then you need three branches I guess, with your branch listing the Qcom specific interrupts. The point is that dwc_usb3 should not be allowed with host/peripheral/otg/wakeup. Best regards, Krzysztof