public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oliver Schuster <oliver.s@inbox.com>
To: Wim Van Sebroeck <wim@iguana.be>
Cc: Oliver Schuster <olivers137@aol.com>,
	Andrew Paprocki <andrew@ishiboo.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH][WATCHDOG] v2.6.25-rc7: it8712f_wdt.c contains an error - was Re: [WATCHDOG] v2.5.25-rc patches
Date: Tue, 01 Apr 2008 17:06:21 +0200	[thread overview]
Message-ID: <47F24F6D.6000603@inbox.com> (raw)
In-Reply-To: <20080311210232.GE7505@infomag.infomag.iguana.be>

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

Hi,

i've mailed before to lkml and Andrew Paprocki (2008-03-12) directly.
But the original patch wasn't changed. Here's a patch to correct the
error.

Description of the error:
By introducing the support of 16 Bit timer values for later it8712 an
error was made. The value is stored through superio_outw() which cause,
that the upper Byte is in the Register called "Watch Dog Timer Time-Out
Value (LSB) Register" and the lower in "Watch Dog Timer Time-Out Value
(MSB) Register".

A common value is 60: stored this way the watchdog timer runs out
in 4h 16mins. In case of a deadlocked server this is a long time to
wait, before the service comes back!

Regards,
Oliver

Wim Van Sebroeck schrieb:
> Hi Oliver,
> 
>> this patch can cause serious problems in the case, that someone use it 
>> with an it8712 rev. 8 and above.
> ...
>> Your patch changes it8712f_wdt.c in function t8712f_wdt_update_margin():
>>
>>> -	superio_outb((margin > 255) ? (margin / 60) : margin, WDT_TIMEOUT);
>>> +	if (revision >= 0x08)
>>> +		superio_outw(units, WDT_TIMEOUT);
>>> +	else
>>> +		superio_outb(units, WDT_TIMEOUT);
>> but here you can't use superio_outw, because the bytes are swapped 
>> --historical reason.
>>
>> I suggest to substitute
>> 	superio_outw(units, WDT_TIMEOUT);
>> with
>> 	superio_outb(units >> 8, WDT_TIMEOUT + 1);
>> 	superio_outb(units, WDT_TIMEOUT);
>>
> 
> Can you keep "Andrew Paprocki" <andrew@ishiboo.com> in the loop?
> Can you also create a patch and test it together with Andrew?
> We need to make sure that we fix this before 2.6.25 is there.
> 
> Thanks,
> Wim



[-- Attachment #2: 2.6.25-rc7-it8712f_wdt.patch --]
[-- Type: text/x-patch, Size: 902 bytes --]

This patch corrects an error in the driver it8712f_wdt

Signed-off-by: Oliver Schuster <olivers137@aol.com>

===

diff -urP linux-2.6.25-rc7/drivers/watchdog/it8712f_wdt.c linux-2.6.25-rc7-aaa/drivers/watchdog/it8712f_wdt.c
--- linux-2.6.25-rc7/drivers/watchdog/it8712f_wdt.c	2008-03-26 02:38:14.000000000 +0100
+++ linux-2.6.25-rc7-aaa/drivers/watchdog/it8712f_wdt.c	2008-04-01 16:45:22.396931807 +0200
@@ -111,15 +111,6 @@
 	return val;
 }
 
-static void
-superio_outw(int val, int reg)
-{
-	outb(reg++, REG);
-	outb((val >> 8) & 0xff, VAL);
-	outb(reg, REG);
-	outb(val & 0xff, VAL);
-}
-
 static inline void
 superio_select(int ldn)
 {
@@ -170,9 +161,8 @@
 	superio_outb(config, WDT_CONFIG);
 
 	if (revision >= 0x08)
-		superio_outw(units, WDT_TIMEOUT);
-	else
-		superio_outb(units, WDT_TIMEOUT);
+		superio_outb(units >> 8, WDT_TIMEOUT + 1);
+	superio_outb(units, WDT_TIMEOUT);
 }
 
 static int

  reply	other threads:[~2008-04-01 15:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-10 20:14 [WATCHDOG] v2.5.25-rc patches Wim Van Sebroeck
2008-03-11 18:14 ` Oliver Schuster
2008-03-11 21:02   ` Wim Van Sebroeck
2008-04-01 15:06     ` Oliver Schuster [this message]
2008-04-01 15:27       ` [PATCH][WATCHDOG] v2.6.25-rc7: it8712f_wdt.c contains an error - was " Andrew Paprocki

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=47F24F6D.6000603@inbox.com \
    --to=oliver.s@inbox.com \
    --cc=akpm@linux-foundation.org \
    --cc=andrew@ishiboo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olivers137@aol.com \
    --cc=torvalds@linux-foundation.org \
    --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