Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp21794416rwd; Thu, 29 Jun 2023 23:07:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ53kpd3nXecPftuSqEts0BVhsCMDX75UswcQjC1woY9jkuny0z1+x91xeJWBOymLXDpXZAr X-Received: by 2002:a05:6808:1897:b0:3a0:5a3e:2931 with SMTP id bi23-20020a056808189700b003a05a3e2931mr1924956oib.20.1688105232083; Thu, 29 Jun 2023 23:07:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688105232; cv=none; d=google.com; s=arc-20160816; b=qRayrvh4oy7nMC1tIPsk6hRaf71KBUAhhfFEPIKxd5WNr4l6Sjy8/vnkEN/M97K2rW 4bsJJYF0FGCSPz4DXQElkq2FjA1S8MIeVCgfqS7ih3ADrZk6EYVBowaeRAq3ef6mCJIz BweKjI5jEC8FPTfZwSE13u89NPyewEtoWiGmznkXOOhIZmBvicfPc6DtYdUPEQva72jM YuKzYIbgGh5ufOpDk5NzsIpxtkQPfwTSwyjDgYR+AtS5ewVG6w5QZpyf1hQBk2sooxn5 6pi+wNfftLRks7+I38t4KjxAYEefmqqbqlGOHyd2lHG5l287zf7tWj/3soFdOQckWMvD NYOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:sender:dkim-signature; bh=Md88dxy0Oq073zhiW/L7j2467fRKk8w3qHvdwFL4C9M=; fh=rKQRHwm9XTJhAPmwx7EDwDAxTQlXICENAW9uT/iORAM=; b=jUTNDn2ujzboAgufYoEJGlG8++XYOCJ4xSzE7XgFmyIxrtFWoHH/fQ9AZeR2hvnhEu RjNegyNcEEy67wQqwXBxMPV/SYzgWQLXchY/Caz5ZGfMW/EJf/KNMiGKRbnfun852GhR P2f2sQEzekxe9aoFqDNhio66Q9Vh9b9SqehpG3g50li4UjxeJ1+SQLtG2NyIr99VZrnf Xop9srgnMuvMFx7cg5OlTlXwzDChT7CiY13WB0pg2wejm0mZXI5bGiDo6tz0Mclf+UDE mTUAHMchmVUme54rZhH74+av+iWSG7aKpt2jixs63vVOtcTHOoyQzqtARaZjOhKJ4Cfl VbvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=PcjD32MM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z17-20020a634c11000000b0055384255b9bsi10891301pga.24.2023.06.29.23.06.57; Thu, 29 Jun 2023 23:07:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=PcjD32MM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231784AbjF3FpN (ORCPT + 99 others); Fri, 30 Jun 2023 01:45:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232434AbjF3FpD (ORCPT ); Fri, 30 Jun 2023 01:45:03 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 388CD3A8B; Thu, 29 Jun 2023 22:44:40 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1b7f92b764dso8415525ad.2; Thu, 29 Jun 2023 22:44:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688103879; x=1690695879; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=Md88dxy0Oq073zhiW/L7j2467fRKk8w3qHvdwFL4C9M=; b=PcjD32MMYgiYE564baUOEyiGOo22UgtVHw0i59AYfPpgyunfV/fOoc6viTly+vaOhb zRV2g5/ghxDxVFaXHb4j4geiWH+qCuDuINmC+dUjaRbqr6bbrMBcwX9EZKX5X4mWCnkK ny1z2eOBxlwYymTMSilH2LSBpQyf2Nid4F+cVjbYi95/cR7av3ygJbYYNtnN0Fn4b5A+ nzUeTOlwl7kBUqvsjz5xKPpsUNzl4iHVC/M2gJKJMTIlRcgt+397t9Bg2vqPfxieECvM UNoi5r2SUU6fzVSyEG9GPtwNHwmddZ2KX2XgCUogouM6va3jJkdCcKTKaDXo7sqi8y3W xp3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688103879; x=1690695879; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Md88dxy0Oq073zhiW/L7j2467fRKk8w3qHvdwFL4C9M=; b=T1kB7h62ZTbgBCB15Oso8MKScUg55YHMXnhruDa1tM/HajEPo9vHYeK3gBd7XNKHTm 0s6JP6B/3O0yer+N/gcNhcaizAsBqa7+3UQgqcBvxtvhRVGb0Q0wWKINTpO2u09uCsi/ PIcOAlMos6aOq3xFjFlQH/WWSJSmQrKbC1rYzCZ9i42Uiul3r3Yt9eKciSNMrvVJXPH7 HT539A51ky7lRcMI2+Y096EbGm70lykSxFicuq7mKZlLKIQ3IS9i70yJNwAqdu2+bMao 0fkYrvwep5Y8SdLFjqPRtZfdE6VEbBgMYuqay0BFCFgtHlSj2Y5E492vs5BBu4SMvNNB fLDw== X-Gm-Message-State: ABy/qLaDMb0lLh1xN32+g2wtBS3zsdPO30+MhSKV1bIS9yWqV0Jmaa3m MDmmnc1top6Xe1DXthzhiNtXMfaECyQ= X-Received: by 2002:a17:902:ecc5:b0:1b8:144c:7023 with SMTP id a5-20020a170902ecc500b001b8144c7023mr893750plh.60.1688103879352; Thu, 29 Jun 2023 22:44:39 -0700 (PDT) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id t10-20020a170902a5ca00b001b53c8659fesm9942394plq.30.2023.06.29.22.44.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 29 Jun 2023 22:44:38 -0700 (PDT) Sender: Guenter Roeck Message-ID: <5a6cb162-790a-d24a-8946-090f4a893cf7@roeck-us.net> Date: Thu, 29 Jun 2023 22:44:37 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH] watchdog: core: stop watchdog when executing poweroff command Content-Language: en-US To: Meng Li , wim@linux-watchdog.org, linux-watchdog@vger.kernel.org Cc: linux-kernel@vger.kernel.org References: <20230630053912.28205-1-Meng.Li@windriver.com> From: Guenter Roeck In-Reply-To: <20230630053912.28205-1-Meng.Li@windriver.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/29/23 22:39, Meng Li wrote: > From: Meng Li > > On some platforms, for example, Intel SoC FPGA platform, the watchdog is > started in from u-boot, and so kernel will create a timer and work to > keep watchdog alive. .But when user executes commands "poweroff" or > "shutdown -h", the system is reset when watchdog triggers timeout even > if WDOG_STOP_ON_REBOOT is set in watchdog driver. The root cause is > that the watchdog not stopped properly because the SYS_POWER_OFF case > is not supported in nofify callback function. So, add this case to stop > watchdog when executing poweroff command. > > Signed-off-by: Meng Li Reviewed-by: Guenter Roeck > --- > drivers/watchdog/watchdog_core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/watchdog/watchdog_core.c b/drivers/watchdog/watchdog_core.c > index d4c5a736fdcb..5b55ccae06d4 100644 > --- a/drivers/watchdog/watchdog_core.c > +++ b/drivers/watchdog/watchdog_core.c > @@ -161,7 +161,7 @@ static int watchdog_reboot_notifier(struct notifier_block *nb, > struct watchdog_device *wdd; > > wdd = container_of(nb, struct watchdog_device, reboot_nb); > - if (code == SYS_DOWN || code == SYS_HALT) { > + if (code == SYS_DOWN || code == SYS_HALT || code == SYS_POWER_OFF) { > if (watchdog_hw_running(wdd)) { > int ret; >