From: "liuchao (CR)" <liuchao173@huawei.com>
To: Guenter Roeck <linux@roeck-us.net>,
"wim@linux-watchdog.org" <wim@linux-watchdog.org>,
"linux-watchdog@vger.kernel.org" <linux-watchdog@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: caihe <caihe@huawei.com>, lixiaokeng <lixiaokeng@huawei.com>
Subject: RE: RE: [PATCH] watchdog: only print critical log when the watchdog fails to be stopped
Date: Mon, 27 Jan 2025 09:35:46 +0000 [thread overview]
Message-ID: <09237774d7a64521888fdd47f4ac5d8e@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:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-27 9:35 liuchao (CR) [this message]
2025-01-27 14:29 ` 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=09237774d7a64521888fdd47f4ac5d8e@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®