All of lore.kernel.org
 help / color / mirror / Atom feed
* i810-tco : odd behavior, odd driver ?
@ 2003-04-02 18:30 Paul Rolland
  0 siblings, 0 replies; only message in thread
From: Paul Rolland @ 2003-04-02 18:30 UTC (permalink / raw)
  To: linux-kernel; +Cc: 'Paul Rolland'

Hello,

I'm using a Super P4SGE motherboard, that does include the i810 
watchdog.
I did compile a 2.4.20 Linux kernel with support for this watchdog,
but the results are rather strange, as the machine keeps rebooting
every 5-6 minutes :
last says :
....
reboot   system boot  2.4.20-watchdog  Wed Apr  2 17:16          (00:52)

reboot   system boot  2.4.20-watchdog  Wed Apr  2 17:09          (00:59)

reboot   system boot  2.4.20-watchdog  Wed Apr  2 17:03          (01:05)

reboot   system boot  2.4.20-watchdog  Wed Apr  2 16:59          (01:09)

reboot   system boot  2.4.20-watchdog  Wed Apr  2 16:54          (01:14)

reboot   system boot  2.4.20-watchdog  Wed Apr  2 16:49          (01:19)

reboot   system boot  2.4.20-watchdog  Wed Apr  2 16:44          (01:23)

reboot   system boot  2.4.20-watchdog  Wed Apr  2 16:38          (01:30)

reboot   system boot  2.4.20-watchdog  Wed Apr  2 16:30          (01:38)

...

The code to stop the watchdog is :
int getWatchdogFd(void)
{
  int fd;

  fd = open("/dev/watchdog", O_RDWR);
  if (-1 == fd)
    printf("Error opening /dev/watchdog : %s\n", strerror(errno));

  return(fd);
}
...
        fd = getWatchdogFd();
        option = WDIOS_DISABLECARD;
        if (-1 == ioctl(fd, WDIOC_SETOPTIONS, &option)) {
          printf("Error disabling watchdog [%d]\n", errno);
        } else {
          printf("Watchdog disabled\n");
        } /* endif */
        write(fd,"V",1);
        close(fd);

Calling this code results in some OK, and at least, by writing 'V', I
don't have the "Unexpected close, not stopping watchdog!" message.

By changing the driver code, I now know that the hardware I have is 
identified as :
PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801E_0
in the PCI table list.

So, I went to Intel documentation, and I got two big points :
Doc 273599-001, Page 278 :
TCO1_TMR : The timer is clocked approximately 0.6 seconds, and this
allows
time-outs ranging from 2.4 s to 38 s.

-> How is it possible that my system waits from 5-6 minutes before
restarting,
when the driver initialized this time-out to 30 seconds, as it is the
default
value ???

Same doc, page 281 :
TCO1_CNT is a 16bits register.
While I was at school, I was told that accessing a 16bits reg must be
done using 16bit operands.
The code, however does some awful :
unsigned char val;
val = inb(TCO1_CNT + 1)
and does access the 8higher bit by reading an 8 bit value at the 
register address + 1....
Is this correct ?

What can I do / test / ??? to have this watchdog running ?

Regards,
Paul, rol@as2917.net


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-04-02 18:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-02 18:30 i810-tco : odd behavior, odd driver ? Paul Rolland

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.