From: "liuchao (CR)" <liuchao173@huawei.com>
To: "linux@roeck-us.net" <linux@roeck-us.net>
Cc: caihe <caihe@huawei.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-watchdog@vger.kernel.org" <linux-watchdog@vger.kernel.org>,
"liuchao (CR)" <liuchao173@huawei.com>,
lixiaokeng <lixiaokeng@huawei.com>,
"wim@linux-watchdog.org" <wim@linux-watchdog.org>
Subject: Re: [PATCH] watchdog: only print critical log when the watchdog fails to be stopped
Date: Mon, 27 Jan 2025 09:44:55 +0000 [thread overview]
Message-ID: <f703a1e24583494eb813867c8d25e311@huawei.com> (raw)
On 1/26/25 21:10, Guenter Roeck wrote:
> On 1/26/25 00:38, Liu Chao wrote:
> > Every time the user echoes 0 > /dev/watchdog0, meaningless critical
> > log is printed.
> >
>
> It is not meaningless, and it will still be displayed after this
> change, making the change pointless.
The change is not pointless. For example, the softdog driver does not invoke
watchdog_stop or print logs in the watchdog_release.
Liu Chao
>
> Guenter
>
> > Signed-off-by: Liu Chao <liuchao173@huawei.com>
> > ---
> > drivers/watchdog/watchdog_dev.c | 9 +++++----
> > 1 file changed, 5 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/watchdog/watchdog_dev.c
> > b/drivers/watchdog/watchdog_dev.c index e2bd266b1b5b..0a9d5e6f3a88
> > 100644
> > --- a/drivers/watchdog/watchdog_dev.c
> > +++ b/drivers/watchdog/watchdog_dev.c
> > @@ -960,14 +960,15 @@ static int watchdog_release(struct inode
> > *inode,
> struct file *file)
> > if (!watchdog_active(wdd))
> > err = 0;
> > else if (test_and_clear_bit(_WDOG_ALLOW_RELEASE,
> &wd_data->status) ||
> > - !(wdd->info->options & WDIOF_MAGICCLOSE))
> > + !(wdd->info->options & WDIOF_MAGICCLOSE)) {
> > err = watchdog_stop(wdd);
> > + if (err < 0)
> > + pr_crit("watchdog%d: watchdog did not stop!\n", wdd->id);
> > + }
> >
> > /* If the watchdog was not stopped, send a keepalive ping */
> > - if (err < 0) {
> > - pr_crit("watchdog%d: watchdog did not stop!\n", wdd->id);
> > + if (err < 0)
> > watchdog_ping(wdd);
> > - }
> >
> > watchdog_update_worker(wdd);
> >
next reply other threads:[~2025-01-27 9:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-27 9:44 liuchao (CR) [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-02-05 3:14 liuchao (CR)
2025-02-05 4:28 ` Guenter Roeck
2025-02-05 5:20 ` Guenter Roeck
2025-02-05 2:02 liuchao (CR)
2025-02-05 2:35 ` Guenter Roeck
2025-01-27 9:35 liuchao (CR)
2025-01-27 14:29 ` Guenter Roeck
2025-01-26 8:38 Liu Chao
2025-01-26 13:10 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f703a1e24583494eb813867c8d25e311@huawei.com \
--to=liuchao173@huawei.com \
--cc=caihe@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=lixiaokeng@huawei.com \
--cc=wim@linux-watchdog.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®