From ad5c39fe2ae4dd67b228a61920690a259790e4a0 Mon Sep 17 00:00:00 2001 From: Hidetoshi Shimokawa Date: Fri, 24 Oct 2003 07:42:21 +0000 Subject: Don't check timeout just after booted. Some transactions could be considered wrongly to be timeout bacause interrupts are disabled during boot process. --- sys/dev/firewire/firewire.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/firewire/firewire.c b/sys/dev/firewire/firewire.c index 1fe9052d67225..d75b6ef1d1a3b 100644 --- a/sys/dev/firewire/firewire.c +++ b/sys/dev/firewire/firewire.c @@ -338,15 +338,27 @@ firewire_xfer_timeout(struct firewire_comm *fc) splx(s); } +#define WATCHDOC_HZ 10 static void firewire_watchdog(void *arg) { struct firewire_comm *fc; + static int watchdoc_clock = 0; fc = (struct firewire_comm *)arg; - firewire_xfer_timeout(fc); - fc->timeout(fc); - callout_reset(&fc->timeout_callout, hz / 10, + + /* + * At boot stage, the device interrupt is disabled and + * We encounter a timeout easily. To avoid this, + * ignore clock interrupt for a while. + */ + if (watchdoc_clock > WATCHDOC_HZ * 15) { + firewire_xfer_timeout(fc); + fc->timeout(fc); + } else + watchdoc_clock ++; + + callout_reset(&fc->timeout_callout, hz / WATCHDOC_HZ, (void *)firewire_watchdog, (void *)fc); } -- cgit v1.3