[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <4A672B97.1070704@emlix.com>
Date: Wed, 22 Jul 2009 17:09:11 +0200
From: Simon Braunschmidt <sb@...ix.com>
To: linux-kernel@...r.kernel.org
CC: wim@...ana.be
Subject: Handling multiple watchdogs
Hi
I have two watchdogs on my board that I both want to handle. What would
be the proper approach in this case?
What I can see currently is that most (all?) watchdogs register as
chardev 10:130, that breaks when registering more than one.
I work around this in my private tree by something like:
-------8<-----------------
#ifndef WATCHDOG_MINOR
#define WATCHDOG_MINOR 130
#endif
#define WATCHDOG0_MINOR 212
#define WATCHDOG_NUMDEVS 2
static struct watchdog_dev_id watchdog_possible_devs[] = {
[0] = {
.minor = WATCHDOG_MINOR,
.name = "watchdog",
},
[1] = {
.minor = WATCHDOG0_MINOR,
.name = "watchdog0",
},
};
/* watchdogs can also use unusual minor numbers, try them when we fail*/
for (i = 0; i < WATCHDOG_NUMDEVS; i++) {
wdt_miscdev.minor=watchdog_possible_devs[i].minor;
wdt_miscdev.name=watchdog_possible_devs[i].name;
ret = misc_register(&wdt_miscdev);
if (ret == 0) break;
printk(KERN_INFO PFX
"failed to register miscdev on minor=%d (err=%d)\n",
wdt_miscdev.minor, ret);
}
if (ret != 0) {
goto unreg_reboot;
}
----------------->8---------
Which gives me an additional watchdog chardevice on 10:212.
This approach is probably not the best, so i am not asking for inclusion
of such a change. One solution would be to expose the watchdogs
individually like
/dev/watchdog0, /dev/watchdog1 and so on and to expose a combined
interface under /dev/watchdog.
I have searched the list and found some related discussion like
http://article.gmane.org/gmane.linux.kernel/398831/match=watchdogs
other threads and
http://git.kernel.org/?p=linux/kernel/git/wim/linux-2.6-watchdog-experimental.git;a=summary
, yet it does not seem like this reached mainline so far.
Any sharing of thoughts on the subject would be welcome.
Best Regards
Simon Braunschmidt
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists