linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>,
	Robin Gong <b38343@freescale.com>,
	wim@iguana.be
Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 2/2] watchdog: imx2_wdt: add set_pretimeout interface
Date: Wed, 4 Nov 2015 08:05:47 -0800	[thread overview]
Message-ID: <563A2CDB.7090101@roeck-us.net> (raw)
In-Reply-To: <563A2849.5040707@mentor.com>

On 11/04/2015 07:46 AM, Vladimir Zapolskiy wrote:
> Hi Robin,
>
> On 03.11.2015 08:11, Robin Gong wrote:
>> Enable set_pretimeout interface and trigger the pretimeout interrupt before
>> watchdog timeout event happen.
>>
>> Signed-off-by: Robin Gong <b38343@freescale.com>
>> ---
>
> [snip]
>
>> +
>> +static irqreturn_t imx2_wdt_isr(int irq, void *dev_id)
>> +{
>> +	struct platform_device *pdev = dev_id;
>> +	struct watchdog_device *wdog = platform_get_drvdata(pdev);
>> +	struct imx2_wdt_device *wdev = watchdog_get_drvdata(wdog);
>> +	u32 val;
>> +
>> +	regmap_read(wdev->regmap, IMX2_WDT_WICR, &val);
>> +	if (val & IMX2_WDT_WICR_WTIS) {
>> +		/*clear interrupt status bit*/
>> +		regmap_write(wdev->regmap, IMX2_WDT_WICR, val);
>> +		panic("pre-timeout:%d, %d Seconds remained\n", wdog->pretimeout,
>> +		      wdog->timeout - wdog->pretimeout);
>
> I don't think it is a good idea to panic on pretimeout interrupt, for
> instance pretimeout interrupt may be used for any other purposes - ping
> watchdog, dump some system information before reboot and so on.
>
> In general I am even not completely convinced that the pretimeout interrupt
> handler should be placed in the driver, it may happen that there are some
> users outside, who wants to get this interrupt and act according to the event.
>

Ah yes, this is one of the reasons why adding this functionality into the
watchdog core keeps going nowhere. Some of the people involved absolutely
insist that a watchdog pretimeout should result in a panic, others are just
as strongly opposed to it. At the end, there is no consensus, and we end up
doing nothing, since nothing is better than each driver behaving differently.

Just like politics, I guess :-(.

Guenter


  reply	other threads:[~2015-11-04 16:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-03  6:11 [PATCH v2 1/2] watchdog: add WDIOC_SETPRETIMEOUT and WDIOC_GETPRETIMEOUT Robin Gong
2015-11-03  6:11 ` [PATCH v2 2/2] watchdog: imx2_wdt: add set_pretimeout interface Robin Gong
2015-11-03  7:48   ` Guenter Roeck
2015-11-03  8:04     ` Robin Gong
2015-11-03 17:26       ` Guenter Roeck
2015-11-04  7:55         ` Robin Gong
2015-11-04 15:46   ` Vladimir Zapolskiy
2015-11-04 16:05     ` Guenter Roeck [this message]
2015-11-03  7:41 ` [PATCH v2 1/2] watchdog: add WDIOC_SETPRETIMEOUT and WDIOC_GETPRETIMEOUT 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=563A2CDB.7090101@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=b38343@freescale.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=vladimir_zapolskiy@mentor.com \
    --cc=wim@iguana.be \
    /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;
as well as URLs for NNTP newsgroup(s).