[v4,1/5] dt-bindings: watchdog: mt7621-wdt: add phandle to access system controller registers
Message ID | 20230211073357.755893-2-sergio.paracuellos@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1381690wrn; Fri, 10 Feb 2023 23:42:32 -0800 (PST) X-Google-Smtp-Source: AK7set8OULbv9jj8G3szb4ClGHQHCkb1KlyICrcmBBQUm339hfOvglF3PPMGI3V3a/OZnj2U3GVm X-Received: by 2002:a17:906:704f:b0:878:955e:b4a4 with SMTP id r15-20020a170906704f00b00878955eb4a4mr17920851ejj.33.1676101352634; Fri, 10 Feb 2023 23:42:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676101352; cv=none; d=google.com; s=arc-20160816; b=Dk/MtmQ+qkD1lJ+x5ayJ7ugZnSFwmbiPtZKlN/N0d0onY/ZMR+Uv7j9XFK1ykkS5B+ FeoV1yqaSHZ2uQJtFlmNV98UXLLpqpPavzkubcyZmf4WAV/Xf2mGcKNTUwwtbcThuFPU sIkUq1ou0XSAcXkX/a3og9iN6uxDwb/0NSDCSYnQGyDS6O0MlXn6CacManJ0veeyC0D9 00Hm0XI71TvFmYFardKVprF/gkNIgsCvUZ3+g2v/b2G6a/PLYrpBzyGiaqJkiQhxeVmy Gaf+u/9hNcvWTcMIvuLhutSVfcEDnQPYsfHms4ffiC5lBW5mOGL0L3B16A7/AEN+Yxsk 1Z1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BnXrkD6mC1X9wvYtsECorUK6F5CsiEFkvfTGl5Os3Dw=; b=ovjPFV6FV43qIgx5K89lQ7ZIiClxu8EG+HYnbnHfcbbk1fh0FzrXHAJSwQjpYr3pkk 9Jntu7ledV6LgXjEr3Ac6Dde7/G0ZXHt4vP9RX6iBjUfa7YhbEQh4z7jUmbxsCKsBaJI vYPNeDa7XbgQ1YKOel4e468xQ/F97R0F6m1S83X+ZZIm0V3MUMqr2PECssLNBId8DVHP ILWf6aoXF8PynXrODyiJBE46yPZOJO0kfuRRrR1Gpv1YQgNlcYr1D6FhEWBliHkosdqB /mEJBGDrbTEba9RJZpJRv05nyJNgCMa1qQqqc0Qm3nADV1phQGvL0vk2Qe/KCmgXH4nM RA5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=g8wJsblo; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gj32-20020a170907742000b0086d4912935csi6747914ejc.267.2023.02.10.23.42.10; Fri, 10 Feb 2023 23:42: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=@gmail.com header.s=20210112 header.b=g8wJsblo; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229645AbjBKHeI (ORCPT <rfc822;ybw1215001957@gmail.com> + 99 others); Sat, 11 Feb 2023 02:34:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229596AbjBKHeF (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 11 Feb 2023 02:34:05 -0500 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47FBE1D906; Fri, 10 Feb 2023 23:34:03 -0800 (PST) Received: by mail-wm1-x32c.google.com with SMTP id z13so5384785wmp.2; Fri, 10 Feb 2023 23:34:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BnXrkD6mC1X9wvYtsECorUK6F5CsiEFkvfTGl5Os3Dw=; b=g8wJsbloOWG7ZeCFfvDC4383nh4NdFa3ZV7kJJmeo+jb051yTKZP7+54FvsEucq023 tYHL6cVpiS+GN/i1dQnXVZu7jsrKME9xAgRIsBDW+NM4nHzTO4RQVSxewGuKwHcqetaq FQUjW1nFdE6sTG+vzoR2OFJkfY4ng+7KGwtqfp2oUHeLnUcrQgr31ea14fv4iXv8AS4L KBHcKiEIqN5eAMAngE+whyYbLLmS0a3HRWJokWg5Yq1XiCVhX1UKRpANjwu5wbdC3Ggo vhaHAB95WoXzUFtnLX4VENts0NuyIEpvWaKXIpDo3QixfMJmDT6Oc9glwBK33B9KJ7HP pMNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BnXrkD6mC1X9wvYtsECorUK6F5CsiEFkvfTGl5Os3Dw=; b=HPFbxsvIPyD0l5pN67Xgk+tLT9Fk5hq13EVs/x+PLqZNgbccA79jijrwo3rlu3ZUAn 5lrko5Y9fIuiLOnK+3XNjlh3413NQ9n1rZSKoBU3i+KwVSczl271ViEY4is1b2aw7GVL k3OOeiiEel0iayZOXqHCMHo/6sr5JASsYj7bt1ZKy8lzM+ZUa28MPI38wexSyC0n5La6 WR8LQJW2truZktOE61KiKMb9zwJWffNAriBFXCL2RFV5tX5iMe9UNEi36PV5fpaZcqKg 9cspFupduFN7pJNzrK1GrBYvlgHOAcZhvW4FHNMqYVWWhXw+YrMgaj/mUo09BU7jdEZa j6dQ== X-Gm-Message-State: AO0yUKWfP17kZmml/ZyY2k+u0wEklx8i5HRGTTACyLNHJMaQiqPRuPI3 +Iej17IGW2QBIWui8FvMI76va3Hn+rQ= X-Received: by 2002:a05:600c:44c9:b0:3df:f9e9:7600 with SMTP id f9-20020a05600c44c900b003dff9e97600mr14775977wmo.25.1676100841458; Fri, 10 Feb 2023 23:34:01 -0800 (PST) Received: from localhost.localdomain (23.red-88-10-60.dynamicip.rima-tde.net. [88.10.60.23]) by smtp.gmail.com with ESMTPSA id j23-20020a05600c1c1700b003daf681d05dsm7917829wms.26.2023.02.10.23.34.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Feb 2023 23:34:01 -0800 (PST) From: Sergio Paracuellos <sergio.paracuellos@gmail.com> To: linux-watchdog@vger.kernel.org Cc: wim@linux-watchdog.org, linux@roeck-us.net, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, matthias.bgg@gmail.com, arinc.unal@arinc9.com, tsbogend@alpha.franken.de, p.zabel@pengutronix.de, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-mips@vger.kernel.org Subject: [PATCH v4 1/5] dt-bindings: watchdog: mt7621-wdt: add phandle to access system controller registers Date: Sat, 11 Feb 2023 08:33:53 +0100 Message-Id: <20230211073357.755893-2-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230211073357.755893-1-sergio.paracuellos@gmail.com> References: <20230211073357.755893-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757519652130650624?= X-GMAIL-MSGID: =?utf-8?q?1757519652130650624?= |
Series |
watchdog: mt7621-wdt: avoid globals and arch dependencies
|
|
Commit Message
Sergio Paracuellos
Feb. 11, 2023, 7:33 a.m. UTC
MT7621 SoC provides a system controller node for accessing to some registers.
Add a phandle in this node to avoid using MIPS related arch operations and
includes in watchdog driver code.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
.../devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml | 7 +++++++
1 file changed, 7 insertions(+)
Comments
Is this mediatek,sysctl property required after your changes on the watchdog code? Arınç On 11.02.2023 10:33, Sergio Paracuellos wrote: > MT7621 SoC provides a system controller node for accessing to some registers. > Add a phandle in this node to avoid using MIPS related arch operations and > includes in watchdog driver code. > > Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> > --- > .../devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml b/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml > index b2b17fdf4..a668d0c2f 100644 > --- a/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml > +++ b/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml > @@ -19,6 +19,12 @@ properties: > reg: > maxItems: 1 > > + mediatek,sysctl: > + $ref: /schemas/types.yaml#/definitions/phandle > + description: > + phandle to system controller 'sysc' syscon node which > + controls system registers > + > required: > - compatible > - reg > @@ -30,4 +36,5 @@ examples: > watchdog@100 { > compatible = "mediatek,mt7621-wdt"; > reg = <0x100 0x100>; > + mediatek,sysctl = <&sysc>; > };
On Sat, Feb 11, 2023 at 10:10 AM Arınç ÜNAL <arinc.unal@arinc9.com> wrote: > > Is this mediatek,sysctl property required after your changes on the > watchdog code? I don't really understand the question :-) Yes, it is. Since we have introduced a new phandle in the watchdog node to be able to access the reset status register through the 'sysc' syscon node. We need the bindings to be aligned with the mt7621.dtsi file and we are getting the syscon regmap handler via 'syscon_regmap_lookup_by_phandle()'. See PATCH 5 of the series, Arınç. Thanks, Sergio Paracuellos > > Arınç > > On 11.02.2023 10:33, Sergio Paracuellos wrote: > > MT7621 SoC provides a system controller node for accessing to some registers. > > Add a phandle in this node to avoid using MIPS related arch operations and > > includes in watchdog driver code. > > > > Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> > > --- > > .../devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml | 7 +++++++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml b/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml > > index b2b17fdf4..a668d0c2f 100644 > > --- a/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml > > +++ b/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml > > @@ -19,6 +19,12 @@ properties: > > reg: > > maxItems: 1 > > > > + mediatek,sysctl: > > + $ref: /schemas/types.yaml#/definitions/phandle > > + description: > > + phandle to system controller 'sysc' syscon node which > > + controls system registers > > + > > required: > > - compatible > > - reg > > @@ -30,4 +36,5 @@ examples: > > watchdog@100 { > > compatible = "mediatek,mt7621-wdt"; > > reg = <0x100 0x100>; > > + mediatek,sysctl = <&sysc>; > > };
On 11.02.2023 13:41, Sergio Paracuellos wrote: > On Sat, Feb 11, 2023 at 10:10 AM Arınç ÜNAL <arinc.unal@arinc9.com> wrote: >> >> Is this mediatek,sysctl property required after your changes on the >> watchdog code? > > I don't really understand the question :-) Yes, it is. Since we have > introduced a new phandle in the watchdog node to be able to access the > reset status register through the 'sysc' syscon node. > We need the bindings to be aligned with the mt7621.dtsi file and we > are getting the syscon regmap handler via > 'syscon_regmap_lookup_by_phandle()'. See PATCH 5 of the series, Arınç. I believe you need to put mediatek,sysctl under "required:". Arınç
On Sat, Feb 11, 2023 at 11:47 AM Arınç ÜNAL <arinc.unal@arinc9.com> wrote: > > On 11.02.2023 13:41, Sergio Paracuellos wrote: > > On Sat, Feb 11, 2023 at 10:10 AM Arınç ÜNAL <arinc.unal@arinc9.com> wrote: > >> > >> Is this mediatek,sysctl property required after your changes on the > >> watchdog code? > > > > I don't really understand the question :-) Yes, it is. Since we have > > introduced a new phandle in the watchdog node to be able to access the > > reset status register through the 'sysc' syscon node. > > We need the bindings to be aligned with the mt7621.dtsi file and we > > are getting the syscon regmap handler via > > 'syscon_regmap_lookup_by_phandle()'. See PATCH 5 of the series, Arınç. > > I believe you need to put mediatek,sysctl under "required:". Ah, I understood your question now :-). You meant 'required' property. I need more coffee, I guess :-). I am not sure if you can add properties as required after bindings are already mainlined for compatibility issues. The problem with this SoC is that drivers become mainlined before the device tree was so if things are properly fixed now this kind of issues appear. Let's see Krzysztof and Rob comments for this. Thanks, Sergio Paracuellos > > Arınç
On 11/02/2023 12:01, Sergio Paracuellos wrote: > On Sat, Feb 11, 2023 at 11:47 AM Arınç ÜNAL <arinc.unal@arinc9.com> wrote: >> >> On 11.02.2023 13:41, Sergio Paracuellos wrote: >>> On Sat, Feb 11, 2023 at 10:10 AM Arınç ÜNAL <arinc.unal@arinc9.com> wrote: >>>> >>>> Is this mediatek,sysctl property required after your changes on the >>>> watchdog code? >>> >>> I don't really understand the question :-) Yes, it is. Since we have >>> introduced a new phandle in the watchdog node to be able to access the >>> reset status register through the 'sysc' syscon node. >>> We need the bindings to be aligned with the mt7621.dtsi file and we >>> are getting the syscon regmap handler via >>> 'syscon_regmap_lookup_by_phandle()'. See PATCH 5 of the series, Arınç. >> >> I believe you need to put mediatek,sysctl under "required:". > > Ah, I understood your question now :-). You meant 'required' property. > I need more coffee, I guess :-). I am not sure if you can add > properties as required after bindings are already mainlined for > compatibility issues. The problem with this SoC is that drivers become > mainlined before the device tree was so if things are properly fixed > now this kind of issues appear. Let's see Krzysztof and Rob comments > for this. If your driver fails to probe without mediatek,sysctl, you already made it required (thus broke the ABI) regardless what dt-binding is saying. In such case you should update dt-binding to reflect reality. Now ABI break is different case. Usually you should not break it without valid reasons (e.g. it was never working before). Your commit msg suggests that you only improve the code, thus ABI break is not really justified. In such case - binding is correct, driver should be reworked to accept DTS without the new property. Best regards, Krzysztof
On 11/02/2023 08:33, Sergio Paracuellos wrote: > MT7621 SoC provides a system controller node for accessing to some registers. > Add a phandle in this node to avoid using MIPS related arch operations and > includes in watchdog driver code. > > Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> > --- Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Best regards, Krzysztof
On Sat, Feb 11, 2023 at 12:42 PM Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > > On 11/02/2023 12:01, Sergio Paracuellos wrote: > > On Sat, Feb 11, 2023 at 11:47 AM Arınç ÜNAL <arinc.unal@arinc9.com> wrote: > >> > >> On 11.02.2023 13:41, Sergio Paracuellos wrote: > >>> On Sat, Feb 11, 2023 at 10:10 AM Arınç ÜNAL <arinc.unal@arinc9.com> wrote: > >>>> > >>>> Is this mediatek,sysctl property required after your changes on the > >>>> watchdog code? > >>> > >>> I don't really understand the question :-) Yes, it is. Since we have > >>> introduced a new phandle in the watchdog node to be able to access the > >>> reset status register through the 'sysc' syscon node. > >>> We need the bindings to be aligned with the mt7621.dtsi file and we > >>> are getting the syscon regmap handler via > >>> 'syscon_regmap_lookup_by_phandle()'. See PATCH 5 of the series, Arınç. > >> > >> I believe you need to put mediatek,sysctl under "required:". > > > > Ah, I understood your question now :-). You meant 'required' property. > > I need more coffee, I guess :-). I am not sure if you can add > > properties as required after bindings are already mainlined for > > compatibility issues. The problem with this SoC is that drivers become > > mainlined before the device tree was so if things are properly fixed > > now this kind of issues appear. Let's see Krzysztof and Rob comments > > for this. > > If your driver fails to probe without mediatek,sysctl, you already made > it required (thus broke the ABI) regardless what dt-binding is saying. > In such case you should update dt-binding to reflect reality. > > Now ABI break is different case. Usually you should not break it without > valid reasons (e.g. it was never working before). Your commit msg > suggests that you only improve the code, thus ABI break is not really > justified. In such case - binding is correct, driver should be reworked > to accept DTS without the new property. Thanks for clarification, Krzysztof. Ok, so if this is the case I need to add this property required (as Arinc was properly pointing out in previous mail) since without it the driver is going to fail on probe (PATCH 5 of the series). I understand the "it was never working before" argument reason for ABI breaks. What happens if the old driver code was not ideal and totally dependent on architecture specific operations when this could be totally avoided and properly make arch independent agnostic drivers? This driver was added in 2016 [0]. There was not a device tree file in the kernel for this SoC mainlined until 2022 [1]. I also personally migrated this watchdog binding in 2022 from text to YAML and maintained it without changes [2]. When this was mainlined not all drivers were properly reviewed and the current code was just maintained as it is. Most users of this SoC are in the openWRT community where the dtsi of the mainline is not used yet and they maintain their own mt7621.dtsi files. Also, when a new version of the openWRT selected kernel is added they also modify and align with its mt7621.dtsi file without maintaining previous dtb's. If "make the driver arch independent to be able to be compile tested" and this kind of arguments are not valid at all I need to know because I have started to review driver code for this SoC and other drivers also have the same arch dependency that ideally should be avoided in the same way. This at the end means to break the ABI again in the future for those drivers / bindings. So I can just let them be as it is and not provide any change at all and continue without being compile tested and other beneficial features to detect future driver breakage. Thanks in advance for clarification. Best regards, Sergio Paracuellos [0]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/watchdog/mt7621_wdt.c?id=ab3f09fe16d158cb4f84e558c61ec5d6d601f2e0 [1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/mips/boot/dts/ralink/mt7621.dtsi?id=7a6ee0bbab2551d7189ce0f5e625fef4d612ebea [2]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml?id=9023e05b7a5809593a7ea09896eee0bbb6ae1685 > > Best regards, > Krzysztof >
On 2/12/23 00:13, Sergio Paracuellos wrote: > On Sat, Feb 11, 2023 at 12:42 PM Krzysztof Kozlowski > <krzysztof.kozlowski@linaro.org> wrote: >> >> On 11/02/2023 12:01, Sergio Paracuellos wrote: >>> On Sat, Feb 11, 2023 at 11:47 AM Arınç ÜNAL <arinc.unal@arinc9.com> wrote: >>>> >>>> On 11.02.2023 13:41, Sergio Paracuellos wrote: >>>>> On Sat, Feb 11, 2023 at 10:10 AM Arınç ÜNAL <arinc.unal@arinc9.com> wrote: >>>>>> >>>>>> Is this mediatek,sysctl property required after your changes on the >>>>>> watchdog code? >>>>> >>>>> I don't really understand the question :-) Yes, it is. Since we have >>>>> introduced a new phandle in the watchdog node to be able to access the >>>>> reset status register through the 'sysc' syscon node. >>>>> We need the bindings to be aligned with the mt7621.dtsi file and we >>>>> are getting the syscon regmap handler via >>>>> 'syscon_regmap_lookup_by_phandle()'. See PATCH 5 of the series, Arınç. >>>> >>>> I believe you need to put mediatek,sysctl under "required:". >>> >>> Ah, I understood your question now :-). You meant 'required' property. >>> I need more coffee, I guess :-). I am not sure if you can add >>> properties as required after bindings are already mainlined for >>> compatibility issues. The problem with this SoC is that drivers become >>> mainlined before the device tree was so if things are properly fixed >>> now this kind of issues appear. Let's see Krzysztof and Rob comments >>> for this. >> >> If your driver fails to probe without mediatek,sysctl, you already made >> it required (thus broke the ABI) regardless what dt-binding is saying. >> In such case you should update dt-binding to reflect reality. >> >> Now ABI break is different case. Usually you should not break it without >> valid reasons (e.g. it was never working before). Your commit msg >> suggests that you only improve the code, thus ABI break is not really >> justified. In such case - binding is correct, driver should be reworked >> to accept DTS without the new property. > > Thanks for clarification, Krzysztof. Ok, so if this is the case I need > to add this property required (as Arinc was properly pointing out in > previous mail) since without it the driver is going to fail on probe > (PATCH 5 of the series). I understand the "it was never working > before" argument reason for ABI breaks. What happens if the old driver > code was not ideal and totally dependent on architecture specific > operations when this could be totally avoided and properly make arch > independent agnostic drivers? This driver was added in 2016 [0]. There > was not a device tree file in the kernel for this SoC mainlined until > 2022 [1]. I also personally migrated this watchdog binding in 2022 > from text to YAML and maintained it without changes [2]. When this was > mainlined not all drivers were properly reviewed and the current code > was just maintained as it is. Most users of this SoC are in the > openWRT community where the dtsi of the mainline is not used yet and > they maintain their own mt7621.dtsi files. Also, when a new version of > the openWRT selected kernel is added they also modify and align with > its mt7621.dtsi file without maintaining previous dtb's. If "make the > driver arch independent to be able to be compile tested" and this kind > of arguments are not valid at all I need to know because I have > started to review driver code for this SoC and other drivers also have > the same arch dependency that ideally should be avoided in the same > way. This at the end means to break the ABI again in the future for > those drivers / bindings. So I can just let them be as it is and not > provide any change at all and continue without being compile tested > and other beneficial features to detect future driver breakage. > Problem is that there are (presumably) shipped systems out there with the old devicetree file. The watchdog driver would no longer instantiate on those systems. Guenter
On 12/02/2023 09:13, Sergio Paracuellos wrote: > On Sat, Feb 11, 2023 at 12:42 PM Krzysztof Kozlowski > <krzysztof.kozlowski@linaro.org> wrote: >> >> On 11/02/2023 12:01, Sergio Paracuellos wrote: >>> On Sat, Feb 11, 2023 at 11:47 AM Arınç ÜNAL <arinc.unal@arinc9.com> wrote: >>>> >>>> On 11.02.2023 13:41, Sergio Paracuellos wrote: >>>>> On Sat, Feb 11, 2023 at 10:10 AM Arınç ÜNAL <arinc.unal@arinc9.com> wrote: >>>>>> >>>>>> Is this mediatek,sysctl property required after your changes on the >>>>>> watchdog code? >>>>> >>>>> I don't really understand the question :-) Yes, it is. Since we have >>>>> introduced a new phandle in the watchdog node to be able to access the >>>>> reset status register through the 'sysc' syscon node. >>>>> We need the bindings to be aligned with the mt7621.dtsi file and we >>>>> are getting the syscon regmap handler via >>>>> 'syscon_regmap_lookup_by_phandle()'. See PATCH 5 of the series, Arınç. >>>> >>>> I believe you need to put mediatek,sysctl under "required:". >>> >>> Ah, I understood your question now :-). You meant 'required' property. >>> I need more coffee, I guess :-). I am not sure if you can add >>> properties as required after bindings are already mainlined for >>> compatibility issues. The problem with this SoC is that drivers become >>> mainlined before the device tree was so if things are properly fixed >>> now this kind of issues appear. Let's see Krzysztof and Rob comments >>> for this. >> >> If your driver fails to probe without mediatek,sysctl, you already made >> it required (thus broke the ABI) regardless what dt-binding is saying. >> In such case you should update dt-binding to reflect reality. >> >> Now ABI break is different case. Usually you should not break it without >> valid reasons (e.g. it was never working before). Your commit msg >> suggests that you only improve the code, thus ABI break is not really >> justified. In such case - binding is correct, driver should be reworked >> to accept DTS without the new property. > > Thanks for clarification, Krzysztof. Ok, so if this is the case I need > to add this property required (as Arinc was properly pointing out in > previous mail) since without it the driver is going to fail on probe > (PATCH 5 of the series). I understand the "it was never working > before" argument reason for ABI breaks. What happens if the old driver > code was not ideal and totally dependent on architecture specific > operations when this could be totally avoided and properly make arch > independent agnostic drivers? It's just an improvement and improvements should be incremental and not break ABI. > This driver was added in 2016 [0]. There > was not a device tree file in the kernel for this SoC mainlined until > 2022 [1]. 2022 march was almost a year ago, so there were kernel releases with this ABI. Also, what about all out of tree DTS? What about other operating systems, bootloaders, firmwares etc? Best regards, Krzysztof
On Mon, Feb 13, 2023 at 9:38 AM Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > > On 12/02/2023 09:13, Sergio Paracuellos wrote: > > On Sat, Feb 11, 2023 at 12:42 PM Krzysztof Kozlowski > > <krzysztof.kozlowski@linaro.org> wrote: > >> > >> On 11/02/2023 12:01, Sergio Paracuellos wrote: > >>> On Sat, Feb 11, 2023 at 11:47 AM Arınç ÜNAL <arinc.unal@arinc9.com> wrote: > >>>> > >>>> On 11.02.2023 13:41, Sergio Paracuellos wrote: > >>>>> On Sat, Feb 11, 2023 at 10:10 AM Arınç ÜNAL <arinc.unal@arinc9.com> wrote: > >>>>>> > >>>>>> Is this mediatek,sysctl property required after your changes on the > >>>>>> watchdog code? > >>>>> > >>>>> I don't really understand the question :-) Yes, it is. Since we have > >>>>> introduced a new phandle in the watchdog node to be able to access the > >>>>> reset status register through the 'sysc' syscon node. > >>>>> We need the bindings to be aligned with the mt7621.dtsi file and we > >>>>> are getting the syscon regmap handler via > >>>>> 'syscon_regmap_lookup_by_phandle()'. See PATCH 5 of the series, Arınç. > >>>> > >>>> I believe you need to put mediatek,sysctl under "required:". > >>> > >>> Ah, I understood your question now :-). You meant 'required' property. > >>> I need more coffee, I guess :-). I am not sure if you can add > >>> properties as required after bindings are already mainlined for > >>> compatibility issues. The problem with this SoC is that drivers become > >>> mainlined before the device tree was so if things are properly fixed > >>> now this kind of issues appear. Let's see Krzysztof and Rob comments > >>> for this. > >> > >> If your driver fails to probe without mediatek,sysctl, you already made > >> it required (thus broke the ABI) regardless what dt-binding is saying. > >> In such case you should update dt-binding to reflect reality. > >> > >> Now ABI break is different case. Usually you should not break it without > >> valid reasons (e.g. it was never working before). Your commit msg > >> suggests that you only improve the code, thus ABI break is not really > >> justified. In such case - binding is correct, driver should be reworked > >> to accept DTS without the new property. > > > > Thanks for clarification, Krzysztof. Ok, so if this is the case I need > > to add this property required (as Arinc was properly pointing out in > > previous mail) since without it the driver is going to fail on probe > > (PATCH 5 of the series). I understand the "it was never working > > before" argument reason for ABI breaks. What happens if the old driver > > code was not ideal and totally dependent on architecture specific > > operations when this could be totally avoided and properly make arch > > independent agnostic drivers? > > It's just an improvement and improvements should be incremental and not > break ABI. Understood. > > > This driver was added in 2016 [0]. There > > was not a device tree file in the kernel for this SoC mainlined until > > 2022 [1]. > > 2022 march was almost a year ago, so there were kernel releases with > this ABI. > > Also, what about all out of tree DTS? What about other operating > systems, bootloaders, firmwares etc? Pretty clear, thanks. So I guess I have to drop all the changes that are breaking ABI and just maintain those that make no real changes in bindings. > > > Best regards, > Krzysztof Thanks, Sergio Paracuellos >
On Sun, Feb 12, 2023 at 4:27 PM Guenter Roeck <linux@roeck-us.net> wrote: > > On 2/12/23 00:13, Sergio Paracuellos wrote: > > On Sat, Feb 11, 2023 at 12:42 PM Krzysztof Kozlowski > > <krzysztof.kozlowski@linaro.org> wrote: > >> > >> On 11/02/2023 12:01, Sergio Paracuellos wrote: > >>> On Sat, Feb 11, 2023 at 11:47 AM Arınç ÜNAL <arinc.unal@arinc9.com> wrote: > >>>> > >>>> On 11.02.2023 13:41, Sergio Paracuellos wrote: > >>>>> On Sat, Feb 11, 2023 at 10:10 AM Arınç ÜNAL <arinc.unal@arinc9.com> wrote: > >>>>>> > >>>>>> Is this mediatek,sysctl property required after your changes on the > >>>>>> watchdog code? > >>>>> > >>>>> I don't really understand the question :-) Yes, it is. Since we have > >>>>> introduced a new phandle in the watchdog node to be able to access the > >>>>> reset status register through the 'sysc' syscon node. > >>>>> We need the bindings to be aligned with the mt7621.dtsi file and we > >>>>> are getting the syscon regmap handler via > >>>>> 'syscon_regmap_lookup_by_phandle()'. See PATCH 5 of the series, Arınç. > >>>> > >>>> I believe you need to put mediatek,sysctl under "required:". > >>> > >>> Ah, I understood your question now :-). You meant 'required' property. > >>> I need more coffee, I guess :-). I am not sure if you can add > >>> properties as required after bindings are already mainlined for > >>> compatibility issues. The problem with this SoC is that drivers become > >>> mainlined before the device tree was so if things are properly fixed > >>> now this kind of issues appear. Let's see Krzysztof and Rob comments > >>> for this. > >> > >> If your driver fails to probe without mediatek,sysctl, you already made > >> it required (thus broke the ABI) regardless what dt-binding is saying. > >> In such case you should update dt-binding to reflect reality. > >> > >> Now ABI break is different case. Usually you should not break it without > >> valid reasons (e.g. it was never working before). Your commit msg > >> suggests that you only improve the code, thus ABI break is not really > >> justified. In such case - binding is correct, driver should be reworked > >> to accept DTS without the new property. > > > > Thanks for clarification, Krzysztof. Ok, so if this is the case I need > > to add this property required (as Arinc was properly pointing out in > > previous mail) since without it the driver is going to fail on probe > > (PATCH 5 of the series). I understand the "it was never working > > before" argument reason for ABI breaks. What happens if the old driver > > code was not ideal and totally dependent on architecture specific > > operations when this could be totally avoided and properly make arch > > independent agnostic drivers? This driver was added in 2016 [0]. There > > was not a device tree file in the kernel for this SoC mainlined until > > 2022 [1]. I also personally migrated this watchdog binding in 2022 > > from text to YAML and maintained it without changes [2]. When this was > > mainlined not all drivers were properly reviewed and the current code > > was just maintained as it is. Most users of this SoC are in the > > openWRT community where the dtsi of the mainline is not used yet and > > they maintain their own mt7621.dtsi files. Also, when a new version of > > the openWRT selected kernel is added they also modify and align with > > its mt7621.dtsi file without maintaining previous dtb's. If "make the > > driver arch independent to be able to be compile tested" and this kind > > of arguments are not valid at all I need to know because I have > > started to review driver code for this SoC and other drivers also have > > the same arch dependency that ideally should be avoided in the same > > way. This at the end means to break the ABI again in the future for > > those drivers / bindings. So I can just let them be as it is and not > > provide any change at all and continue without being compile tested > > and other beneficial features to detect future driver breakage. > > > > Problem is that there are (presumably) shipped systems out there with > the old devicetree file. The watchdog driver would no longer instantiate > on those systems. Ok, I will maintain only the PATCH that changes the driver to not use globals and send v5. > > Guenter > Thanks, Sergio Paracuellos
On Mon, Feb 13, 2023 at 09:59:35AM +0100, Sergio Paracuellos wrote: > On Sun, Feb 12, 2023 at 4:27 PM Guenter Roeck <linux@roeck-us.net> wrote: > > > > On 2/12/23 00:13, Sergio Paracuellos wrote: > > > On Sat, Feb 11, 2023 at 12:42 PM Krzysztof Kozlowski > > > <krzysztof.kozlowski@linaro.org> wrote: > > >> > > >> On 11/02/2023 12:01, Sergio Paracuellos wrote: > > >>> On Sat, Feb 11, 2023 at 11:47 AM Arınç ÜNAL <arinc.unal@arinc9.com> wrote: > > >>>> > > >>>> On 11.02.2023 13:41, Sergio Paracuellos wrote: > > >>>>> On Sat, Feb 11, 2023 at 10:10 AM Arınç ÜNAL <arinc.unal@arinc9.com> wrote: > > >>>>>> > > >>>>>> Is this mediatek,sysctl property required after your changes on the > > >>>>>> watchdog code? > > >>>>> > > >>>>> I don't really understand the question :-) Yes, it is. Since we have > > >>>>> introduced a new phandle in the watchdog node to be able to access the > > >>>>> reset status register through the 'sysc' syscon node. > > >>>>> We need the bindings to be aligned with the mt7621.dtsi file and we > > >>>>> are getting the syscon regmap handler via > > >>>>> 'syscon_regmap_lookup_by_phandle()'. See PATCH 5 of the series, Arınç. > > >>>> > > >>>> I believe you need to put mediatek,sysctl under "required:". > > >>> > > >>> Ah, I understood your question now :-). You meant 'required' property. > > >>> I need more coffee, I guess :-). I am not sure if you can add > > >>> properties as required after bindings are already mainlined for > > >>> compatibility issues. The problem with this SoC is that drivers become > > >>> mainlined before the device tree was so if things are properly fixed > > >>> now this kind of issues appear. Let's see Krzysztof and Rob comments > > >>> for this. > > >> > > >> If your driver fails to probe without mediatek,sysctl, you already made > > >> it required (thus broke the ABI) regardless what dt-binding is saying. > > >> In such case you should update dt-binding to reflect reality. > > >> > > >> Now ABI break is different case. Usually you should not break it without > > >> valid reasons (e.g. it was never working before). Your commit msg > > >> suggests that you only improve the code, thus ABI break is not really > > >> justified. In such case - binding is correct, driver should be reworked > > >> to accept DTS without the new property. > > > > > > Thanks for clarification, Krzysztof. Ok, so if this is the case I need > > > to add this property required (as Arinc was properly pointing out in > > > previous mail) since without it the driver is going to fail on probe > > > (PATCH 5 of the series). I understand the "it was never working > > > before" argument reason for ABI breaks. What happens if the old driver > > > code was not ideal and totally dependent on architecture specific > > > operations when this could be totally avoided and properly make arch > > > independent agnostic drivers? This driver was added in 2016 [0]. There > > > was not a device tree file in the kernel for this SoC mainlined until > > > 2022 [1]. I also personally migrated this watchdog binding in 2022 > > > from text to YAML and maintained it without changes [2]. When this was > > > mainlined not all drivers were properly reviewed and the current code > > > was just maintained as it is. Most users of this SoC are in the > > > openWRT community where the dtsi of the mainline is not used yet and > > > they maintain their own mt7621.dtsi files. Also, when a new version of > > > the openWRT selected kernel is added they also modify and align with > > > its mt7621.dtsi file without maintaining previous dtb's. If "make the > > > driver arch independent to be able to be compile tested" and this kind > > > of arguments are not valid at all I need to know because I have > > > started to review driver code for this SoC and other drivers also have > > > the same arch dependency that ideally should be avoided in the same > > > way. This at the end means to break the ABI again in the future for > > > those drivers / bindings. So I can just let them be as it is and not > > > provide any change at all and continue without being compile tested > > > and other beneficial features to detect future driver breakage. > > > > > > > Problem is that there are (presumably) shipped systems out there with > > the old devicetree file. The watchdog driver would no longer instantiate > > on those systems. > > Ok, I will maintain only the PATCH that changes the driver to not use > globals and send v5. > Other options might be to search for the "syscon" node name or to search for the "mediatek,mt7621-sysc" compatible. Guenter > > > > Guenter > > > > Thanks, > Sergio Paracuellos
On Mon, Feb 13, 2023 at 8:36 PM Guenter Roeck <linux@roeck-us.net> wrote: > > On Mon, Feb 13, 2023 at 09:59:35AM +0100, Sergio Paracuellos wrote: > > On Sun, Feb 12, 2023 at 4:27 PM Guenter Roeck <linux@roeck-us.net> wrote: > > > > > > On 2/12/23 00:13, Sergio Paracuellos wrote: > > > > On Sat, Feb 11, 2023 at 12:42 PM Krzysztof Kozlowski > > > > <krzysztof.kozlowski@linaro.org> wrote: > > > >> > > > >> On 11/02/2023 12:01, Sergio Paracuellos wrote: > > > >>> On Sat, Feb 11, 2023 at 11:47 AM Arınç ÜNAL <arinc.unal@arinc9.com> wrote: > > > >>>> > > > >>>> On 11.02.2023 13:41, Sergio Paracuellos wrote: > > > >>>>> On Sat, Feb 11, 2023 at 10:10 AM Arınç ÜNAL <arinc.unal@arinc9.com> wrote: > > > >>>>>> > > > >>>>>> Is this mediatek,sysctl property required after your changes on the > > > >>>>>> watchdog code? > > > >>>>> > > > >>>>> I don't really understand the question :-) Yes, it is. Since we have > > > >>>>> introduced a new phandle in the watchdog node to be able to access the > > > >>>>> reset status register through the 'sysc' syscon node. > > > >>>>> We need the bindings to be aligned with the mt7621.dtsi file and we > > > >>>>> are getting the syscon regmap handler via > > > >>>>> 'syscon_regmap_lookup_by_phandle()'. See PATCH 5 of the series, Arınç. > > > >>>> > > > >>>> I believe you need to put mediatek,sysctl under "required:". > > > >>> > > > >>> Ah, I understood your question now :-). You meant 'required' property. > > > >>> I need more coffee, I guess :-). I am not sure if you can add > > > >>> properties as required after bindings are already mainlined for > > > >>> compatibility issues. The problem with this SoC is that drivers become > > > >>> mainlined before the device tree was so if things are properly fixed > > > >>> now this kind of issues appear. Let's see Krzysztof and Rob comments > > > >>> for this. > > > >> > > > >> If your driver fails to probe without mediatek,sysctl, you already made > > > >> it required (thus broke the ABI) regardless what dt-binding is saying. > > > >> In such case you should update dt-binding to reflect reality. > > > >> > > > >> Now ABI break is different case. Usually you should not break it without > > > >> valid reasons (e.g. it was never working before). Your commit msg > > > >> suggests that you only improve the code, thus ABI break is not really > > > >> justified. In such case - binding is correct, driver should be reworked > > > >> to accept DTS without the new property. > > > > > > > > Thanks for clarification, Krzysztof. Ok, so if this is the case I need > > > > to add this property required (as Arinc was properly pointing out in > > > > previous mail) since without it the driver is going to fail on probe > > > > (PATCH 5 of the series). I understand the "it was never working > > > > before" argument reason for ABI breaks. What happens if the old driver > > > > code was not ideal and totally dependent on architecture specific > > > > operations when this could be totally avoided and properly make arch > > > > independent agnostic drivers? This driver was added in 2016 [0]. There > > > > was not a device tree file in the kernel for this SoC mainlined until > > > > 2022 [1]. I also personally migrated this watchdog binding in 2022 > > > > from text to YAML and maintained it without changes [2]. When this was > > > > mainlined not all drivers were properly reviewed and the current code > > > > was just maintained as it is. Most users of this SoC are in the > > > > openWRT community where the dtsi of the mainline is not used yet and > > > > they maintain their own mt7621.dtsi files. Also, when a new version of > > > > the openWRT selected kernel is added they also modify and align with > > > > its mt7621.dtsi file without maintaining previous dtb's. If "make the > > > > driver arch independent to be able to be compile tested" and this kind > > > > of arguments are not valid at all I need to know because I have > > > > started to review driver code for this SoC and other drivers also have > > > > the same arch dependency that ideally should be avoided in the same > > > > way. This at the end means to break the ABI again in the future for > > > > those drivers / bindings. So I can just let them be as it is and not > > > > provide any change at all and continue without being compile tested > > > > and other beneficial features to detect future driver breakage. > > > > > > > > > > Problem is that there are (presumably) shipped systems out there with > > > the old devicetree file. The watchdog driver would no longer instantiate > > > on those systems. > > > > Ok, I will maintain only the PATCH that changes the driver to not use > > globals and send v5. > > > > Other options might be to search for the "syscon" node name or to search > for the "mediatek,mt7621-sysc" compatible. Thanks for the hint. I didn't know about 'syscon_regmap_lookup_by_compatible()'. I will use this to avoid DTB ABI breakage and allow the driver to be selected for COMPILE_TEST.. Thanks, Guenter. Best regards, Sergio Paracuellos > > Guenter > > > > > > > Guenter > > > > > > > Thanks, > > Sergio Paracuellos
On 2/13/23 11:57, Sergio Paracuellos wrote: > On Mon, Feb 13, 2023 at 8:36 PM Guenter Roeck <linux@roeck-us.net> wrote: >> >> On Mon, Feb 13, 2023 at 09:59:35AM +0100, Sergio Paracuellos wrote: >>> On Sun, Feb 12, 2023 at 4:27 PM Guenter Roeck <linux@roeck-us.net> wrote: >>>> >>>> On 2/12/23 00:13, Sergio Paracuellos wrote: >>>>> On Sat, Feb 11, 2023 at 12:42 PM Krzysztof Kozlowski >>>>> <krzysztof.kozlowski@linaro.org> wrote: >>>>>> >>>>>> On 11/02/2023 12:01, Sergio Paracuellos wrote: >>>>>>> On Sat, Feb 11, 2023 at 11:47 AM Arınç ÜNAL <arinc.unal@arinc9.com> wrote: >>>>>>>> >>>>>>>> On 11.02.2023 13:41, Sergio Paracuellos wrote: >>>>>>>>> On Sat, Feb 11, 2023 at 10:10 AM Arınç ÜNAL <arinc.unal@arinc9.com> wrote: >>>>>>>>>> >>>>>>>>>> Is this mediatek,sysctl property required after your changes on the >>>>>>>>>> watchdog code? >>>>>>>>> >>>>>>>>> I don't really understand the question :-) Yes, it is. Since we have >>>>>>>>> introduced a new phandle in the watchdog node to be able to access the >>>>>>>>> reset status register through the 'sysc' syscon node. >>>>>>>>> We need the bindings to be aligned with the mt7621.dtsi file and we >>>>>>>>> are getting the syscon regmap handler via >>>>>>>>> 'syscon_regmap_lookup_by_phandle()'. See PATCH 5 of the series, Arınç. >>>>>>>> >>>>>>>> I believe you need to put mediatek,sysctl under "required:". >>>>>>> >>>>>>> Ah, I understood your question now :-). You meant 'required' property. >>>>>>> I need more coffee, I guess :-). I am not sure if you can add >>>>>>> properties as required after bindings are already mainlined for >>>>>>> compatibility issues. The problem with this SoC is that drivers become >>>>>>> mainlined before the device tree was so if things are properly fixed >>>>>>> now this kind of issues appear. Let's see Krzysztof and Rob comments >>>>>>> for this. >>>>>> >>>>>> If your driver fails to probe without mediatek,sysctl, you already made >>>>>> it required (thus broke the ABI) regardless what dt-binding is saying. >>>>>> In such case you should update dt-binding to reflect reality. >>>>>> >>>>>> Now ABI break is different case. Usually you should not break it without >>>>>> valid reasons (e.g. it was never working before). Your commit msg >>>>>> suggests that you only improve the code, thus ABI break is not really >>>>>> justified. In such case - binding is correct, driver should be reworked >>>>>> to accept DTS without the new property. >>>>> >>>>> Thanks for clarification, Krzysztof. Ok, so if this is the case I need >>>>> to add this property required (as Arinc was properly pointing out in >>>>> previous mail) since without it the driver is going to fail on probe >>>>> (PATCH 5 of the series). I understand the "it was never working >>>>> before" argument reason for ABI breaks. What happens if the old driver >>>>> code was not ideal and totally dependent on architecture specific >>>>> operations when this could be totally avoided and properly make arch >>>>> independent agnostic drivers? This driver was added in 2016 [0]. There >>>>> was not a device tree file in the kernel for this SoC mainlined until >>>>> 2022 [1]. I also personally migrated this watchdog binding in 2022 >>>>> from text to YAML and maintained it without changes [2]. When this was >>>>> mainlined not all drivers were properly reviewed and the current code >>>>> was just maintained as it is. Most users of this SoC are in the >>>>> openWRT community where the dtsi of the mainline is not used yet and >>>>> they maintain their own mt7621.dtsi files. Also, when a new version of >>>>> the openWRT selected kernel is added they also modify and align with >>>>> its mt7621.dtsi file without maintaining previous dtb's. If "make the >>>>> driver arch independent to be able to be compile tested" and this kind >>>>> of arguments are not valid at all I need to know because I have >>>>> started to review driver code for this SoC and other drivers also have >>>>> the same arch dependency that ideally should be avoided in the same >>>>> way. This at the end means to break the ABI again in the future for >>>>> those drivers / bindings. So I can just let them be as it is and not >>>>> provide any change at all and continue without being compile tested >>>>> and other beneficial features to detect future driver breakage. >>>>> >>>> >>>> Problem is that there are (presumably) shipped systems out there with >>>> the old devicetree file. The watchdog driver would no longer instantiate >>>> on those systems. >>> >>> Ok, I will maintain only the PATCH that changes the driver to not use >>> globals and send v5. >>> >> >> Other options might be to search for the "syscon" node name or to search >> for the "mediatek,mt7621-sysc" compatible. > > Thanks for the hint. I didn't know about > 'syscon_regmap_lookup_by_compatible()'. I will use this to avoid DTB > ABI breakage and allow the driver to be selected for COMPILE_TEST.. > I didn't know about that one either. I thought about of_find_compatible_node() or of_find_node_by_name(). syscon_regmap_lookup_by_compatible() is widely used, though, so it seems to be a much better option. Thanks, Guenter
diff --git a/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml b/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml index b2b17fdf4..a668d0c2f 100644 --- a/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml +++ b/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml @@ -19,6 +19,12 @@ properties: reg: maxItems: 1 + mediatek,sysctl: + $ref: /schemas/types.yaml#/definitions/phandle + description: + phandle to system controller 'sysc' syscon node which + controls system registers + required: - compatible - reg @@ -30,4 +36,5 @@ examples: watchdog@100 { compatible = "mediatek,mt7621-wdt"; reg = <0x100 0x100>; + mediatek,sysctl = <&sysc>; };