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 02AADC76196 for ; Tue, 11 Apr 2023 09:38:53 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 770B185ED8; Tue, 11 Apr 2023 11:38:51 +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=1681205931; bh=M8eizRfHJwRycDnHgKgKeziun8E0XxlB3ZBx9hWwuwE=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=afq0a86Osqlb5iCBXpkEQhmKXgRnQOKqbTof3Q5xNFmvN/0msepyktM0LL9fxU1kG DC7PYxABSVEi54Bd0q5IVwNc9W2v1H9TV+lGdd1pHTIt8J5dFJTXZiQqhcYqA8DXUX xJBLyDWCjcdKoX21qyqe9R7zaHjIUAAKjHwXzWw/At51joyNZlvk7d8w1QmNbluSkB 780BDNdM0JuaWGaoya3K2Pv4Yc70LF3ZtmsTP5nKKINSN/IvO5ZyWy3mx428a597z8 go8Jb5BMguKdWZEUzWM9CFrfIPqZV31JqgkgnSw5/n5MYQVaH3I/AhTQjoNvfEX92b kfjgmF00jZFSQ== Received: by phobos.denx.de (Postfix, from userid 109) id 1FE6D85ED8; Tue, 11 Apr 2023 11:38:49 +0200 (CEST) Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [80.241.59.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 AE3C185ED7 for ; Tue, 11 Apr 2023 11:38:46 +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:b231:465::2]) (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 4Pwgl858d8z9sWX; Tue, 11 Apr 2023 11:38:44 +0200 (CEST) Message-ID: <79415e02-d03d-57e2-1f40-e8b25254a594@denx.de> Date: Tue, 11 Apr 2023 11:38:44 +0200 MIME-Version: 1.0 Subject: Re: [PATCH] watchdog: ulp_wdog: guard reset_cpu with condition check Content-Language: en-US To: "Peng Fan (OSS)" Cc: u-boot@lists.denx.de, Peng Fan References: <20230406102435.18144-1-peng.fan@oss.nxp.com> From: Stefan Roese In-Reply-To: <20230406102435.18144-1-peng.fan@oss.nxp.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4Pwgl858d8z9sWX 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.8 at phobos.denx.de X-Virus-Status: Clean On 4/6/23 12:24, Peng Fan (OSS) wrote: > From: Peng Fan > > There will be build error if CONFIG_SYSRESET is enabled, so guard > the reset_cpu with condition check here > > Signed-off-by: Peng Fan > --- > drivers/watchdog/ulp_wdog.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/watchdog/ulp_wdog.c b/drivers/watchdog/ulp_wdog.c > index c21aa3af55f..0eea04ed2c6 100644 > --- a/drivers/watchdog/ulp_wdog.c > +++ b/drivers/watchdog/ulp_wdog.c > @@ -122,6 +122,7 @@ void hw_watchdog_init(void) > ulp_watchdog_init(wdog, CONFIG_WATCHDOG_TIMEOUT_MSECS); > } > > +#if !CONFIG_IS_ENABLED(SYSRESET) > void reset_cpu(void) > { > struct wdog_regs *wdog = (struct wdog_regs *)WDOG_BASE_ADDR; > @@ -159,6 +160,7 @@ void reset_cpu(void) > > while (1); > } > +#endif Hmmm, isn't it possible to move reset_cpu() out of this file into some other (platform?) directly? IMHO this API does not really belong into the watchdog infrastructure. Thanks, Stefan