Skip to contentSkip to conversation

[2.4] Watchdog wdt977 (Winbond W83977EF) driver

PATCH Tal Kelrich 2 participants 4 messages Apr 1, 2007 – Apr 10, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

(resent due to mailer stupidity)
Hello,

This is my first submitted kernel patch, please be gentle.

Tested and working on AAEON GENE-6310B Subcompact Board (also configured for same by default, should work elsewhere) patch is against kernel 2.4.34.2

Changes/Features:

Added ioctl support
Disables watchdog on driver load
Supports timeout in seconds
Timeout defaults to 2 minutes
No longer under NetWinder arch
Configurable output GP (defaults to GP16)
Configurable base IO address
Non standard read only proc interface for status (/proc/watchdog)

Caveats:

No idea if this breaks netwinder, although it really shouldn't Only tested with GP16
Utterly ignores inability to get its IO port, mostly because it's already taken. I didn't know a way around that. release_region is called regardless of having acquired the region, this might be trouble.

Signature · 6 lines
Tal Kelrich
PGP fingerprint: 3EDF FCC5 60BB 4729 AB2F  CAE6 FEC1 9AAC 12B9 AA69
Key Available at: http://www.hasturkun.com/pub.txt
----
To err is human, to forgive is against company policy.
----
drivers/char/Config.in +1 -3
diff -udr linux-2.4.34.2/drivers/char/Config.in linux-2.4.34.2-wdt977/drivers/char/Config.in
@@ -247,10 +247,8 @@
    tristate '  Berkshire Products PC Watchdog' CONFIG_PCWATCHDOG
    if [ "$CONFIG_FOOTBRIDGE" = "y" ]; then
       tristate '  DC21285 watchdog' CONFIG_21285_WATCHDOG
-      if [ "$CONFIG_ARCH_NETWINDER" = "y" ]; then
-         tristate '  NetWinder WB83C977 watchdog' CONFIG_977_WATCHDOG
-      fi
    fi
+   tristate '  Winbond W83977EF Watchdog Timer' CONFIG_977_WATCHDOG
    tristate '  Eurotech CPU-1220/1410 Watchdog Timer' CONFIG_EUROTECH_WDT
    tristate '  IB700 SBC Watchdog Timer' CONFIG_IB700_WDT
    tristate '  ICP ELectronics Wafer 5823 Watchdog' CONFIG_WAFER_WDT
drivers/char/wdt977.c +215 -97

406 lines not on this page · raw message

#1 lore raw

Hello,

Quoted 20 lines · Tal Kelrich

(resent due to mailer stupidity)
Hello,

This is my first submitted kernel patch, please be gentle.

Tested and working on AAEON GENE-6310B Subcompact Board (also configured for same by default, should work elsewhere) patch is against kernel 2.4.34.2

Changes/Features:

Added ioctl support
Disables watchdog on driver load
Supports timeout in seconds
Timeout defaults to 2 minutes
No longer under NetWinder arch
Configurable output GP (defaults to GP16)
Configurable base IO address
Non standard read only proc interface for status (/proc/watchdog)

Quoted 8 lines

Caveats:

No idea if this breaks netwinder, although it really shouldn't Only tested with GP16
Utterly ignores inability to get its IO port, mostly because it's already taken. I didn't know a way around that. release_region is called regardless of having acquired the region, this might be trouble.

While I have no particular problem merging your other driver since it did not previously exist, I don't like much this one being massively changed like this, particularly when you cannot test whether it breaks its original platform (netwinder). I've also noticed that your patch removes some locking, so I'm even doubting that it will not break NetWinder.

A less risky solution would be to make a new driver of it (eg: w93977.c instead of wdt977.c). Also, if you proceed like this, please do not forget to write an entry in Configure.help.

Regards,
Willy

#2 lore raw

Re: [2.4] Watchdog w83977ef (Winbond W83977EF) driver

Quoted 39 lines · On Mon, 2 Apr 2007 07:38:34 +0200 Willy Tarreau <[email protected]> wrote:

Hello,

Quoted 20 lines · Tal Kelrich

(resent due to mailer stupidity)
Hello,

This is my first submitted kernel patch, please be gentle.

Tested and working on AAEON GENE-6310B Subcompact Board (also configured for same by default, should work elsewhere) patch is against kernel 2.4.34.2

Changes/Features:

Added ioctl support
Disables watchdog on driver load
Supports timeout in seconds
Timeout defaults to 2 minutes
No longer under NetWinder arch
Configurable output GP (defaults to GP16)
Configurable base IO address
Non standard read only proc interface for status (/proc/watchdog)

Quoted 8 lines

Caveats:

No idea if this breaks netwinder, although it really shouldn't Only tested with GP16
Utterly ignores inability to get its IO port, mostly because it's already taken. I didn't know a way around that. release_region is called regardless of having acquired the region, this might be trouble.

While I have no particular problem merging your other driver since it did not previously exist, I don't like much this one being massively changed like this, particularly when you cannot test whether it breaks its original platform (netwinder). I've also noticed that your patch removes some locking, so I'm even doubting that it will not break NetWinder.

Quoted 7 lines

A less risky solution would be to make a new driver of it (eg:
w93977.c instead of wdt977.c). Also, if you proceed like this, please do not forget to write an entry in Configure.help.

Regards,
Willy

Updated with your comments in mind,
now a seperate driver, added info to Configure.help

Regards,
Tal Kelrich

Signature · 7 lines
Tal Kelrich
PGP fingerprint: 3EDF FCC5 60BB 4729 AB2F  CAE6 FEC1 9AAC 12B9 AA69
Key Available at: http://www.hasturkun.com/pub.txt
----
"I'm a mean green mother from outer space"
 -- Audrey II, The Little Shop of Horrors
----
Documentation/Configure.help +7 -0
@@ -20559,6 +20559,13 @@
   computer, say `Y' here to support its built-in watchdog timer
   feature.  See the help for CONFIG_WATCHDOG for discussion.
 
+Winbond W83977EF Watchdog Timer
+CONFIG_W83977EF_WDT
+   This is a driver for the hardware watchdog on the W83977EF chipset.
+   To compile this driver as a module say M here. The module will be
+   named wdt83977.o
+   Most people will say N.
+
 ALi M7101 Watchdog Timer
 CONFIG_ALIM7101_WDT
   This is the driver for the hardware watchdog on the ALi M7101 PMU
drivers/char/Config.in +1 -0
@@ -276,6 +276,7 @@
    if [ "$CONFIG_8xx" = "y" ]; then
       tristate '  MPC8xx Watchdog Timer' CONFIG_8xx_WDT
    fi
+   tristate '  Winbond W83977EF Watchdog Timer' CONFIG_W83977EF_WDT
 fi
 endmenu
 
drivers/char/Makefile +1 -0
@@ -323,6 +323,7 @@
 obj-$(CONFIG_SOFT_WATCHDOG) += softdog.o
 obj-$(CONFIG_INDYDOG) += indydog.o
 obj-$(CONFIG_8xx_WDT) += mpc8xx_wdt.o
+obj-$(CONFIG_W83977EF_WDT) += wdt83977.o
 
 subdir-$(CONFIG_MWAVE) += mwave
 ifeq ($(CONFIG_MWAVE),y)
drivers/char/wdt83977.c +350 -0

350 lines not on this page · raw message

#3 lore raw

Re: [2.4] Watchdog w83977ef (Winbond W83977EF) driver

On Tue, Apr 10, 2007 at 02:54:32PM +0300, Tal Kelrich wrote:
(...)

Quoted 2 lines

Updated with your comments in mind,
now a seperate driver, added info to Configure.help

Looks OK to me at first glance. I will review it a little more, and most probably merge it.

Thanks !
Willy