Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp926618rdf; Wed, 22 Nov 2023 00:07:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IG9oe4yldDEbfm5sn/jLmZtWIuGv9xZ8GZ2VdqJKh/M8HWdE9HmUSQTpmVBTSGfrO//u/AP X-Received: by 2002:a05:6a20:da97:b0:18b:4fa:a861 with SMTP id iy23-20020a056a20da9700b0018b04faa861mr2121654pzb.7.1700640445799; Wed, 22 Nov 2023 00:07:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700640444; cv=none; d=google.com; s=arc-20160816; b=fo8npFQCpMCAdbi7CNLX1gdIRaGi4b8PAwKt/mP1FU8DvSE7KzCRUh8As4hIRS6Qxd VdWlJ9ZDmhiymcZWWP078KRgOyokJPV2y/4LSM8t68zJTpMgSf7ZEtPa/Pjqps6Fo5x8 HLRXZVBvOJlGx+cQgMTjqh4T0uGaYOjDcXASUkVBhHEG/THat1xeiKJ/uK1K8o1fApzD M0kKMvx/RPeQv7qw3WjTghm9ibFgpBbmib0r9ABkFZ9nqBr/O4HKQNNzUD4EuKviET2D SaR46Yfhz8J6SX45XEMaKuTk9ftU9NWSUX0g73sGprqul9uKSKJAHcvbB5M3Gu8HaI6A IEcQ== 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=ghrTaSbGxLK9kxVU7nsSkXTB5ZRHrTPXh4hZLw4lW1o=; fh=dfY+x/9W7bZrVHzBSvC9U9jMlojDW+wsFgxlTiQhMhM=; b=tq/rwBKfdEJD83Ghzlksc3FqslT90DLJ2UUsekmFsyEN5DKWTYc8VGGRnGs7BOyAee j3Ul8EF8pi+BS8HOYiiCvv15XZWUBB2SLps9mmrf0OakWWjsagf6x/ahgCD+/zvDL1u/ PQmS2W+R1bWg9TndF7+c65RtnUfAVu5LNUjVsYdQ5K+nV0T7+XwXehIV5uuynXqlg4H5 LiehyR/QsCo4bWM8zBP3sQlKPK0BqQzrwwt+dV/YxBKag+1RAWgMo+XEGhbGu9uW+9/V /XoFfdQZcJUWHqnVySCP2C2Ocm78wCLmiZ3FhPPIuB53kn2CxSCmgPZPmKBvCh3QFq/r OsBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=L4qicFFV; 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 m11-20020a170902768b00b001c9af07788csi11585839pll.76.2023.11.22.00.07.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 00:07:23 -0800 (PST) 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=L4qicFFV; 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 0E11580E0A65; Wed, 22 Nov 2023 00:07:20 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235175AbjKVIGl (ORCPT + 99 others); Wed, 22 Nov 2023 03:06:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235153AbjKVIGW (ORCPT ); Wed, 22 Nov 2023 03:06:22 -0500 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B7D326B9 for ; Wed, 22 Nov 2023 00:05:09 -0800 (PST) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-50970c2115eso9275233e87.1 for ; Wed, 22 Nov 2023 00:05:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700640307; x=1701245107; 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=ghrTaSbGxLK9kxVU7nsSkXTB5ZRHrTPXh4hZLw4lW1o=; b=L4qicFFVA5BZDdisS4PFk5p2NFyPGr/qubugiF34J4TSG4zZHfmEiIsrrHADdyDpBT JMnjFaDe0KNcoaSqH7g0bJaKgr3xAbgtifm5W2WMl6vrxX9ijI+SFI8fPrGgO+0HVkA6 ApZ7/JkmZSfTMIAbF5NptXFdzXKNxx8afV+H2AI4n8wDJkuqF/8w897sMVH1r0EpQfQw LMKq7AtVFcd2N+vbxP1OoldnP+qCrpKPFze9v2UDb6A2moLWH5NHfPeTig7ktu+tyB49 8hoIdVUpXPUU04Zo8zsJLPx745WgHeMQhzKja+zHB/jyxVOuvWwbzfMqfDhHTkysukLw xQBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700640307; x=1701245107; 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=ghrTaSbGxLK9kxVU7nsSkXTB5ZRHrTPXh4hZLw4lW1o=; b=lw4J1L7NNBib9TdHzV28QizoM+XuZ0jt+NCo2JuRJXVHjLx2bwi59MISDNDnLSylIh RLTekr+99IqIzks/6pLJ0TA+JESSfDyiWEliz/PwBFNKuk34MTeijw981pcAFpigyLO7 896xmWBdASnCX3+DsF1mwkOGXaroiqTI/9J748gUzqvN/wqqTPTapUIC43lPddnlUUMt 04UdXJC3acJWGXFxuBMcSTiN61a8XIUDwQfB9mbl81EDLTk+idsYtAyhC5202odewncd V+7pZYwZH+oXMiE7af8EKBjCfNrDRndW2eXIrZVl398Q3+EIzohr6h8BatY/hcT6w8aO +gtQ== X-Gm-Message-State: AOJu0YwVEIOcBdMV7xe+FRYs45Vr1pjKg1Awnl7gUt4N+0QHTjE85x8p 4pOOOaM7Bms2BiLMT6CaEtX8KQ== X-Received: by 2002:a05:6512:1086:b0:507:bc6b:38a6 with SMTP id j6-20020a056512108600b00507bc6b38a6mr1300437lfg.33.1700640307182; Wed, 22 Nov 2023 00:05:07 -0800 (PST) Received: from [192.168.1.20] ([178.197.218.100]) by smtp.gmail.com with ESMTPSA id z16-20020adfe550000000b0032db4e660d9sm16411735wrm.56.2023.11.22.00.05.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Nov 2023 00:05:06 -0800 (PST) Message-ID: <01f9ce3b-e6e5-4b05-bf7f-0b3a5f74910a@linaro.org> Date: Wed, 22 Nov 2023 09:05:04 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] docs: dt-bindings: add DTS Coding Style document Content-Language: en-US To: =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Cc: Andrew Davis , Arnd Bergmann , Bjorn Andersson , Geert Uytterhoeven , Heiko Stuebner , Konrad Dybcio , Michal Simek , Neil Armstrong , Nishanth Menon , Olof Johansson , linux-rockchip@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org References: <20231120084044.23838-1-krzysztof.kozlowski@linaro.org> <6b288a2e-d147-4bd3-b1d4-daf56295d939@gmail.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 Hg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23v5QvN00m6G9NFF0Le D2GYIS41Kv4Isx2dEFh+/Q== In-Reply-To: <6b288a2e-d147-4bd3-b1d4-daf56295d939@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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]); Wed, 22 Nov 2023 00:07:20 -0800 (PST) On 21/11/2023 14:50, Rafał Miłecki wrote: >> +Order of Nodes >> +-------------- >> + >> +1. Nodes within any bus, thus using unit addresses for children, shall be >> + ordered incrementally by unit address. >> + Alternatively for some sub-architectures, nodes of the same type can be >> + grouped together (e.g. all I2C controllers one after another even if this >> + breaks unit address ordering). >> + >> +2. Nodes without unit addresses should be ordered alpha-numerically by the node >> + name. For a few types of nodes, they can be ordered by the main property >> + (e.g. pin configuration states ordered by value of "pins" property). >> + >> +3. When extending nodes in the board DTS via &label, the entries should be >> + ordered alpha-numerically. > > Just an idea. Would that make (more) sense to make &label-like entries > match order of nodes in included .dts(i)? > > Adventages: > 1. We keep unit address incremental order that is unlikely to change > > Disadventages: > 1. More difficult to verify Rob also proposed this and I believe above disadvantage here is crucial. If you add new SoC with board DTS you are fine. But if you add only new board, the order of entries look random in the diff hunk. Reviewer must open SoC DTSI to be able to review the patch with board DTS. If review is tricky and we do not have tool to perform it automatically, I am sure submissions will have disordered board DTS. > > >> +Example:: >> + >> + // SoC DTSI >> + >> + / { >> + cpus { >> + // ... >> + }; >> + >> + psci { >> + // ... >> + }; >> + >> + soc@ { >> + dma: dma-controller@10000 { >> + // ... >> + }; >> + >> + clk: clock-controller@80000 { >> + // ... >> + }; >> + }; >> + }; >> + >> + // Board DTS >> + >> + &clk { >> + // ... >> + }; >> + >> + &dma { >> + // ... >> + }; >> + >> + >> +Order of Properties in Device Node >> +---------------------------------- >> + >> +Following order of properties in device nodes is preferred: >> + >> +1. compatible >> +2. reg >> +3. ranges >> +4. Standard/common properties (defined by common bindings, e.g. without >> + vendor-prefixes) >> +5. Vendor-specific properties >> +6. status (if applicable) >> +7. Child nodes, where each node is preceded with a blank line >> + >> +The "status" property is by default "okay", thus it can be omitted. > > I think it would really help to include position of #address-cells and > #size-cells here. In some files I saw them above "compatible" that seems > unintuitive. Some prefer putting them at end which I think makes sense > as they affect children nodes. > > Whatever you choose it'd be just nice to have things consistent. This is a standard/common property, thus it goes to (4) above. Best regards, Krzysztof