From: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
To: Robin Gong <b38343@freescale.com>, <wim@iguana.be>, <linux@roeck-us.net>
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 17:46:17 +0200 [thread overview]
Message-ID: <563A2849.5040707@mentor.com> (raw)
In-Reply-To: <1446531084-15365-2-git-send-email-b38343@freescale.com>
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.
> + }
> +
> + return IRQ_HANDLED;
> +}
> +
--
With best wishes,
Vladimir
next prev parent reply other threads:[~2015-11-04 15:47 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 [this message]
2015-11-04 16:05 ` Guenter Roeck
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=563A2849.5040707@mentor.com \
--to=vladimir_zapolskiy@mentor.com \
--cc=b38343@freescale.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--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