Bug 42801

Summary: IT87 watchdog timer driver not working
Product: Drivers Reporter: Mark (bugzilla-kernel-org-sux2k0)
Component: WatchdogAssignee: Wim Van Sebroeck (wim)
Status: ASSIGNED ---    
Severity: normal CC: bugzilla-kernel-org-sux2k0, szg00000, wim, x0r+kernel
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: up to 3.3rc4 Subsystem:
Regression: No Bisected commit-id:
Attachments: spec page 1
spec page 2
Workaround in case Consumer IR Buffer Underrun interrupts don't work

Description Mark 2012-02-20 20:03:29 UTC
Created attachment 72451 [details]
spec page 1

The watchdog daemon resets the driver via /dev/watchdog, but the machine nonetheless resets after 60 seconds.

$ modprobe it87_wdt
$ dmesg | tail -n 1
[173619.473716] IT87 WDT: Chip IT8720 revision 8 initialized. timeout=60 sec (nowayout=0 testmode=0 exclusive=1 nogameport=0)

It seems the kernel driver does not update using the correct order.

Here is what ITE sent me (including the two attachments):

1. If you wanted WDT to stop, you will need to set ¡§index 74(HWB)¡¨ and
¡§index 73h(LSB)¡¨ to 00h

2. If you wanted WDT to restart. You will need to first set ¡§index
74h(HWB)¡¨ values then set ¡§index 73h(LSB)¡¨afterwards.

Example

           writeport ( 0x72 , 0xD0)

           writeport ( 0x74 , 0x00)

           writeport ( 0x73 , 0x0F)

/ / ¡K

1. WDT to stop

           writeport ( 0x74 , 0x00)

           writeport ( 0x73 , 0x00)

2. WDT to restart

           writeport ( 0x74 , 0x00)

           writeport ( 0x73 , 0x0F)

Watch Dog Timer Spec

IT8720 LDN 07 about WDT

Register Detail Spec



See also: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/932381
Comment 1 Mark 2012-02-20 20:03:50 UTC
Created attachment 72452 [details]
spec page 2
Comment 2 Mark 2012-02-20 20:05:39 UTC
The order of 74h-73h-updates doesn't seem to be the issue. Tested that. If someone has any idea what to try, I'll be happy to assist.
Comment 3 Marc van der Wal 2014-02-28 09:11:24 UTC
I have had the same problem with an IT8728 chip. From what I understand, this driver uses the Consumer IR Buffer Underrun interrupt to reset the watchdog timer, and triggers this interrupt by writing one byte to the output register while remaining in loopback test mode.

On the specific platform on which the IT8728 chip was implemented, I found a real-mode driver (using INT 15h calls) which resets the timer by calling what seems like a "write timeout in the timeout configuration register" command whenever it needs to reset the timer.

My workaround was to reset the timer by writing the interval again and again in the right configuration register.  This worked for me: I achieved 3 days uptime on the machine I tested on, after sending SIGSTOP to the watchdog daemon process and causing a reboot within one minute.

The following patch is a workaround in case the Consumer IR Buffer Underrun interrupt method doesn't work.  I have added a "nocir" module option, 0 by default, in order not to break existing and working setups.  Setting "nocir=1" enables the workaround.
Comment 4 Marc van der Wal 2014-02-28 09:13:47 UTC
Created attachment 127661 [details]
Workaround in case Consumer IR Buffer Underrun interrupts don't work

This is initially a patch to the 3.5.7 kernel but also applies fine on 3.10.28. I know I should have tried on the very latest kernels, but I'll assume the it87 driver hasn't changed since then.