Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 383A1C433EF for ; Sat, 6 Nov 2021 13:52:50 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0333160F39 for ; Sat, 6 Nov 2021 13:52:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0333160F39 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A35578343E; Sat, 6 Nov 2021 14:52:46 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="Bhtmm1Dc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4A17D8331E; Sat, 6 Nov 2021 14:52:45 +0100 (CET) Received: from mail-qv1-xf34.google.com (mail-qv1-xf34.google.com [IPv6:2607:f8b0:4864:20::f34]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 5DF2E83689 for ; Sat, 6 Nov 2021 14:52:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qv1-xf34.google.com with SMTP id gu12so1660979qvb.6 for ; Sat, 06 Nov 2021 06:52:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=efekXxnn3ztO8e/Iqq8O9XarEk6XG6vUdYEIUX+sOBI=; b=Bhtmm1DcKSC1TfNzlKqJhuFhPy7ZAgsVbIw+J2gK/QIu01Zk2Rdik4Zmom+fWkTbWY 55k/XLBt7P4p/dS8T0QgYprKNCXZ+bkJvdfzWKVi15T2TfVryozZdakiJSrMNTGOx/UU XQyjPuEMxUmjakIXVFrNNWChijVXmuCYa0CVE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=efekXxnn3ztO8e/Iqq8O9XarEk6XG6vUdYEIUX+sOBI=; b=IML8fYYHIebj81KJfucFDu5KjakStn7wsresFwTD2v2b90RIt6bl7JZnlcDkoctO7q Y4pZynaOi0pgLo7hl+wTRjTsUXb5rolleV8h7Dzg+syQvYY0KJW3Lab9aMv3cuBDh8zz 7wFZSWFwNelKqOibLcac4Kxt/+MXTzpATpneRhzEv3+mOxZLWXE+fbkBDFQwOi/c3Coj SNlsGAOpVNpWc6nP121GXtj2uqAYHRlcoa9uLGG2f6mM+SlkE1COJ8POilC2JX8PMgEa ccTkpSCZg83b+ipaZcpeEyjSqYMv0qJx/Du9/Mn4nqBjiTqFeevzZjNH0lPGSm12wBdG sAlw== X-Gm-Message-State: AOAM531t73Grywx7N7sDOidrtxABG7Vp7uTWB1j4Ni3LAXzzd6BcKj4+ DG8Lkr1F2ETeL/e4yv4GBknC6g== X-Google-Smtp-Source: ABdhPJz6mt8N6S8jI0+C9YUqvdKEYSRzsJKhAHwf9wWxyOare+ATe1gLWuVgS6yIkZZXMYLvjXG6pQ== X-Received: by 2002:ad4:5cc3:: with SMTP id iu3mr45037803qvb.4.1636206753658; Sat, 06 Nov 2021 06:52:33 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-dcf7-3600-6b4c-294c.res6.spectrum.com. [2603:6081:7b01:cbda:dcf7:3600:6b4c:294c]) by smtp.gmail.com with ESMTPSA id g5sm802968qtb.96.2021.11.06.06.52.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Nov 2021 06:52:33 -0700 (PDT) Date: Sat, 6 Nov 2021 09:52:30 -0400 From: Tom Rini To: Andre Przywara Cc: Heinrich Schuchardt , Samuel Holland , Stefan Roese , Harald Seiler , u-boot@lists.denx.de, Jagan Teki , Bin Meng , Sean Anderson , Simon Glass Subject: Re: [PATCH v3 0/6] Improved sysreset/watchdog uclass integration Message-ID: <20211106135230.GK24579@bill-the-cat> References: <20211105100419.617375a7@donnerap.cambridge.arm.com> <53ead8ab-bd0b-afff-b738-c92366080333@denx.de> <20211105142120.GS24579@bill-the-cat> <9562b6e2-73d1-09c6-5c1e-fcecade5d0fb@canonical.com> <20211105191735.GW24579@bill-the-cat> <20211105225634.GJ24579@bill-the-cat> <20211106015230.1d1895cf@slackpad.fritz.box> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="WYylHziOXMe5vjz8" Content-Disposition: inline In-Reply-To: <20211106015230.1d1895cf@slackpad.fritz.box> X-Clacks-Overhead: GNU Terry Pratchett X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean --WYylHziOXMe5vjz8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 06, 2021 at 01:52:30AM +0000, Andre Przywara wrote: > On Fri, 5 Nov 2021 18:56:34 -0400 > Tom Rini wrote: >=20 > > On Fri, Nov 05, 2021 at 09:38:50PM +0100, Heinrich Schuchardt wrote: > > > On 11/5/21 20:17, Tom Rini wrote: =20 > > > > On Fri, Nov 05, 2021 at 07:37:02PM +0100, Heinrich Schuchardt wrote= : =20 > > > > > On 11/5/21 17:12, Simon Glass wrote: =20 > > > > > > Hi, > > > > > >=20 > > > > > > On Fri, 5 Nov 2021 at 08:21, Tom Rini wrot= e: =20 > > > > > > >=20 > > > > > > > On Fri, Nov 05, 2021 at 12:14:47PM +0100, Stefan Roese wrote:= =20 > > > > > > > > Hi Andre, > > > > > > > >=20 > > > > > > > > Added Tom to Cc. > > > > > > > >=20 > > > > > > > > On 05.11.21 11:04, Andre Przywara wrote: =20 > > > > > > > > > On Thu, 4 Nov 2021 20:02:41 -0600 > > > > > > > > > Simon Glass wrote: > > > > > > > > >=20 > > > > > > > > > Hi, > > > > > > > > > =20 > > > > > > > > > > On Thu, 4 Nov 2021 at 19:22, Stefan Roese = wrote: =20 > > > > > > > > > > >=20 > > > > > > > > > > > Hi Andre, > > > > > > > > > > >=20 > > > > > > > > > > > On 05.11.21 00:11, Andre Przywara wrote: =20 > > > > > > > > > > > > On Thu, 4 Nov 2021 11:37:57 +0100 > > > > > > > > > > > > Stefan Roese wrote: > > > > > > > > > > > >=20 > > > > > > > > > > > > Hi Stefan, =20 > > > > > > > > > > > > > On 04.11.21 04:55, Samuel Holland wrote: =20 > > > > > > > > > > > > > > This series hooks up the watchdog uclass to aut= omatically register > > > > > > > > > > > > > > watchdog devices for use with sysreset, doing a= bit of minor cleanup > > > > > > > > > > > > > > along the way. > > > > > > > > > > > > > >=20 > > > > > > > > > > > > > > The goal is for this to replace the sunxi board= -level non-DM reset_cpu() > > > > > > > > > > > > > > function. I was surprised to find that the wdt_= reboot driver requires > > > > > > > > > > > > > > its own undocumented device tree node, which re= ferences the watchdog > > > > > > > > > > > > > > device by phandle. This is problematic for us, = because sunxi-u-boot.dtsi > > > > > > > > > > > > > > file covers 20 different SoCs with varying watc= hdog node phandle names. > > > > > > > > > > > > > > So it would have required adding a -u-boot.dtsi= file for each board. > > > > > > > > > > > > > >=20 > > > > > > > > > > > > > > Hooking things up automatically makes sense to = me; this is what Linux > > > > > > > > > > > > > > does. However, I put the code behind a new opti= on to avoid surprises for > > > > > > > > > > > > > > other platforms. > > > > > > > > > > > > > >=20 > > > > > > > > > > > > > > Changes in v3: > > > > > > > > > > > > > > - Move condition to wdt-uclass.c to fix b= uild errors. > > > > > > > > > > > > > > - Include watchdog name in error message. > > > > > > > > > > > > > >=20 > > > > > > > > > > > > > > Changes in v2: > > > > > > > > > > > > > > - Extend the "if SYSRESET" block to the e= nd of the file. > > > > > > > > > > > > > > - Also make gpio_reboot_probe function st= atic. > > > > > > > > > > > > > > - Rebase on top of 492ee6b8d0e7 (now hand= le all watchdogs). > > > > > > > > > > > > > > - Added patches 5-6 as an example of how = the new option will be used. > > > > > > > > > > > > > >=20 > > > > > > > > > > > > > > Samuel Holland (6): > > > > > > > > > > > > > > sysreset: Add uclass Kconfig dependency = to drivers > > > > > > > > > > > > > > sysreset: Mark driver probe functions as= static > > > > > > > > > > > > > > sysreset: watchdog: Move watchdog refere= nce to plat data > > > > > > > > > > > > > > watchdog: Automatically register device = with sysreset > > > > > > > > > > > > > > sunxi: Avoid duplicate reset_cpu with SY= SRESET enabled > > > > > > > > > > > > > > sunxi: Use sysreset framework for powero= ff/reset > > > > > > > > > > > > > >=20 > > > > > > > > > > > > > > arch/arm/Kconfig | 3= +++ > > > > > > > > > > > > > > arch/arm/mach-sunxi/board.c | 2= ++ > > > > > > > > > > > > > > drivers/sysreset/Kconfig | 11= ++++++-- > > > > > > > > > > > > > > drivers/sysreset/sysreset_gpio.c | 2= +- > > > > > > > > > > > > > > drivers/sysreset/sysreset_resetctl.c | 2= +- > > > > > > > > > > > > > > drivers/sysreset/sysreset_syscon.c | 2= +- > > > > > > > > > > > > > > drivers/sysreset/sysreset_watchdog.c | 40= ++++++++++++++++++++++------ > > > > > > > > > > > > > > drivers/watchdog/wdt-uclass.c | 8= ++++++ > > > > > > > > > > > > > > include/sysreset.h | 10= +++++++ > > > > > > > > > > > > > > 9 files changed, 67 insertions(+), 13 del= etions(-) =20 > > > > > > > > > > > > >=20 > > > > > > > > > > > > > Applied to u-boot-marvell =20 > > > > > > > > > > > >=20 > > > > > > > > > > > > Mmmh, why u-boot-marvell, =20 > > > > > > > > > > >=20 > > > > > > > > > > > Because I'm handling watchdog related changed since a= few years and we > > > > > > > > > > > did not create a specific subsystem repo for this and= I'm usually > > > > > > > > > > > using my "marvell" one for this. =20 > > > > > > >=20 > > > > > > > And fwiw, there's a few other cases like this. If it's too c= onfusing, > > > > > > > maybe we should just roll out a few more repositories, I thin= k it's > > > > > > > easier to do that now than pre-gitlab? > > > > > > > =20 > > > > > > > > > > > > and why did this end up already in master? > > > > > > > > > > > > Isn't that material for the next merge window? Afte= r all this changes > > > > > > > > > > > > quite a bit, for a lot of boards, and I did not hav= e a closer look at > > > > > > > > > > > > the sunxi parts yet. =20 > > > > > > > > > > >=20 > > > > > > > > > > > I was hesitating also a bit. But since this patchset = is on the list in > > > > > > > > > > > v1 since over 2 months now (2021-08-21) I thought it = was "ready" for > > > > > > > > > > > inclusion now. We are at -rc1 and I think we still ha= ve enough time to > > > > > > > > > > > fix any resulting problems in this release cycle. =20 > > > > > > > > >=20 > > > > > > > > > Why do we have the merge window then? This is clearly not= a regression or > > > > > > > > > general fix. =20 > > > > > > > >=20 > > > > > > > > AFAIU, we are a bit less strict here in U-Boot. Patches tha= t were posted > > > > > > > > before the merge-window and skipped the review process (mos= t likely > > > > > > > > because of lack of time) are often still integrated in the = early rcX > > > > > > > > cycles. At least this is how I handle it usually. > > > > > > > >=20 > > > > > > > > Tom, is my understanding here correct? =20 > > > > > > >=20 > > > > > > > Yes. We are not as strict as the kernel is about what can co= me in > > > > > > > between rc1 and rc2 (and to a certain degree, post rc2). I l= eave things > > > > > > > up to the discretion of the custodians. People tend of have = less time > > > > > > > to handle U-Boot changes than other stuff, so I try and be fl= exible in > > > > > > > picking things up. > > > > > > > =20 > > > > > > > > > > Yes I agree, that should be plenty of time for people t= o review it. =20 > > > > > > > > >=20 > > > > > > > > > Well, if there would be people to review the sunxi parts = :-( > > > > > > > > > I am totally fine with the generic patches (as they have = been reviewed), > > > > > > > > > but the sunxi integration is somewhat risky. > > > > > > > > > I was explicitly deprioritising that in my queue, as it r= eally doesn't > > > > > > > > > change, add or fix anything, it's mere refactoring, from = the user's point > > > > > > > > > of view. > > > > > > > > > =20 > > > > > > > > > > > Do you see any specific issues? =20 > > > > > > > > >=20 > > > > > > > > > Patch 6/6 changes the config for all 157 Allwinner boards= , so I think that > > > > > > > > > deserves at least some testing, *before* merging it. =20 > > > > > > > >=20 > > > > > > > > I expect that Samuel did some testing. But still, I agree t= hat it > > > > > > > > would be much better, if these patches - especially the All= winner parts > > > > > > > > got more extensive testing. > > > > > > > > =20 > > > > > > > > > I will do as much testing now as possible, but I am not h= appy about that > > > > > > > > > situation. =20 > > > > > > > >=20 > > > > > > > > Understood. Should we revert patch 6/6 for now? =20 > > > > > > >=20 > > > > > > > FWIW, given Samuel has been doing a number of allwinner chang= es, I had > > > > > > > also assumed it was sufficiently tested, which is why I didn'= t raise a > > > > > > > further concern when I saw the widespread nature of the overa= ll changes, > > > > > > > just figured it was a few more ready-to-go cleanups that were= n't quite > > > > > > > picked up in time. Please do speak up if you want me to reve= rt the last > > > > > > > part. =20 > > > > > >=20 > > > > > > Also it is often true that people find problems by testing on m= aster > > > > > > so applying it helps to shake the tree a bit. > > > > > >=20 > > > > > > Regards, > > > > > > Simon > > > > > > =20 > > > > >=20 > > > > > We don't actually have a problem with this series but with a prev= ious > > > > > watchdog patch. The culprit according to bisecting is: > > > > >=20 > > > > > b147bd3607f8 ("sunxi: Enable watchdog timer support by default") > > > > >=20 > > > > > When booting the OrangePi PC the watchdog triggers while Linux is= booting, > > > > > ca. 16 s after leaving the UEFI subsystem. This matches WDT_MAX_T= IMEOUT in > > > > > drivers/watchdog/sunxi_wdt.c. > > > > >=20 > > > > > If I run > > > > > =20 > > > > > =3D> wdt dev watchdog@1c20ca0 > > > > > =3D> wdt stop =20 > > > > >=20 > > > > > before the bootefi command booting succeeds. > > > > >=20 > > > > > We don't disarm the watchdog and Linux does not do it for us in t= ime. > > > > >=20 > > > > > The UEFI specification requires that the default watchdog reset t= ime is 300 > > > > > s. We should never arm the Sunxi hardware watchdog except within = the > > > > > watchdog reset driver. > > > > >=20 > > > > > The solution is to disable CONFIG_WATCHDOG_AUTOSTART on SUNXI. See > > > > >=20 > > > > > [PATCH 1/1] watchdog: don't autostart watchdog on Sunxi boards > > > > > https://lists.denx.de/pipermail/u-boot/2021-November/466318.html = =20 > > > >=20 > > > > This means we never did come up with a satisfactory to everyone sol= ution > > > > to what UEFI thinks a watchdog should do, and what other types of > > > > deployment think a watchdog should do, yes? > > > > =20 > > >=20 > > > Dear Tom, > > >=20 > > > The issue is *not* UEFI specific. > > >=20 > > > A watchdog timeout of 16 seconds is too short for Linux to boot no ma= tter > > > whether you use the EFI stub or the legacy entry point. > > >=20 > > > I only referred to the UEFI specification as it indicates what can be > > > considered as a reasonable timeout interval: 300 seconds. =20 > >=20 > > 16 seconds from the last time we pet the watchdog in U-Boot to the > > kernel being able to take over is quite reasonable. >=20 > How do we know that the kernel takes over? What if the kernel/EFI > payload doesn't have a watchdog driver? I was assuming that the > watchdog would be disabled as soon as we boot a kernel or an EFI app > calls ExitBootServices (maybe even earlier). > But this sounds like a generic problem, not sunxi specific. So how do > other platforms solve this? It depends on the deployment situation. Heinrich has quoted absolutely correctly what the UEFI says and expects. Other deployment situations are going to demand that the watchdog reset the system if it can't be "petted" every few seconds and disabling the watchdog because we're now booting the kernel would be entirely unacceptable. How exactly other platforms solve this is either: - The kernel will also enable the watchdog driver and there is sufficient time between U-Boot and Kernel for the handover. - The watchdog is disabled in general because there's not enough time or distributions don't enable the watchdog driver. Getting on my soap box for a moment, it feels like we're seeing a shift =66rom the former in arm32 being the default to the latter in arm64 being the default. --=20 Tom --WYylHziOXMe5vjz8 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmGGiJsACgkQFHw5/5Y0 tywMBgv/VeE+QLVSAaZTssUTx1vC6IRNY/q7keFhKmCPYCLsVRhz3V0r/mXPc3lD hLQEz0DCXFk8ZUBbB2NFfkfuR3QKv5o51y/Z1fUp0KvapXXZg1lsj4/5N/I/DGCR zxUKKcDD8oq4LC1b6ipwPCroUFYJh/GVJ67QEJL0vGRP1ceISUZKCRhNeOL0R6bQ ndGvN07QJl7ZxIEXBb/Qx9C+NoaAhM3lE3P6Fb16pFjFC+5DfEkGzP4EXGV7Fi4a VBDpiKMg0H6rYfv8InfpBA7rgVcoShnJRG4QDe6m9YUeJVXy4+yjXXorCawOnIiR RPy6vYbxGUXB0HC0jjm1pM0EzTS0iRErrb5NT0IU4slEtiWCzKWenIvlNC2IL2X/ Lqnw8GNh0ZhvA0xYKIBIn+zeWQl+b5y3fqGq+vyveRXWCZ+yEfQk2182g8rAqDAt U9QKEF00bTxoyGMi+K3ROfEYhXgdb/F+QBsRKt/gvlKkQl+Imrdy3LBbKeViRjzC 6P9yMw3i =cHlK -----END PGP SIGNATURE----- --WYylHziOXMe5vjz8--