lkml.org 
[lkml]   [2002]   [Feb]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [DRIVER][RFC] SC1200 Watchdog driver
Date
From
> Put the GETTIMEOUT stuff in an ioctl, heres my current version, it 
> implements a number of the ioctls as well as the reboot notifier and
> semaphores for locking.

Aside from the other comments Jeff made its got one bug that I only noticed
because I fixed it in a pile of other stuff 8)

> /* Write to Data Register */
> static inline void sc1200wdt_write_data(unsigned char index, unsigned char data)
> {
> outb_p(index, PMIR);
> outb(data, PMDR);
> }

two instruction sequence

> case WDIOC_KEEPALIVE:
> sc1200wdt_write_data(WDTO, timeout);
> return 0;

open
fork
ioctl from two processes one per cpu at the same time

> static int sc1200wdt_release(struct inode *inode, struct file *file)
> {
> /* Disable it on the way out */
> sc1200wdt_write_data(WDTO, 0);
> up(&open_sem);

NOWAYOUT support is missing - trivial to fix. Just remember to MOD_INC_USE..
on the nowayout path

> static int sc1200wdt_notify_sys(struct notifier_block *this, unsigned long code, void *unused)
> {
> if (code == SYS_DOWN || code == SYS_HALT)
> sc1200wdt_write_data(WDTO, 0);

Ditto on the nowayout

Alan in pedantic mode

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:24    [from the cache]
©2003-2011 Jasper Spaans