From 88eca8bf6da6f7c6c58b4fb396f37d1ac575e700 Mon Sep 17 00:00:00 2001 From: Michael Chan Date: Wed, 27 Sep 2006 16:00:40 -0700 Subject: [PATCH] --- yaml --- r: 36814 b: refs/heads/master c: 130b8e4d0e4edadcecee9fdff2c32f33d77c4fe9 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/net/tg3.c | 20 ++++++++++++++++++-- trunk/drivers/net/tg3.h | 1 + 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 6e9bbff0ebab..f2e0d3b70233 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3d3ebe741b2c06fe3df67739d09f6ef0e25ee41a +refs/heads/master: 130b8e4d0e4edadcecee9fdff2c32f33d77c4fe9 diff --git a/trunk/drivers/net/tg3.c b/trunk/drivers/net/tg3.c index 4eef798fbb7b..6af8ebcf35f0 100644 --- a/trunk/drivers/net/tg3.c +++ b/trunk/drivers/net/tg3.c @@ -6690,13 +6690,29 @@ static void tg3_timer(unsigned long __opaque) tp->timer_counter = tp->timer_multiplier; } - /* Heartbeat is only sent once every 2 seconds. */ + /* Heartbeat is only sent once every 2 seconds. + * + * The heartbeat is to tell the ASF firmware that the host + * driver is still alive. In the event that the OS crashes, + * ASF needs to reset the hardware to free up the FIFO space + * that may be filled with rx packets destined for the host. + * If the FIFO is full, ASF will no longer function properly. + * + * Unintended resets have been reported on real time kernels + * where the timer doesn't run on time. Netpoll will also have + * same problem. + * + * The new FWCMD_NICDRV_ALIVE3 command tells the ASF firmware + * to check the ring condition when the heartbeat is expiring + * before doing the reset. This will prevent most unintended + * resets. + */ if (!--tp->asf_counter) { if (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) { u32 val; tg3_write_mem(tp, NIC_SRAM_FW_CMD_MBOX, - FWCMD_NICDRV_ALIVE2); + FWCMD_NICDRV_ALIVE3); tg3_write_mem(tp, NIC_SRAM_FW_CMD_LEN_MBOX, 4); /* 5 seconds timeout */ tg3_write_mem(tp, NIC_SRAM_FW_CMD_DATA_MBOX, 5); diff --git a/trunk/drivers/net/tg3.h b/trunk/drivers/net/tg3.h index f9c81baca8d8..f7462c2ccc0a 100644 --- a/trunk/drivers/net/tg3.h +++ b/trunk/drivers/net/tg3.h @@ -1537,6 +1537,7 @@ #define FWCMD_NICDRV_FIX_DMAR 0x00000005 #define FWCMD_NICDRV_FIX_DMAW 0x00000006 #define FWCMD_NICDRV_ALIVE2 0x0000000d +#define FWCMD_NICDRV_ALIVE3 0x0000000e #define NIC_SRAM_FW_CMD_LEN_MBOX 0x00000b7c #define NIC_SRAM_FW_CMD_DATA_MBOX 0x00000b80 #define NIC_SRAM_FW_ASF_STATUS_MBOX 0x00000c00