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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 53C3EECAAD4 for ; Mon, 29 Aug 2022 06:23:56 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CB75F8494B; Mon, 29 Aug 2022 08:23:36 +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=1661754216; bh=ZDtSCF+zzgA9FvrUHcutp+WN4cR1BpBru84i1ObMKVs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=j7S7aCSaHqu5+joN044rNHBDcP0wkPjmi8cNpBvL1mBeWVbhSv3o3uNPnojOpChws DA485GP/5s4Med0rTOcPtNfmJ2vyWaEw9nRiw1xu4uZvviI6c8lnjIDaMUlUmB56om 5DOBQHu9cVaZnZrKfVIArhRfTm/ygrPer44K5Uh1+GPlVMYHEMvvPOoH731EKTX9sO PuJDWlrXPM/ocFQSzO2ZTQV6CYIdFQUVgYPgyCd1x/qkui5sc7sNLHdO5hzcDAlrDx fwxIM9fsZMMpaQwKNAwuY5t2jSrL5S8P4i0BxhCz0VUxG+BxwbREPOL1YgVsyW3o6F U7PuoSpRyqOwA== Received: by phobos.denx.de (Postfix, from userid 109) id 8598E84971; Mon, 29 Aug 2022 08:23:25 +0200 (CEST) Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [IPv6:2001:67c:2050:101:465::204]) (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 7CCCF84941 for ; Mon, 29 Aug 2022 08:23:21 +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 smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1]) (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-204.mailbox.org (Postfix) with ESMTPS id 4MGL3W4JC1z9sT0; Mon, 29 Aug 2022 08:23:19 +0200 (CEST) From: Stefan Roese To: u-boot@lists.denx.de Cc: trini@konsulko.com, sjg@chromium.org, rasmus.villemoes@prevas.dk Subject: [RFC PATCH 3/8] cyclic: Introduce schedule() function Date: Mon, 29 Aug 2022 08:23:08 +0200 Message-Id: <20220829062313.32654-4-sr@denx.de> In-Reply-To: <20220829062313.32654-1-sr@denx.de> References: <20220829062313.32654-1-sr@denx.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.6 at phobos.denx.de X-Virus-Status: Clean This patch introduces a schedule() function, which shall be used instead of the old WATCHDOG_RESET. Follow-up patches will make sure, that this new function is used. Signed-off-by: Stefan Roese --- common/cyclic.c | 11 +++++++++++ include/cyclic.h | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/common/cyclic.c b/common/cyclic.c index 766a98382596..6402af4542e9 100644 --- a/common/cyclic.c +++ b/common/cyclic.c @@ -20,6 +20,8 @@ struct list_head cyclic_list; static bool cyclic_ready; static bool cyclic_running; +void hw_watchdog_reset(void); + struct cyclic_info *cyclic_register(cyclic_func_t func, uint64_t delay_us, const char *name, void *ctx) { @@ -93,6 +95,15 @@ void cyclic_run(void) cyclic_running = false; } +void schedule(void) +{ + /* The HW watchdog is not integrated into the cyclic IF (yet) */ + if (IS_ENABLED(CONFIG_HW_WATCHDOG)) + hw_watchdog_reset(); + + cyclic_run(); +} + int cyclic_uninit(void) { struct cyclic_info *cyclic, *tmp; diff --git a/include/cyclic.h b/include/cyclic.h index 2ae1cba32f20..5cea3fb3e9b4 100644 --- a/include/cyclic.h +++ b/include/cyclic.h @@ -78,6 +78,7 @@ int cyclic_init(void); int cyclic_uninit(void); void cyclic_run(void); +void schedule(void); #else static inline struct cyclic_info *cyclic_register(cyclic_func_t func, uint64_t delay_us, @@ -96,6 +97,10 @@ static inline void cyclic_run(void) { } +static inline void schedule(void) +{ +} + static inline int cyclic_init(void) { return 0; -- 2.37.2