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 7E0E0C4332F for ; Fri, 5 Nov 2021 20:39:13 +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 652D560FBF for ; Fri, 5 Nov 2021 20:39:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 652D560FBF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=canonical.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 B3B278331E; Fri, 5 Nov 2021 21:39:09 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.b="mxlwJqhn"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1D34B8296F; Fri, 5 Nov 2021 21:39:08 +0100 (CET) Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7362083726 for ; Fri, 5 Nov 2021 21:38:55 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=heinrich.schuchardt@canonical.com Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 99B3B3F4BC for ; Fri, 5 Nov 2021 20:38:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1636144732; bh=YzMuNog8pOx7sYMAiIOfD+UU6QvEykpdB6XvNrROjJc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=mxlwJqhn74V8ohLnv6/YcPqZ8pBF2ts2L65Hua/REE4RnKwbZj1RP4fdQ/3QTjR5w vS+6ou0vLae3MDgfJHA6NO3S6TajXe4oM+5cuA8WVAW80dKGkIW/N8eA+be0lY1Gip zN0QZH0ATmoxUo8+qwC9w/xOExTJyQQq2oy9e8Ccn7RAC9D+YTWMB/7oHQblKaA+t9 R5c8jAcJET/dTjxvBXo1W2/BuZCXDhNUQweEMqnEIGGXLHHiOCpaevwuKjUC0bNXlT FEMnH7L039w2anvBY/ugTxv8rGn4GM03NpxRSMRafwqU4FhhwUaIkoC12EDVuolgba oYNFlPF4cc3sw== Received: by mail-wm1-f71.google.com with SMTP id 128-20020a1c0486000000b0030dcd45476aso3803938wme.0 for ; Fri, 05 Nov 2021 13:38:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=YzMuNog8pOx7sYMAiIOfD+UU6QvEykpdB6XvNrROjJc=; b=b+PyPDR3J1qMCshs/M14bfGiI9if0nxEE9sucb+mxiFz9H2Mlb8C8+MhATlCnzP0vH /OqaR0gHeNuLfvztAypATy6Tvk2iZnhmPD9hmJQNwOcxMG48NRDvceCIE9veQeaFGPc7 ukc+0IPQJ0hFmH5B0YYEd2JJ7SUOPY8rIXg4GXQ/kjgExUBR7ty0Mo2UHyT1XUSWQYHq qqsqPFHS8bA3SB0bw48dQdaE3LsKI/E1Kw+PbiHnQNVULhBgefAAYcW4IFmcwc3cGO3U chBbHZNyx9aTEjeYpBDeyncTlyH6KCGossQ1lE4Rje3C2zaQYC/Dn0P447mz/VcNdZSF cOEw== X-Gm-Message-State: AOAM532ANvfphe0E8yfQkr8Gp8Z0Lsj03YJCwYEZU0MHSAiH7uIcQrGp YB+Q8J97QYovi8KOOAVS/LeKntsLo+1dKVkKJfseolfSDU8IK6k/7tr/f9Tu2TnZrbwfYc8sas3 i1ojJ/IqbSK2WFTDpeTWDIkVI10TJJ+M= X-Received: by 2002:a7b:c303:: with SMTP id k3mr33801676wmj.44.1636144732070; Fri, 05 Nov 2021 13:38:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzS35sQZUPD/07VcVLPjsF5Kz2BhMgitbhWsXJr5iN5i68CTylEG8Aq/Fs8+1RsUTGwZ+k4nA== X-Received: by 2002:a7b:c303:: with SMTP id k3mr33801637wmj.44.1636144731766; Fri, 05 Nov 2021 13:38:51 -0700 (PDT) Received: from [192.168.123.55] (ip-88-152-144-157.hsi03.unitymediagroup.de. [88.152.144.157]) by smtp.gmail.com with ESMTPSA id h17sm11738605wmb.44.2021.11.05.13.38.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 Nov 2021 13:38:51 -0700 (PDT) Message-ID: Date: Fri, 5 Nov 2021 21:38:50 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Subject: Re: [PATCH v3 0/6] Improved sysreset/watchdog uclass integration Content-Language: en-US To: Tom Rini Cc: Samuel Holland , Andre Przywara , Stefan Roese , Harald Seiler , u-boot@lists.denx.de, Jagan Teki , Bin Meng , Sean Anderson , Simon Glass References: <20211104035516.28268-1-samuel@sholland.org> <70136684-120e-925c-3709-576885d4bd17@denx.de> <20211104231140.4e2ad7f5@slackpad.fritz.box> <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> From: Heinrich Schuchardt In-Reply-To: <20211105191735.GW24579@bill-the-cat> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 On 11/5/21 20:17, Tom Rini wrote: > On Fri, Nov 05, 2021 at 07:37:02PM +0100, Heinrich Schuchardt wrote: >> On 11/5/21 17:12, Simon Glass wrote: >>> Hi, >>> >>> On Fri, 5 Nov 2021 at 08:21, Tom Rini wrote: >>>> >>>> On Fri, Nov 05, 2021 at 12:14:47PM +0100, Stefan Roese wrote: >>>>> Hi Andre, >>>>> >>>>> Added Tom to Cc. >>>>> >>>>> On 05.11.21 11:04, Andre Przywara wrote: >>>>>> On Thu, 4 Nov 2021 20:02:41 -0600 >>>>>> Simon Glass wrote: >>>>>> >>>>>> Hi, >>>>>> >>>>>>> On Thu, 4 Nov 2021 at 19:22, Stefan Roese wrote: >>>>>>>> >>>>>>>> Hi Andre, >>>>>>>> >>>>>>>> On 05.11.21 00:11, Andre Przywara wrote: >>>>>>>>> On Thu, 4 Nov 2021 11:37:57 +0100 >>>>>>>>> Stefan Roese wrote: >>>>>>>>> >>>>>>>>> Hi Stefan, >>>>>>>>>> On 04.11.21 04:55, Samuel Holland wrote: >>>>>>>>>>> This series hooks up the watchdog uclass to automatically register >>>>>>>>>>> watchdog devices for use with sysreset, doing a bit of minor cleanup >>>>>>>>>>> along the way. >>>>>>>>>>> >>>>>>>>>>> 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 references the watchdog >>>>>>>>>>> device by phandle. This is problematic for us, because sunxi-u-boot.dtsi >>>>>>>>>>> file covers 20 different SoCs with varying watchdog node phandle names. >>>>>>>>>>> So it would have required adding a -u-boot.dtsi file for each board. >>>>>>>>>>> >>>>>>>>>>> Hooking things up automatically makes sense to me; this is what Linux >>>>>>>>>>> does. However, I put the code behind a new option to avoid surprises for >>>>>>>>>>> other platforms. >>>>>>>>>>> >>>>>>>>>>> Changes in v3: >>>>>>>>>>> - Move condition to wdt-uclass.c to fix build errors. >>>>>>>>>>> - Include watchdog name in error message. >>>>>>>>>>> >>>>>>>>>>> Changes in v2: >>>>>>>>>>> - Extend the "if SYSRESET" block to the end of the file. >>>>>>>>>>> - Also make gpio_reboot_probe function static. >>>>>>>>>>> - Rebase on top of 492ee6b8d0e7 (now handle all watchdogs). >>>>>>>>>>> - Added patches 5-6 as an example of how the new option will be used. >>>>>>>>>>> >>>>>>>>>>> Samuel Holland (6): >>>>>>>>>>> sysreset: Add uclass Kconfig dependency to drivers >>>>>>>>>>> sysreset: Mark driver probe functions as static >>>>>>>>>>> sysreset: watchdog: Move watchdog reference to plat data >>>>>>>>>>> watchdog: Automatically register device with sysreset >>>>>>>>>>> sunxi: Avoid duplicate reset_cpu with SYSRESET enabled >>>>>>>>>>> sunxi: Use sysreset framework for poweroff/reset >>>>>>>>>>> >>>>>>>>>>> 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 deletions(-) >>>>>>>>>> >>>>>>>>>> Applied to u-boot-marvell >>>>>>>>> >>>>>>>>> Mmmh, why u-boot-marvell, >>>>>>>> >>>>>>>> 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. >>>> >>>> And fwiw, there's a few other cases like this. If it's too confusing, >>>> maybe we should just roll out a few more repositories, I think it's >>>> easier to do that now than pre-gitlab? >>>> >>>>>>>>> and why did this end up already in master? >>>>>>>>> Isn't that material for the next merge window? After all this changes >>>>>>>>> quite a bit, for a lot of boards, and I did not have a closer look at >>>>>>>>> the sunxi parts yet. >>>>>>>> >>>>>>>> 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 have enough time to >>>>>>>> fix any resulting problems in this release cycle. >>>>>> >>>>>> Why do we have the merge window then? This is clearly not a regression or >>>>>> general fix. >>>>> >>>>> AFAIU, we are a bit less strict here in U-Boot. Patches that were posted >>>>> before the merge-window and skipped the review process (most likely >>>>> because of lack of time) are often still integrated in the early rcX >>>>> cycles. At least this is how I handle it usually. >>>>> >>>>> Tom, is my understanding here correct? >>>> >>>> Yes. We are not as strict as the kernel is about what can come in >>>> between rc1 and rc2 (and to a certain degree, post rc2). I leave 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 flexible in >>>> picking things up. >>>> >>>>>>> Yes I agree, that should be plenty of time for people to review it. >>>>>> >>>>>> 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 really doesn't >>>>>> change, add or fix anything, it's mere refactoring, from the user's point >>>>>> of view. >>>>>> >>>>>>>> Do you see any specific issues? >>>>>> >>>>>> Patch 6/6 changes the config for all 157 Allwinner boards, so I think that >>>>>> deserves at least some testing, *before* merging it. >>>>> >>>>> I expect that Samuel did some testing. But still, I agree that it >>>>> would be much better, if these patches - especially the Allwinner parts >>>>> got more extensive testing. >>>>> >>>>>> I will do as much testing now as possible, but I am not happy about that >>>>>> situation. >>>>> >>>>> Understood. Should we revert patch 6/6 for now? >>>> >>>> FWIW, given Samuel has been doing a number of allwinner changes, 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 overall changes, >>>> just figured it was a few more ready-to-go cleanups that weren't quite >>>> picked up in time. Please do speak up if you want me to revert the last >>>> part. >>> >>> Also it is often true that people find problems by testing on master >>> so applying it helps to shake the tree a bit. >>> >>> Regards, >>> Simon >>> >> >> We don't actually have a problem with this series but with a previous >> watchdog patch. The culprit according to bisecting is: >> >> b147bd3607f8 ("sunxi: Enable watchdog timer support by default") >> >> When booting the OrangePi PC the watchdog triggers while Linux is booting, >> ca. 16 s after leaving the UEFI subsystem. This matches WDT_MAX_TIMEOUT in >> drivers/watchdog/sunxi_wdt.c. >> >> If I run >> >> => wdt dev watchdog@1c20ca0 >> => wdt stop >> >> before the bootefi command booting succeeds. >> >> We don't disarm the watchdog and Linux does not do it for us in time. >> >> The UEFI specification requires that the default watchdog reset time is 300 >> s. We should never arm the Sunxi hardware watchdog except within the >> watchdog reset driver. >> >> The solution is to disable CONFIG_WATCHDOG_AUTOSTART on SUNXI. See >> >> [PATCH 1/1] watchdog: don't autostart watchdog on Sunxi boards >> https://lists.denx.de/pipermail/u-boot/2021-November/466318.html > > This means we never did come up with a satisfactory to everyone solution > to what UEFI thinks a watchdog should do, and what other types of > deployment think a watchdog should do, yes? > Dear Tom, The issue is *not* UEFI specific. A watchdog timeout of 16 seconds is too short for Linux to boot no matter whether you use the EFI stub or the legacy entry point. I only referred to the UEFI specification as it indicates what can be considered as a reasonable timeout interval: 300 seconds. Best regards Heinrich