Received: by 2002:a05:7412:8d1c:b0:fa:4c10:6cad with SMTP id bj28csp314235rdb; Wed, 17 Jan 2024 02:54:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IHUJIHEZBKLqayiLe1QENEi7leQq50qwiyvVgGEC/XlHXIkTbo3kkucMZ31ngOmt4bi3x66 X-Received: by 2002:a05:6214:3da1:b0:680:c741:2661 with SMTP id om33-20020a0562143da100b00680c7412661mr9726112qvb.92.1705488848320; Wed, 17 Jan 2024 02:54:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705488848; cv=pass; d=google.com; s=arc-20160816; b=FY4pby7AWRZWgvdH3tK5B8ScNaX/g4faJk+0ZTBvNnBK8T/h83gxoNy+UYNOeGBDg5 xh6J2GprzPJE/gHMEQ2PjtjmkLOVD+Uj6jS7+y1tEvPXjCqBfSbw4Jml6kfIjEGVBksx fQUx6EF1aQSYqBhduY5KT0mxoC5HllXHCP+65xVcCzXE1vqGsBeI+2pcyXDk+XIUxReg AAqzpo6VIjGmQwemkSJwNIsrd4eY1O3JIQV9No+uijLJPmbtS8xr0Fw6/8CnPZaWX0xo 7XBJ1Ch8hTD3anoo5vlyfUYQYxzDi9nCH73OUt1y9O0DtAFTMDnwH4tXm9gWsasxuWEO P9IQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=Qo8eGWPWRkX/4JThm1Lo2hklyFCe76/3hkhcrBEPdhg=; fh=mCZdUzSqo6P6LbFnhNuV6O54foZqYE2bhj5QALUq7mo=; b=YIKriN+i/tmMC9n2toz0FDE3QZ64jlkdzE/jElwHFjYGAnw0bHuc/AMuBB9XAemc2K /L41X80Uy15ENxTKUfa4a/hjfKgdtnn0h7+lLT0WkPuealJr7eVJTlZuxbkzqa7UQbdY okKUcWmaTS+DAlc6JBYSW7dIJz8zelsXWvjHJQktUTLLmrql4/LekRp88wCihMKBsTCX Hf2V5N5f8RID6yEtBkqbmIk+HXqyVejn01/2789vamuGF8x6HP8Xvz8PF7GtPibbyF1s A91BLpPLUYRUgO8IZo2gvoRdmbcxN13ksPs/71LOZfu0dzK9Kv4B9KI2lkyvbDxouOEb yI4w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ri0WhxQv; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-28866-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-28866-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id u19-20020a0cdd13000000b00681181ca7b8si11502921qvk.583.2024.01.17.02.54.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 02:54:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-28866-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ri0WhxQv; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-28866-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-28866-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 09E9E1C23D26 for ; Wed, 17 Jan 2024 10:54:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C485C1C6A8; Wed, 17 Jan 2024 10:53:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Ri0WhxQv" Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) (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 002BB14AA7 for ; Wed, 17 Jan 2024 10:53:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705488838; cv=none; b=mcdfIu2KgLfEeH88lWksZTqRTwKszQinCXryrWg3TH90qf5TI0jaNR0Fr7wSc0zlyW6YBDZs9ShvulqDEPZv0DS7FzMM5q/dSAAChDg8MdnoDjscxsZEB4m7lNTa0FeSpw+WFmNE4LQGwv9gLRySpQUkSCZ0WS2iGXv3uftIYOM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705488838; 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=FEBuMzgOrZbSBlrYDuCI0jnewVQENVEZg6/GNlAl6pPBiP/1u96MKnK7kXUiJHxXYMRxy398hvgxVFjWSsvZhdb01UL5alBD+cAEIZoVIJC3bISXvh/3ir+yGc81XY47ryw/7Kyo/c3O8fUOVadA8l1VxOO7DkhR0HyxN5TmkzI= 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.49 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 Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-a2e0be86878so469112666b.1 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=Zc7iqivqtIrVwoODkjkMZcGvo+vpaxlZQup7wBENBlWJ4qCsIg6YezHYhxafnggZgZ XdwC1exkmib5JTFT+y1bg9lKSpJG4+JIrk5aY6zf/8wUZcFtxgk1BalfE0dd08Oan36c kMhl0ie3Wt1ToEoTr1rdxtNAM9fk7g0J2lfeXQAA+iXmq46PyuMqtJGHnTxT4v2t/aJ8 GL5Qdw6fXKhal3N2uZ9z1cyiAR7F+wCyZ93kZH947gOQEXB16ACR1SvD+MDFgHqNd6Q+ 3zOIcq4YPkgzyum5cDs4C1V+CcXfsHiljGrhy2U/v3eUzXsWYjSz2edjLq5C0vqvpLCa qRJw== X-Gm-Message-State: AOJu0Yx9pZr9pFcEsi/uGchRjMjhKAa5ZI9Z2kQD3y099j/XZiMaRXiw jZyF5Scq/QjrVbuB00HRd7m0rO4I91BD1g== 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: linux-kernel@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 S296bG93c2tpIDxrcnp5c3p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06ztUMRrj8eVtpImjsWCd0bDWRaaR4vqhCHvAG9iWXZu4qh3ipie2Y0oSJygcZT7H3UZxq fyYKiqEmRuqsvv6dcbblD8ZLkz1EVZL6djImH5zc5x8qpVxlA0A0i23v5QvN00m6G9NFF0Le 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