All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] watchdog: fix nowayout setting in s3c2410_wdt
@ 2011-11-25 23:38 Marc Vertes
  2011-11-26 10:29 ` Wolfram Sang
  0 siblings, 1 reply; 5+ messages in thread
From: Marc Vertes @ 2011-11-25 23:38 UTC (permalink / raw)
  To: Wim Van Sebroeck; +Cc: linux-kernel, linux-watchdog, Dimitry Andric, Ben Dooks

Set nowayout flag in probe function, otherwise option is useless.

Signed-off-by: Marc Vertes <marc.vertes@sigfox.com>
---

 s3c2410_wdt.c |    3 +++
 1 file changed, 3 insertions(+)

--- linux-3.2-rc3/drivers/watchdog/s3c2410_wdt.c.orig	2011-11-24 05:20:28.000000000 +0100
+++ linux-3.2-rc3/drivers/watchdog/s3c2410_wdt.c	2011-11-26 00:08:58.985896169 +0100
@@ -395,6 +395,9 @@ static int __devinit s3c2410wdt_probe(st
 		s3c2410wdt_stop(&s3c2410_wdd);
 	}
 
+	if (nowayout)
+		set_bit(WDOG_NO_WAY_OUT, &s3c2410_wdd.status);
+
 	/* print out a statement of readiness */
 
 	wtcon = readl(wdt_base + S3C2410_WTCON);

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] watchdog: fix nowayout setting in s3c2410_wdt
  2011-11-25 23:38 [PATCH] watchdog: fix nowayout setting in s3c2410_wdt Marc Vertes
@ 2011-11-26 10:29 ` Wolfram Sang
  2011-11-29  9:56   ` Wim Van Sebroeck
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfram Sang @ 2011-11-26 10:29 UTC (permalink / raw)
  To: Marc Vertes
  Cc: Wim Van Sebroeck, linux-kernel, linux-watchdog, Dimitry Andric,
	Ben Dooks

[-- Attachment #1: Type: text/plain, Size: 714 bytes --]

On Sat, Nov 26, 2011 at 12:38:01AM +0100, Marc Vertes wrote:
> Set nowayout flag in probe function, otherwise option is useless.
> 
> Signed-off-by: Marc Vertes <marc.vertes@sigfox.com>

Similar as

http://www.spinics.net/lists/linux-watchdog/msg00704.html

which depends on

http://www.spinics.net/lists/linux-watchdog/msg00703.html

which has the advantage that it can be used for static initialization.

@Wim: are you fine with that old series BTW? If so, I will resend and try to
get the RTC-ack from Andrew.

Thanks,

   Wolfram

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] watchdog: fix nowayout setting in s3c2410_wdt
  2011-11-26 10:29 ` Wolfram Sang
@ 2011-11-29  9:56   ` Wim Van Sebroeck
  2011-11-29 10:21     ` Wolfram Sang
  0 siblings, 1 reply; 5+ messages in thread
From: Wim Van Sebroeck @ 2011-11-29  9:56 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Marc Vertes, linux-kernel, linux-watchdog, Dimitry Andric, Ben Dooks

Hi Wolfram,

> > Set nowayout flag in probe function, otherwise option is useless.
> > 
> > Signed-off-by: Marc Vertes <marc.vertes@sigfox.com>
> 
> Similar as
> 
> http://www.spinics.net/lists/linux-watchdog/msg00704.html
> 
> which depends on
> 
> http://www.spinics.net/lists/linux-watchdog/msg00703.html
> 
> which has the advantage that it can be used for static initialization.

Hmm, I was more thinking about a wrapper function like the following:

diff --git a/include/linux/watchdog.h b/include/linux/watchdog.h
index 111843f..d8ef9b2 100644
--- a/include/linux/watchdog.h
+++ b/include/linux/watchdog.h
@@ -53,6 +53,8 @@ struct watchdog_info {
 
 #ifdef __KERNEL__
 
+#include <linux/bitops.h>
+
 #ifdef CONFIG_WATCHDOG_NOWAYOUT
 #define WATCHDOG_NOWAYOUT	1
 #else
@@ -122,6 +124,13 @@ struct watchdog_device {
 #define WDOG_NO_WAY_OUT		3	/* Is 'nowayout' feature set ? */
 };
 
+/* Use the following function to set the nowayout feature */
+static inline void watchdog_set_nowayout(struct watchdog_device *wdd, int nowayout)
+{
+	if (nowayout)
+		set_bit(WDOG_NO_WAY_OUT, &wdd->status);
+}
+
 /* Use the following functions to manipulate watchdog driver specific data */
 static inline void watchdog_set_drvdata(struct watchdog_device *wdd, void *data)
 {

but: .status = WATCHDOG_NOWAYOUT_INIT_STATUS, is also a nice one to have.

I propose to add both options and to document them in the documentation.
Objections anyone?

Kind regards,
Wim.


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] watchdog: fix nowayout setting in s3c2410_wdt
  2011-11-29  9:56   ` Wim Van Sebroeck
@ 2011-11-29 10:21     ` Wolfram Sang
  2011-11-29 10:44       ` Wim Van Sebroeck
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfram Sang @ 2011-11-29 10:21 UTC (permalink / raw)
  To: Wim Van Sebroeck
  Cc: Marc Vertes, linux-kernel, linux-watchdog, Dimitry Andric, Ben Dooks

[-- Attachment #1: Type: text/plain, Size: 751 bytes --]


> +/* Use the following function to set the nowayout feature */
> +static inline void watchdog_set_nowayout(struct watchdog_device *wdd, int nowayout)
> +{
> +	if (nowayout)
> +		set_bit(WDOG_NO_WAY_OUT, &wdd->status);
> +}

Yes, this is better in case we might need to add something later.

> but: .status = WATCHDOG_NOWAYOUT_INIT_STATUS, is also a nice one to have.
> 
> I propose to add both options and to document them in the documentation.
> Objections anyone?

Sounds good to me.

So, I'll drop NOWAYOUT-related patches from my STMP-series?

Thanks,

   Wolfram

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] watchdog: fix nowayout setting in s3c2410_wdt
  2011-11-29 10:21     ` Wolfram Sang
@ 2011-11-29 10:44       ` Wim Van Sebroeck
  0 siblings, 0 replies; 5+ messages in thread
From: Wim Van Sebroeck @ 2011-11-29 10:44 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Marc Vertes, linux-kernel, linux-watchdog, Dimitry Andric, Ben Dooks

Hi Wolfram,

> > +/* Use the following function to set the nowayout feature */
> > +static inline void watchdog_set_nowayout(struct watchdog_device *wdd, int nowayout)
> > +{
> > +	if (nowayout)
> > +		set_bit(WDOG_NO_WAY_OUT, &wdd->status);
> > +}
> 
> Yes, this is better in case we might need to add something later.
> 
> > but: .status = WATCHDOG_NOWAYOUT_INIT_STATUS, is also a nice one to have.
> > 
> > I propose to add both options and to document them in the documentation.
> > Objections anyone?
> 
> Sounds good to me.
> 
> So, I'll drop NOWAYOUT-related patches from my STMP-series?

Yes, I'll make sure we do the necessary on the nowayout side :-). Will try to add a patch for it today.
Could you resend the SMTP series after that you dropped the nowayout patches so I can review these?

Kind regards,
Wim.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-11-29 10:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-25 23:38 [PATCH] watchdog: fix nowayout setting in s3c2410_wdt Marc Vertes
2011-11-26 10:29 ` Wolfram Sang
2011-11-29  9:56   ` Wim Van Sebroeck
2011-11-29 10:21     ` Wolfram Sang
2011-11-29 10:44       ` Wim Van Sebroeck

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.