Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp4406167rwb; Mon, 16 Jan 2023 23:52:33 -0800 (PST) X-Google-Smtp-Source: AMrXdXtRusQRxQuAbLE+k4mfFIAdK71ceaxbm25CXyvh/qVS2DTfxJoXQMTcuwOm4k/rajdB935B X-Received: by 2002:aa7:8198:0:b0:586:a3a9:6163 with SMTP id g24-20020aa78198000000b00586a3a96163mr2376236pfi.28.1673941952879; Mon, 16 Jan 2023 23:52:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673941952; cv=none; d=google.com; s=arc-20160816; b=bVAym3PO+GC66/b/bbgKXUeXs2SVH82EY01HqWiJrSbzjlL5Xu1gFdzVyE+II2gwZl MT4UxBDNEE6fPYN6EbY3mNfsxYdKB8hWlA9pyfBbhNwHsFSxYlCOTLZCkg6QmzT7USMf W/nhWlkh3CJFxUJaO2s7i0FszIBs7rsNLuV6wnr/1w1PZ+jnJt18Lggk0M1DePnCuVd2 KdppTQ92qRDL4HAWrEMGlnt6gVl68agz/EUzq3RNWWHkVrv/ttX3W0AECudkl7jdXQKy Zej7pIbZekKesfMoVvU3wGIHFEoX39/LonXYM4orCPWOIXCmYML/sahby4Ln0fxWl3BL X4gQ== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=DMmc7/6yXt4mypmxVkgQDFhHLoHU+0OuLMviLqWVx+A=; b=Tk9uCBZB7F1GClrHxcivcTrG1b5wWeKQ9AYh2n4V/CqGayb/D7MN1F3zj3Neahh2zK N8Adxur5sv1terpBBDvCvNHWxqc64Q90PH2afndOO7G/v8FDiTLqLk7jCQl7mWunBBdG 9WmDXz/TOg51tV8/nTvz1+rbIB/VhZJfg6m8/U6xVzktCz4/qe10+bVqhPf9OQImexZp SvWonmpjZpTzqD5PkOIt/NwUoO8PVI/sckmK0NqXuNYMBlqSXq8Ys673fTTa45GDuJ+o RSo3dT/aV1JwfA9v0bcyoVoz7uyiPNsfow5j+IW11ruA5Ws1QZylES2rhdlrArRkRMTw gDfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JSyDCVbI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s6-20020a056a0008c600b00576dee77c98si34535272pfu.299.2023.01.16.23.52.26; Mon, 16 Jan 2023 23:52:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JSyDCVbI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235965AbjAQHqY (ORCPT + 49 others); Tue, 17 Jan 2023 02:46:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235947AbjAQHqL (ORCPT ); Tue, 17 Jan 2023 02:46:11 -0500 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FF4C7EE1 for ; Mon, 16 Jan 2023 23:46:10 -0800 (PST) Received: by mail-wr1-x429.google.com with SMTP id b7so3643966wrt.3 for ; Mon, 16 Jan 2023 23:46:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=DMmc7/6yXt4mypmxVkgQDFhHLoHU+0OuLMviLqWVx+A=; b=JSyDCVbIbjBQ1xD2ArsijWppzNSE86iMsxJQ+4itnbir88y3d9yVVcRwLsdC7oQ+cg UrPyDarZRi4gwrrFCg2blJJKaTO7lYAl2CLauthE9EjaLCz1ufELFDIuCRMYuvWWUe47 YLuySGp5G1jQiObp2sqR9c9NO/c7iLnkDbecmzXBO7Ag3Ay53v0bTcfJ7Y3BaXNJDoFI 3O/ZTWfGflEe1U446bWlySQ9XqmlefUQG4jfIPI9UEvravTyZsNu/vczsAaALblx4gq4 Ak1yaNfXziEuP3wB49E5afCS7aqst6+CBDIo1t4Q0iOK9LfYPhtA1tqcKx+G+S/+tVcN 9jVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to: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=DMmc7/6yXt4mypmxVkgQDFhHLoHU+0OuLMviLqWVx+A=; b=ULoHl0rCcVZ4Rp3o4GAPanXdcjDVT4S5/UjJ/2T0XkaMLREsNPUpIvSX1zTVXf36Ca a7UuCO0EP+S467+UI3KcwL04hOLzNsaWQVQSYqJCmZyFV6PRBlRHhofYN0gyyugtDSjf KJUAoSGlYs0XiUS2xRX8HZ7U6ud9BfZNMX6eilDKNKQb67+s2gQCQUK0wInTgfcRN6zU 0c0+2iJ0ZbRz7PUjxTV3N1qM+WWM4WvNyva21djzLFbtTZMpOnPfiM6gfxiEKwNLU5vA 8GvGBqnmWuIC8p9TkEmpsdfbjsKDHi9FrvcYDWId8PaxXrUolHuImAmvtMOUEZbhrko/ tYeg== X-Gm-Message-State: AFqh2kraSAnv8FqEM50XcwyfVEXm3b74HQcakY4ZkLObhoubLday9Kgx UYWiZkFbCh2tSHIZ9tL7p7I03g== X-Received: by 2002:adf:fa88:0:b0:2bd:d85f:55cc with SMTP id h8-20020adffa88000000b002bdd85f55ccmr1960711wrr.21.1673941568684; Mon, 16 Jan 2023 23:46:08 -0800 (PST) Received: from [192.168.1.109] ([178.197.216.144]) by smtp.gmail.com with ESMTPSA id i6-20020adfe486000000b002423dc3b1a9sm27630444wrm.52.2023.01.16.23.46.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 16 Jan 2023 23:46:08 -0800 (PST) Message-ID: <8ee5f6ef-80cb-2e0f-6681-598ccc697291@linaro.org> Date: Tue, 17 Jan 2023 08:46:05 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH v3 2/7] dt-bindings: net: snps,dwmac: Update the maxitems number of resets and reset-names Content-Language: en-US To: yanhong wang , linux-riscv@lists.infradead.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Emil Renner Berthing , Richard Cochran , Andrew Lunn , Heiner Kallweit , Peter Geis References: <20230106030001.1952-1-yanhong.wang@starfivetech.com> <20230106030001.1952-3-yanhong.wang@starfivetech.com> <2328562d-59a2-f60e-b17b-6cf16392e01f@linaro.org> <84e783a6-0aea-a6ba-13a0-fb29c66cc81a@starfivetech.com> From: Krzysztof Kozlowski In-Reply-To: <84e783a6-0aea-a6ba-13a0-fb29c66cc81a@starfivetech.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, 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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 17/01/2023 07:52, yanhong wang wrote: > > > On 2023/1/6 20:44, Krzysztof Kozlowski wrote: >> On 06/01/2023 03:59, Yanhong Wang wrote: >>> Some boards(such as StarFive VisionFive v2) require more than one value >>> which defined by resets property, so the original definition can not >>> meet the requirements. In order to adapt to different requirements, >>> adjust the maxitems number definition. >>> >>> Signed-off-by: Yanhong Wang >>> --- >>> .../devicetree/bindings/net/snps,dwmac.yaml | 36 ++++++++++++++----- >>> 1 file changed, 28 insertions(+), 8 deletions(-) >>> >>> diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml >>> index e26c3e76ebb7..f7693e8c8d6d 100644 >>> --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml >>> +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml >>> @@ -132,14 +132,6 @@ properties: >>> - pclk >>> - ptp_ref >>> >>> - resets: >>> - maxItems: 1 >>> - description: >>> - MAC Reset signal. >>> - >>> - reset-names: >>> - const: stmmaceth >>> - >>> power-domains: >>> maxItems: 1 >>> >>> @@ -463,6 +455,34 @@ allOf: >>> Enables the TSO feature otherwise it will be managed by >>> MAC HW capability register. >>> >>> + - if: >>> + properties: >>> + compatible: >>> + contains: >>> + const: starfive,jh7110-dwmac >>> + >> >> Looking at your next binding patch, this seems a bit clearer. First of >> all, this patch on itself has little sense. It's not usable on its own, >> because you need the next one. >> >> Probably the snps,dwmac should be just split into common parts used by >> devices. It makes code much less readable and unnecessary complicated to >> support in one schema both devices and re-usability. >> >> Otherwise I propose to make the resets/reset-names just like clocks are >> made: define here wide constraints and update all other users of this >> binding to explicitly restrict resets. >> >> > > Thanks, refer to the definition of clocks. If it is defined as follows, is it OK? > > properties: > resets: > minItems: 1 > maxItems: 3 > additionalItems: true Drop > items: > - description: MAC Reset signal. Drop both > > reset-names: > minItems: 1 > maxItems: 3 > additionalItems: true Drop > contains: > enum: > - stmmaceth Drop all > > > allOf: > - if: > properties: > compatible: > contains: > const: starfive,jh7110-dwmac > then: > properties: > resets: > minItems: 2 > maxItems: 2 > reset-names: > items: > - const: stmmaceth > - const: ahb > required: > - resets > - reset-names > else: > properties: > resets: > maxItems: 1 > description: > MAC Reset signal. > > reset-names: > const: stmmaceth > > Do you have any other better suggestions? More or less like this but the allOf should not be in snps,dwmac schema but in individual schemas. The snps,dwmac is growing unmaintainable... Best regards, Krzysztof