From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE3E8C07E96 for ; Thu, 15 Jul 2021 08:15:19 +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 2E04A610E5 for ; Thu, 15 Jul 2021 08:15:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2E04A610E5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6FBCB829B7; Thu, 15 Jul 2021 10:15:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1626336917; bh=0nA+dvxVauf83aYM4cOgcIEZX/CZegW/YSl3c5AGBy4=; h=Subject:To:Cc:References:From:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=qEdTBJhxJTGb5e3bCJpUlS3tvmvJOI0k+JX4Ahup+Ego7J+kivmHuDCHQJRHaMySS lZTdV/VxSdHO6PO6MNxduHOaNyGJNAmQVoBUpLiBxNNbp3zs1WFoT2puug0xhGso2S TFZTi77+5qh2D4mxdqZ23OxXblHCj0ViSFTBdRQavCL9LRWbqQEUYsPKQhMP0P1EOo 84iOU4PKmNV2d9EyusE4bLywjwGsJ7kCAAe05pibsvmtNq1fl3EeYa+a3psiqxlU6X RlPF9/5Wk/CnMzA4cf5YfjBkrvfe7zG9DeyC5HAEg+zATJAqzDIalDLpwtmd2SLBIo bLRVwZSc9f0Xw== Received: by phobos.denx.de (Postfix, from userid 109) id 6E34C829B7; Thu, 15 Jul 2021 10:15:15 +0200 (CEST) Received: from mout-u-107.mailbox.org (mout-u-107.mailbox.org [IPv6:2001:67c:2050:1::465:107]) (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 2A65D82916 for ; Thu, 15 Jul 2021 10:15:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sr@denx.de Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-107.mailbox.org (Postfix) with ESMTPS id 4GQRxq6qNHzQk6n; Thu, 15 Jul 2021 10:15:11 +0200 (CEST) Received: from smtp2.mailbox.org ([80.241.60.241]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id L9jb4eBL9PvS; Thu, 15 Jul 2021 10:15:08 +0200 (CEST) Subject: Re: [PATCH v3 07/10] watchdog: wdt-uclass.c: handle all DM watchdogs in watchdog_reset() To: Simon Glass , Rasmus Villemoes Cc: U-Boot Mailing List , Tom Rini References: <20210702124510.124401-1-rasmus.villemoes@prevas.dk> <20210702124510.124401-8-rasmus.villemoes@prevas.dk> From: Stefan Roese Message-ID: Date: Thu, 15 Jul 2021 10:15:08 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 7bit X-MBO-SPAM-Probability: * X-Rspamd-Score: 1.35 / 15.00 / 15.00 X-Rspamd-Queue-Id: 052CA1813 X-Rspamd-UID: f3c94f 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 Hi Rasmus, On 05.07.21 17:30, Simon Glass wrote: > Hi Rasmus, > > On Fri, 2 Jul 2021 at 06:45, Rasmus Villemoes > wrote: >> >> A board can have and make use of more than one watchdog device, say >> one built into the SOC and an external gpio-petted one. Having >> wdt-uclass only handle the first is both a little arbitrary and >> unexpected. >> >> So change initr_watchdog() so we visit (probe) all DM watchdog >> devices. This essentially boils down to making the init_watchdog_dev >> function into a .post_probe method. >> >> Similarly let watchdog_reset() loop over the whole uclass - each >> having their own ratelimiting metadata, and a separate "is this device >> running" flag. >> >> This gets rid of the watchdog_dev member of struct global_data. We >> do, however, still need the GD_FLG_WDT_READY set in >> initr_watchdog(). This is because watchdog_reset() can get called >> before DM is ready, and I don't think we can call uclass_get() that >> early. >> >> The current code just returns 0 if "getting" the first device fails - >> that can of course happen because there are no devices, but it could >> also happen if its ->probe call failed. In keeping with that, continue >> with the handling of the remaining devices even if one fails to >> probe. This is also why we cannot use uclass_probe_all(). >> >> If desired, it's possible to later add a per-device "u-boot,autostart" >> boolean property, so that one can do CONFIG_WATCHDOG_AUTOSTART >> per-device. >> >> Reviewed-by: Stefan Roese >> Signed-off-by: Rasmus Villemoes >> --- >> drivers/watchdog/wdt-uclass.c | 96 ++++++++++++++++++------------- >> include/asm-generic/global_data.h | 6 -- >> 2 files changed, 56 insertions(+), 46 deletions(-) >> > > Please see my belated reply on the previous version of this patch. Rasmus, do you plan to send an updated patchset version, addressing Simons's comments? Thanks, Stefan