public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* how to allow board writers to customize driver behavior (watchdog here)
@ 2007-05-24  4:21 Mike Frysinger
  2007-05-24  5:23 ` Paul Mundt
  2007-05-24 10:01 ` Alan Cox
  0 siblings, 2 replies; 13+ messages in thread
From: Mike Frysinger @ 2007-05-24  4:21 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Bryan Wu

the Blackfin on-chip watchdog has controllable behavior ... it can be
configured to reset the processor (like a normal watchdog), or it can
be configured to simply generate an interrupt.

i can see embedded systems where simply resetting the system is not
desirable ... perhaps it's the control system for some machinery and
resetting the system will force it to reinitialize itself which could
cause problems if a guy is servicing the insides at the time ;)

the Blackfin watchdog driver has a module parameter, "action" ... the
default will have the watchdog act like every other watchdog out there
-- it reboots after a timeout.  however, by setting the action param
appropriately, the watchdog goes into simple interrupt generation.
the question then becomes, how do people developing their
board-specific version customize what happens when the timeout occurs
and the interrupt is fired ?  making every customer who wishes to
customize the watchdog behavior edit the watchdog driver is
troublesome as they're now blurring the distinct parts: the
watchdog-specific piece and their board-specific piece.

what i'm doing now is weak symbols:
...
extern irqreturn_t bfin_board_watchdog_interrupt(void) __attribute__((weak));
static irqreturn_t bfin_wdt_interrupt(int irq, void *dev_id)
{
    if (bfin_board_watchdog_interrupt) {
        return bfin_board_watchdog_interrupt();
    } else {
        bfin_wdt_stop();
        bfin_wdt_keepalive();
        bfin_wdt_start();
        return IRQ_HANDLED;
    }
}
...

is this completely bad mojo ?  is there some other mechanism that
provides what i want and i just dont know about it ?  or do i just
make people change the driver to fit their application, thus throwing
out the idea of keeping all board-specific details in just the boards
file ...
-mike

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2007-05-25 17:55 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-24  4:21 how to allow board writers to customize driver behavior (watchdog here) Mike Frysinger
2007-05-24  5:23 ` Paul Mundt
2007-05-24  8:47   ` Daniel Newby
2007-05-24  9:32     ` Paul Mundt
2007-05-24 15:08     ` Mike Frysinger
2007-05-24 13:29   ` Robin Getz
2007-05-24 15:23     ` Paul Mundt
2007-05-24 17:32       ` Robin Getz
2007-05-25  4:04         ` Paul Mundt
2007-05-25 10:09           ` Daniel Newby
2007-05-25 17:55             ` Mike Frysinger
2007-05-24 15:12   ` Mike Frysinger
2007-05-24 10:01 ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox