Patch for drivers/char/pcwd.c in 2.1.72

Richard Gooch (rgooch@atnf.CSIRO.AU)
Wed, 10 Dec 1997 22:15:14 +1100


Hi, Linus. The following patch disables the Berkshire Products
watchdog when the driver is initialised. This is required because
sometimes the card is still counting down after a reboot, so early
disabling of the card is desirable. I've also noticed that loading the
module can trip (tickle) the card to start counting down (this is
presumably because the probing of the ports is mis-interpreted as a
tickle operation), even though it's not really supposed to do that. If
the driver is initialised and causes false tickling long before the
watchdog daemon starts, you can end up with the watchdog timing out
:-(

The patch is against 2.1.72. Could you include this for 2.1.73 please?

Regards,

Richard....

--- pcwd.c-orig Sun Nov 30 11:36:13 1997
+++ pcwd.c Wed Dec 10 22:01:26 1997
@@ -30,6 +30,7 @@
* code bits, and added compatibility to 2.1.x.
* 970912 Enabled board on open and disable on close.
* 971107 Took account of recent VFS changes (broke read).
+ * 971210 Disable board on initialisation in case board already ticking.
*/

#include <linux/module.h>
@@ -578,6 +579,12 @@
debug_off();

pcwd_showprevstate();
+
+ /* Disable the board */
+ if (revision == PCWD_REVISION_C) {
+ outb_p(0xA5, current_readport + 3);
+ outb_p(0xA5, current_readport + 3);
+ }

if (revision == PCWD_REVISION_A)
request_region(current_readport, 2, "PCWD Rev.A (Berkshire)");