mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: George Cherian <gcherian@marvell.com>
Cc: "Ahmad Fatoum" <a.fatoum@pengutronix.de>,
	"wim@linux-watchdog.org" <wim@linux-watchdog.org>,
	"jwerner@chromium.org" <jwerner@chromium.org>,
	"evanbenn@chromium.org" <evanbenn@chromium.org>,
	"krzk@kernel.org" <krzk@kernel.org>,
	"mazziesaccount@gmail.com" <mazziesaccount@gmail.com>,
	"thomas.richard@bootlin.com" <thomas.richard@bootlin.com>,
	"lma@chromium.org" <lma@chromium.org>,
	"bleung@chromium.org" <bleung@chromium.org>,
	"support.opensource@diasemi.com" <support.opensource@diasemi.com>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"festevam@gmail.com" <festevam@gmail.com>,
	"andy@kernel.org" <andy@kernel.org>,
	"paul@crapouillou.net" <paul@crapouillou.net>,
	"alexander.usyskin@intel.com" <alexander.usyskin@intel.com>,
	"andreas.werner@men.de" <andreas.werner@men.de>,
	"daniel@thingy.jp" <daniel@thingy.jp>,
	"romain.perier@gmail.com" <romain.perier@gmail.com>,
	"avifishman70@gmail.com" <avifishman70@gmail.com>,
	"tmaimon77@gmail.com" <tmaimon77@gmail.com>,
	"tali.perry1@gmail.com" <tali.perry1@gmail.com>,
	"venture@google.com" <venture@google.com>,
	"yuenn@google.com" <yuenn@google.com>,
	"benjaminfair@google.com" <benjaminfair@google.com>,
	"maddy@linux.ibm.com" <maddy@linux.ibm.com>,
	"mpe@ellerman.id.au" <mpe@ellerman.id.au>,
	"npiggin@gmail.com" <npiggin@gmail.com>,
	"christophe.leroy@csgroup.eu" <christophe.leroy@csgroup.eu>,
	"naveen@kernel.org" <naveen@kernel.org>,
	"mwalle@kernel.org" <mwalle@kernel.org>,
	"xingyu.wu@starfivetech.com" <xingyu.wu@starfivetech.com>,
	"ziv.xu@starfivetech.com" <ziv.xu@starfivetech.com>,
	"hayashi.kunihiko@socionext.com" <hayashi.kunihiko@socionext.com>,
	"mhiramat@kernel.org" <mhiramat@kernel.org>,
	"linux-watchdog@vger.kernel.org" <linux-watchdog@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"chrome-platform@lists.linux.dev"
	<chrome-platform@lists.linux.dev>,
	"imx@lists.linux.dev" <imx@lists.linux.dev>,
	"linux-mips@vger.kernel.org" <linux-mips@vger.kernel.org>,
	"openbmc@lists.ozlabs.org" <openbmc@lists.ozlabs.org>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"patches@opensource.cirrus.com" <patches@opensource.cirrus.com>,
	"Marek Behún" <kabel@kernel.org>
Subject: Re: [EXTERNAL] Re: [PATCH v4 1/2] watchdog: Add a new flag WDIOF_STOP_MAYSLEEP
Date: Thu, 6 Mar 2025 09:22:47 -0800	[thread overview]
Message-ID: <925869a6-7563-459b-b42b-b7b9b8ea0b0a@roeck-us.net> (raw)
In-Reply-To: <PH8PR18MB53812FCAE180303E5D434275C5CA2@PH8PR18MB5381.namprd18.prod.outlook.com>

On Thu, Mar 06, 2025 at 12:18:20PM +0000, George Cherian wrote:
> Hi Guenter,
> 
> I am summarizing the topics we discussed in multiple threads here.
> 
> >>On 3/5/25 03:01, Ahmad Fatoum wrote:
> >> Hi George,
> >> Hi Guenter,
> >> 
> >> On 05.03.25 11:34, George Cherian wrote:
> >>>> why is armada_37xx_wdt also here?
> >>>> The stop function in that driver may not sleep.
> >>> Marek,
> >>>
> >>> Thanks for reviewing.
> >>> Since the stop function has a regmap_write(), I thought it might sleep.
> >>> Now that you pointed it out, I assume that it is an MMIO based regmap being used for armada.
> >>> I will update the same in the next version
> >> 
> >> Failure to add WDIOF_STOP_MAYSLEEP when it's needed can lead to
> >> kernel hanging. Failure to add an alternative WDIOF_STOP_ATOMIC
> >> would lead to the kernel option being a no-op.
> >> 
> >> I think a no-op stop_on_panic (or reset_on_panic) is a saner default.
> >> 
> >
> >Agreed. Also, I like WDIOF_STOP_ATOMIC more than the WDIOF_STOP_NOSLEEP
> >I had suggested in my other response.
> 
> 1. Instead of blacklisting drivers as WDIOF_STOP_MAYSLEEP, the option will an opt-in.
> 2. This may not be WDIOF_STOP_AOMIC, instead would be a generic flag not limited to STOP
>     operation. May be WDIOF_OPS_ATOMIC (OPS include - .start, .stop, .set_timeout, .ping)

I don't see a value in this because AFAICS atomic operation is only needed when
stopping the watchdog. At least in theory, some watchdogs might need to sleep
for other functions, but not for the stop operation. Please provide a rationale.

> 3. Remove the kernel command line option (stop_on_panic) and have a generic reset_on_panic.
> 4. reset_on_panic=60 (by default )  meaning on a panic the wdog timeout is updated to 60sec
>      or the clamp_t(reset_on_panic, min, max_hw_heartbeat_ms).

Default should be the current behavior, that the watchdog keeps running with the
configured timeout.

> 5. if reset_on_panic=0, it means the watchdog is stopped on panic.

If we need both a panic timeout and the ability to disable the watchdog entirely
on panic, there should be two parameters - one to select the watchdog timeout
on panic, and one to disable the watchdog entirely on panic. If there is only
one parameter, it should be the watchdog timeout on panic, with ==0 meaning
"keep the configured timeout" (i.e., the current behavior).

Thanks,
Guenter

  reply	other threads:[~2025-03-06 17:22 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-05 10:10 [PATCH v4 0/2] Add stop_on_panic support for watchdog George Cherian
2025-03-05 10:10 ` [PATCH v4 1/2] watchdog: Add a new flag WDIOF_STOP_MAYSLEEP George Cherian
2025-03-05 10:18   ` Marek Behún
2025-03-05 10:34     ` George Cherian
2025-03-05 11:01       ` Ahmad Fatoum
2025-03-05 23:58         ` Guenter Roeck
2025-03-06 12:18           ` [EXTERNAL] " George Cherian
2025-03-06 17:22             ` Guenter Roeck [this message]
2025-03-05 10:30   ` Andy Shevchenko
2025-03-05 22:50   ` Julius Werner
2025-03-06  9:40     ` George Cherian
2025-03-05 23:03   ` Guenter Roeck
2025-03-05 10:10 ` [PATCH v4 2/2] drivers: watchdog: Add support for panic notifier callback George Cherian
2025-03-05 10:33   ` Andy Shevchenko
2025-03-06  0:00     ` Guenter Roeck
2025-03-05 10:31 ` [PATCH v4 0/2] Add stop_on_panic support for watchdog Andy Shevchenko
2025-03-05 10:41 ` Ahmad Fatoum
2025-03-05 11:28   ` [EXTERNAL] " George Cherian
2025-03-05 11:39     ` Ahmad Fatoum
2025-03-05 12:15       ` George Cherian
2025-03-05 12:23         ` Ahmad Fatoum

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=925869a6-7563-459b-b42b-b7b9b8ea0b0a@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=a.fatoum@pengutronix.de \
    --cc=alexander.usyskin@intel.com \
    --cc=andreas.werner@men.de \
    --cc=andy@kernel.org \
    --cc=avifishman70@gmail.com \
    --cc=benjaminfair@google.com \
    --cc=bleung@chromium.org \
    --cc=christophe.leroy@csgroup.eu \
    --cc=chrome-platform@lists.linux.dev \
    --cc=daniel@thingy.jp \
    --cc=evanbenn@chromium.org \
    --cc=festevam@gmail.com \
    --cc=gcherian@marvell.com \
    --cc=hayashi.kunihiko@socionext.com \
    --cc=imx@lists.linux.dev \
    --cc=jwerner@chromium.org \
    --cc=kabel@kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lma@chromium.org \
    --cc=maddy@linux.ibm.com \
    --cc=mazziesaccount@gmail.com \
    --cc=mhiramat@kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=mwalle@kernel.org \
    --cc=naveen@kernel.org \
    --cc=npiggin@gmail.com \
    --cc=openbmc@lists.ozlabs.org \
    --cc=patches@opensource.cirrus.com \
    --cc=paul@crapouillou.net \
    --cc=romain.perier@gmail.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=support.opensource@diasemi.com \
    --cc=tali.perry1@gmail.com \
    --cc=thomas.richard@bootlin.com \
    --cc=tmaimon77@gmail.com \
    --cc=venture@google.com \
    --cc=wim@linux-watchdog.org \
    --cc=xingyu.wu@starfivetech.com \
    --cc=yuenn@google.com \
    --cc=ziv.xu@starfivetech.com \
    /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®