From f39fbdd70545e5a375029d7c59616b06ef675023 Mon Sep 17 00:00:00 2001 From: yongari Date: Tue, 22 Aug 2006 02:32:48 +0000 Subject: It seems that em(4) misses Tx completion interrupts under certain conditions. The cause of missing Tx completion interrupts comes from Tx interrupt moderation mechanism(delayed interrupts) or chipset bug. If Tx interrupt moderation mechanism is the cause of false watchdog timeout error we should have to fix all device drivers that have Tx interrupt moderation capability. We may need more investigation for this issue. Anyway, the fix is the same for both cases. This should fix occasional watchdog timeout errors seen on a few systems. Reported by: -net, Patrick M. Hausen < hausen AT punkt DOT de > Tested by: Patrick M. Hausen < hausen AT punkt DOT de > --- sys/dev/em/if_em.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'sys') diff --git a/sys/dev/em/if_em.c b/sys/dev/em/if_em.c index 340520a..400d0e3 100644 --- a/sys/dev/em/if_em.c +++ b/sys/dev/em/if_em.c @@ -946,6 +946,18 @@ em_watchdog(struct ifnet *ifp) return; } + /* + * Reclaim first as there is a possibility of losing Tx completion + * interrupts. Possible cause of missing Tx completion interrupts + * comes from Tx interrupt moderation mechanism(delayed interrupts) + * or chipset bug. + */ + em_txeof(adapter); + if (adapter->num_tx_desc_avail == adapter->num_tx_desc) { + EM_UNLOCK(adapter); + return; + } + if (em_check_for_link(&adapter->hw) == 0) device_printf(adapter->dev, "watchdog timeout -- resetting\n"); -- cgit v1.1