From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F2BF714AA5 for ; Wed, 17 Jan 2024 10:53:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705488840; cv=none; b=Mq/4j1XVjDOa8/RY2D7N7owUSoBiBMFPeXE+IlR1ceI6oxv8OA1fC1VUwCn/FsxeBfH5d/22f1AymVrdaqtKk7Ng08SrX/z7PWdq5MlKrGRPwgcWeDqK4ZBkIqCbcQY7jzCfIevWKuvoIjnn1L2uyJ7dWp0j6jYN1eVXK0oZtVo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705488840; c=relaxed/simple; bh=KjhNZ8+fWl254kviZY6+sEbXk9RKty3yOVamx6dSXu4=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:Received: Message-ID:Date:MIME-Version:User-Agent:Subject:Content-Language: To:Cc:References:From:Autocrypt:In-Reply-To:Content-Type: Content-Transfer-Encoding; b=ks0RTVQPeCjiBi3R6xU/geeiiLhF16ZXbKAEWsfa+1s703u5KyeT4E7Mqnb03Usz8Hi8ok4NLpotTiZvmKBXVEV2hOimTTlltDhQltGqyVar2KKRwvREaICZGM+Q1eER1Dy12d9FNogQw4y3LieB/+M/vcMSVfI1cZA8M60ErQY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Ri0WhxQv; arc=none smtp.client-ip=209.85.218.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Ri0WhxQv" Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-a28f66dc7ffso2151561666b.0 for ; Wed, 17 Jan 2024 02:53:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705488835; x=1706093635; 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=Qo8eGWPWRkX/4JThm1Lo2hklyFCe76/3hkhcrBEPdhg=; b=Ri0WhxQv6o6jUyntrCe/v0zVNLiSPGfBdptIoTqdIAMPlLyHYyvES//55hnNfv+Z9H P9sTPQL48Zc38M1n2tRcMF2TpK13y5LAhoRY34EkaAyPXZRyO8M5P70Yrgu4d6E9N/xV skB30LduA8gM6lTgZd23jcooPAgXDdNrSTbvc2Uoz5gTke2w5keYkISNWisXeJMWcx3h RknJ78MYGuEvrQxr3t/CQGHzcLktwjFpfUCmwdqsmmS6adHP8dQfMOWUlofzY0pJNuxX bS4Gjmx+OkgP+fVl4WkzCpMy/u/BJZD9tmFe6E6UnRWwqqNqtZ/nERi4pgVWvugDtRS7 FV4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705488835; x=1706093635; 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=Qo8eGWPWRkX/4JThm1Lo2hklyFCe76/3hkhcrBEPdhg=; b=rQgDg6trpCNxEuj6sqAVE9IP7NqqEM8GmkaF1aHQs12jlcITx5+M+REV4rQjN5hCyt Bn9jCCd+0pqLGRkHzuYKfggY+gj0ZQvYSmU2qQNFWoDLs42i+MRLxCj7s3aRSLEcGvI9 EhWywFVUca2CYQU56wtIW23frBJaG5vSIErRhUdy8VDSUZpgLSmUdD1/fRjLGjaob8ij mO2TZAgd4VvCS6iBwu446MFdMc1Uvf6xOeBwZYF2BAb8SFTQlRiMOcMFW37o/4FZG4y7 IATaFKeQVSqORKiZXEk49OpAH6xcIQRwOSrwTOs7QZOCTqMqL64X/9wIDA2T8PjC5Ffu VtXQ== X-Gm-Message-State: AOJu0YwSFzsnfdvvzDWKJCJOYWZWAN2Qh4TgYJbwRRelyj2CsAOJw3N+ 0ig7df1ymBf1bf7YhrbbZ40LHlWJXf/+Af0BHzHnRvnyJSc= X-Google-Smtp-Source: AGHT+IEsjGUMOVB6JCi8pfFJ0atoqzMLYvj0dJD4f+ZuDyiGP7oOQugPXRhs1ZPq6vyYUEWxMOly0g== X-Received: by 2002:a17:906:2f8b:b0:a28:b34d:8694 with SMTP id w11-20020a1709062f8b00b00a28b34d8694mr554688eji.62.1705488835207; Wed, 17 Jan 2024 02:53:55 -0800 (PST) Received: from [192.168.1.20] ([178.197.215.66]) by smtp.gmail.com with ESMTPSA id h10-20020a17090619ca00b00a2ed233c313sm591699ejd.168.2024.01.17.02.53.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 17 Jan 2024 02:53:54 -0800 (PST) Message-ID: Date: Wed, 17 Jan 2024 11:53:53 +0100 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/3] dt-bindings: PCI: ti,j721e-pci-*: Fix check for num-lanes Content-Language: en-US To: Siddharth Vadapalli Cc: bhelgaas@google.com, lpieralisi@kernel.org, kw@linux.com, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, vigneshr@ti.com, afd@ti.com, srk@ti.com References: <20240117102526.557006-1-s-vadapalli@ti.com> <20240117102526.557006-2-s-vadapalli@ti.com> <28fd561a-7c13-48dc-9995-230dc758f257@linaro.org> 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 HgECF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5QvN00m6G9NFF0Le D2GYIS41Kv4Isx2dEFh+/Q== In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 17/01/2024 11:47, Siddharth Vadapalli wrote: > Hello Krzysztof, > > On 17/01/24 16:04, Krzysztof Kozlowski wrote: >> On 17/01/2024 11:25, Siddharth Vadapalli wrote: >>> The existing implementation for validating the "num-lanes" property >>> based on the compatible(s) doesn't enforce it. Fix it by updating the >>> checks to handle both single-compatible and multi-compatible cases. >>> >>> Fixes: b3ba0f6e82cb ("dt-bindings: PCI: ti,j721e-pci-*: Add checks for num-lanes") >>> Fixes: adc14d44d7cb ("dt-bindings: PCI: ti,j721e-pci-*: Add j784s4-pci-* compatible strings") >>> Signed-off-by: Siddharth Vadapalli >>> --- >>> .../bindings/pci/ti,j721e-pci-ep.yaml | 26 ++++++++++++++----- >>> .../bindings/pci/ti,j721e-pci-host.yaml | 26 ++++++++++++++----- >>> 2 files changed, 38 insertions(+), 14 deletions(-) >>> >>> diff --git a/Documentation/devicetree/bindings/pci/ti,j721e-pci-ep.yaml b/Documentation/devicetree/bindings/pci/ti,j721e-pci-ep.yaml >>> index 97f2579ea908..278e0892f8ac 100644 >>> --- a/Documentation/devicetree/bindings/pci/ti,j721e-pci-ep.yaml >>> +++ b/Documentation/devicetree/bindings/pci/ti,j721e-pci-ep.yaml >>> @@ -68,8 +68,9 @@ allOf: >>> - if: >>> properties: >>> compatible: >> >> Missing contains:, instead of your change. > > I did try the "contains" approach before determining that the implementation in > this patch is more suitable. Please consider the following: > > For AM64 SoC the primary compatible is "ti,am64-pcie-ep" and fallback compatible > is "ti,j721e-pcie-ep". For J7200 SoC the primary compatible is > "ti,j7200-pcie-ep" while the fallback compatible is again "ti,j721e-pcie-ep". > > Therefore, the device-tree nodes for AM64 and J7200 look like: > > AM64: > compatible = "ti,am64-pcie-ep", "ti,j721e-pcie-ep"; > ... > num-lanes = 1; > > J7200: > compatible = "ti,j7200-pcie-ep", "ti,j721e-pcie-ep"; > ... > num-lanes = 4; > > This implies that when the check for "num-lanes" is performed on the device-tree > node for PCIe in J7200, the fallback compatible of "ti,j721e-pcie-ep" within the > AM64's "compatible: contains:" check will match the schema and it will check the > existing "num-lanes" being described as "const: 1" against the value in J7200's > PCIe node resulting in a warning. What warning? What did you put to contains? > Therefore, using "contains" will result in > errors if the check has to be performed for device-tree nodes with fallback > compatibles. The "items" based approach I have used in this patch ensures that > the schema matches *only* when both the primary and fallback compatible are > present in the device-tree node. Long message, but I don't understand it. Why this binding is different than all others which rely on contains? >>> + - if: >>> + properties: >>> + compatible: >>> + items: >>> + - const: ti,j784s4-pcie-ep >> >> Why? Previous code was correct. > > Though I used "patience diff", for some reason the addition of > "ti,j721e-pcie-ep" in the check has been treated as the removal of > "ti,j784s4-pcie-ep" first followed by adding the same later for generating the > diff in this patch. The diff above is equivalent to the addition of: No, why do you change existing code? It is correct. Best regards, Krzysztof