public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ib700wdt watchdog driver for 2.6.6
@ 2004-05-10 15:57 Patrice Bouchand
  2004-05-11  8:32 ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: Patrice Bouchand @ 2004-05-10 15:57 UTC (permalink / raw)
  To: linux-kernel

Hello all,

        The following is a kernel 2.6.6 patch for the ib700wdt watchdog 
driver. I tried to mail Charles Howes, but his address seems to be down.

	The modified file is ib700wdt.c

	The thing which is modified :

 ibwdt_ping() : a bug removed ,port value must be written not the timeout in 
second

        Comments are welcome,

        Best regards

        Patrice BOUCHAND 

------------------------------------------------------------------------------------------------------------------

--- ./ib700wdt.c.orig   2004-05-10 08:57:54.000000000 +0200
+++ ./ib700wdt.c        2004-05-10 08:44:50.000000000 +0200
@@ -135,7 +135,7 @@
 ibwdt_ping(void)
 {
        /* Write a watchdog value */
-       outb_p(wd_times[wd_margin], WDT_START);
+       outb_p(wd_margin, WDT_START);
 }

 static ssize_t



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

* Re: [PATCH] ib700wdt watchdog driver for 2.6.6
  2004-05-10 15:57 [PATCH] ib700wdt watchdog driver for 2.6.6 Patrice Bouchand
@ 2004-05-11  8:32 ` Andrew Morton
  2004-05-11  9:01   ` Patrice Bouchand
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2004-05-11  8:32 UTC (permalink / raw)
  To: Patrice Bouchand; +Cc: linux-kernel

Patrice Bouchand <PBouchand@cyberdeck.com> wrote:
>
> --- ./ib700wdt.c.orig   2004-05-10 08:57:54.000000000 +0200
>  +++ ./ib700wdt.c        2004-05-10 08:44:50.000000000 +0200
>  @@ -135,7 +135,7 @@
>   ibwdt_ping(void)
>   {
>          /* Write a watchdog value */
>  -       outb_p(wd_times[wd_margin], WDT_START);
>  +       outb_p(wd_margin, WDT_START);
>   }

The patch certainly looks sensible, but what about ibwdt_close() and
ibwdt_notify_sys()?  They're doing

		outb_p(wd_times[wd_margin], WDT_STOP);

which also seems peculiar.

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

* Re: [PATCH] ib700wdt watchdog driver for 2.6.6
  2004-05-11  8:32 ` Andrew Morton
@ 2004-05-11  9:01   ` Patrice Bouchand
  2004-05-11  9:11     ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: Patrice Bouchand @ 2004-05-11  9:01 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

> The patch certainly looks sensible, but what about ibwdt_close() and
> ibwdt_notify_sys()?  They're doing
>
> 		outb_p(wd_times[wd_margin], WDT_STOP);
>
> which also seems peculiar.


	The value written in the WDT_STOP register is not important. As soon as something is written , the watchdog timer stops.
 But you are right, things will be cleaner if we use the following patch.

	Thanks for the comments.

	Best regards

			Patrice Bouchand

-----------------------------------------------------------------------------------------------------------------------------------
--- ./ib700wdt.c.orig   2004-05-10 08:57:54.000000000 +0200
+++ ib700wdt.c  2004-05-11 10:50:54.000000000 +0200
@@ -135,7 +135,7 @@
 ibwdt_ping(void)
 {
        /* Write a watchdog value */
-       outb_p(wd_times[wd_margin], WDT_START);
+       outb_p(wd_margin, WDT_START);
 }

 static ssize_t
@@ -234,7 +234,7 @@
 {
        spin_lock(&ibwdt_lock);
        if (expect_close == 42)
-               outb_p(wd_times[wd_margin], WDT_STOP);
+               outb_p(wd_margin, WDT_STOP);
        else
                printk(KERN_CRIT PFX "WDT device closed unexpectedly.  WDT will not stop!\n");

@@ -254,7 +254,7 @@
 {
        if (code == SYS_DOWN || code == SYS_HALT) {
                /* Turn the WDT off */
-               outb_p(wd_times[wd_margin], WDT_STOP);
+               outb_p(wd_margin, WDT_STOP);
        }
        return NOTIFY_DONE;
 }



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

* Re: [PATCH] ib700wdt watchdog driver for 2.6.6
  2004-05-11  9:01   ` Patrice Bouchand
@ 2004-05-11  9:11     ` Andrew Morton
  2004-05-11  9:21       ` Patrice Bouchand
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2004-05-11  9:11 UTC (permalink / raw)
  To: Patrice Bouchand; +Cc: linux-kernel

Patrice Bouchand <PBouchand@cyberdeck.com> wrote:
>
>  	The value written in the WDT_STOP register is not important. As soon as something is written , the watchdog timer stops.
>   But you are right, things will be cleaner if we use the following patch.
> 
>  	Thanks for the comments.
> 
>  	Best regards
> 
>  			Patrice Bouchand
> 
>  -----------------------------------------------------------------------------------------------------------------------------------
>  --- ./ib700wdt.c.orig   2004-05-10 08:57:54.000000000 +0200
>  +++ ib700wdt.c  2004-05-11 10:50:54.000000000 +0200
>  @@ -135,7 +135,7 @@
>   ibwdt_ping(void)
>   {
>          /* Write a watchdog value */
>  -       outb_p(wd_times[wd_margin], WDT_START);
>  +       outb_p(wd_margin, WDT_START);

It would be clearer still if we wrote a simple 0 in there.  Does that
sounds OK?

btw, please send patches in `patch -p1' format, as below.  And your mailer
seems to be converting tabs to spaces.

Thanks.




From: Patrice Bouchand <PBouchand@cyberdeck.com>

The value written in the WDT_STOP register is not important.  As soon as
something is written, the watchdog timer stops.  But things will be cleaner
if we use the following patch.


---

 25-akpm/drivers/char/watchdog/ib700wdt.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff -puN drivers/char/watchdog/ib700wdt.c~ib700wdt-fix-2 drivers/char/watchdog/ib700wdt.c
--- 25/drivers/char/watchdog/ib700wdt.c~ib700wdt-fix-2	2004-05-11 02:10:55.148368032 -0700
+++ 25-akpm/drivers/char/watchdog/ib700wdt.c	2004-05-11 02:11:10.226075872 -0700
@@ -234,7 +234,7 @@ ibwdt_close(struct inode *inode, struct 
 {
 	spin_lock(&ibwdt_lock);
 	if (expect_close == 42)
-		outb_p(wd_times[wd_margin], WDT_STOP);
+		outb_p(0, WDT_STOP);
 	else
 		printk(KERN_CRIT PFX "WDT device closed unexpectedly.  WDT will not stop!\n");
 
@@ -254,7 +254,7 @@ ibwdt_notify_sys(struct notifier_block *
 {
 	if (code == SYS_DOWN || code == SYS_HALT) {
 		/* Turn the WDT off */
-		outb_p(wd_times[wd_margin], WDT_STOP);
+		outb_p(0, WDT_STOP);
 	}
 	return NOTIFY_DONE;
 }

_


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

* Re: [PATCH] ib700wdt watchdog driver for 2.6.6
  2004-05-11  9:11     ` Andrew Morton
@ 2004-05-11  9:21       ` Patrice Bouchand
  0 siblings, 0 replies; 5+ messages in thread
From: Patrice Bouchand @ 2004-05-11  9:21 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel


> It would be clearer still if we wrote a simple 0 in there.  Does that
> sounds OK?

	Yes, it is OK.

> btw, please send patches in `patch -p1' format, as below.  And your mailer
> seems to be converting tabs to spaces.

	Ok, I will take care about that the next times.

    Best regards

		Patrice Bouchand


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

end of thread, other threads:[~2004-05-11  9:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-10 15:57 [PATCH] ib700wdt watchdog driver for 2.6.6 Patrice Bouchand
2004-05-11  8:32 ` Andrew Morton
2004-05-11  9:01   ` Patrice Bouchand
2004-05-11  9:11     ` Andrew Morton
2004-05-11  9:21       ` Patrice Bouchand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox