All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robin Gong <yibin.gong@nxp.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: "wim@linux-watchdog.org" <wim@linux-watchdog.org>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"festevam@gmail.com" <festevam@gmail.com>,
	dl-linux-imx <linux-imx@nxp.com>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"linux-watchdog@vger.kernel.org" <linux-watchdog@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH v1] watchdog: imx2_wdt: clear WDOG_HW_RUNNING before suspend
Date: Thu, 13 May 2021 03:49:23 +0000	[thread overview]
Message-ID: <VE1PR04MB6688A83899254F38221CE02A89519@VE1PR04MB6688.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20210512141435.GL1333995@roeck-us.net>

On 5/12/21 22:15 Guenter Roeck <groeck7@gmail.com> wrote:
> We can not assume that the situation is exactly the same for all drivers and
> use a core flag to indicate some driver specific state just to avoid a
> driver-internal flag.
> 
> Either case, it looks like you are saying that the watchdog can be stopped after
> all, by disabling its clock.
> 
> > BTW, for i.mx2_wdt which watchdog can't be stop unless kernel enter
> > into suspend, that seems like watchdog stop after suspend and clear
> > WDOG_HW_RUNNING makes sense?
> >
> 
> Yes, if you make it official and add a stop function which disables the
> watchdog by stopping its clock. Then the driver should not set
> WDOG_HW_RUNNING in the first place, and use the normal mechanisms to
> start and stop the watchdog.
> That would include starting the clock in the start function, and stopping it in
> the stop function.
> 
Sorry, watchdog can't be stopped by disabling clock. The only way to stop watchdog
is SOC enter Deep Sleep Mode(suspend) and stopped by HW,  so the suspend flow
looks like 'watchdog stop' which I though WDOG_HW_RUNNING makes sense. 
Okay, I will use internal flag instead of WDOG_HW_RUNNING in v2, thanks.



WARNING: multiple messages have this Message-ID (diff)
From: Robin Gong <yibin.gong@nxp.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: "wim@linux-watchdog.org" <wim@linux-watchdog.org>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"festevam@gmail.com" <festevam@gmail.com>,
	dl-linux-imx <linux-imx@nxp.com>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"linux-watchdog@vger.kernel.org" <linux-watchdog@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH v1] watchdog: imx2_wdt: clear WDOG_HW_RUNNING before suspend
Date: Thu, 13 May 2021 03:49:23 +0000	[thread overview]
Message-ID: <VE1PR04MB6688A83899254F38221CE02A89519@VE1PR04MB6688.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20210512141435.GL1333995@roeck-us.net>

On 5/12/21 22:15 Guenter Roeck <groeck7@gmail.com> wrote:
> We can not assume that the situation is exactly the same for all drivers and
> use a core flag to indicate some driver specific state just to avoid a
> driver-internal flag.
> 
> Either case, it looks like you are saying that the watchdog can be stopped after
> all, by disabling its clock.
> 
> > BTW, for i.mx2_wdt which watchdog can't be stop unless kernel enter
> > into suspend, that seems like watchdog stop after suspend and clear
> > WDOG_HW_RUNNING makes sense?
> >
> 
> Yes, if you make it official and add a stop function which disables the
> watchdog by stopping its clock. Then the driver should not set
> WDOG_HW_RUNNING in the first place, and use the normal mechanisms to
> start and stop the watchdog.
> That would include starting the clock in the start function, and stopping it in
> the stop function.
> 
Sorry, watchdog can't be stopped by disabling clock. The only way to stop watchdog
is SOC enter Deep Sleep Mode(suspend) and stopped by HW,  so the suspend flow
looks like 'watchdog stop' which I though WDOG_HW_RUNNING makes sense. 
Okay, I will use internal flag instead of WDOG_HW_RUNNING in v2, thanks.



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-05-13  3:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-11 11:20 [PATCH v1] watchdog: imx2_wdt: clear WDOG_HW_RUNNING before suspend Robin Gong
2021-05-11 11:20 ` Robin Gong
2021-05-11  3:59 ` Guenter Roeck
2021-05-11  3:59   ` Guenter Roeck
2021-05-12 11:34   ` Robin Gong
2021-05-12 11:34     ` Robin Gong
2021-05-12 14:14     ` Guenter Roeck
2021-05-12 14:14       ` Guenter Roeck
2021-05-13  3:49       ` Robin Gong [this message]
2021-05-13  3:49         ` Robin Gong

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=VE1PR04MB6688A83899254F38221CE02A89519@VE1PR04MB6688.eurprd04.prod.outlook.com \
    --to=yibin.gong@nxp.com \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.