summaryrefslogtreecommitdiff
path: root/drivers/net/tg3.c
diff options
context:
space:
mode:
authorMichael Chan <mchan@broadcom.com>2006-09-27 16:00:40 -0700
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-28 18:01:35 -0700
commit130b8e4d0e4edadcecee9fdff2c32f33d77c4fe9 (patch)
tree1c0f165309fa5a6b5d23fdad038ae932470d0cf9 /drivers/net/tg3.c
parent3d3ebe741b2c06fe3df67739d09f6ef0e25ee41a (diff)
downloadlinux-3.10-130b8e4d0e4edadcecee9fdff2c32f33d77c4fe9.tar.gz
linux-3.10-130b8e4d0e4edadcecee9fdff2c32f33d77c4fe9.tar.bz2
linux-3.10-130b8e4d0e4edadcecee9fdff2c32f33d77c4fe9.zip
[TG3]: Improve ASF heartbeat.
Change to a different ASF heartbeat message code to improve reliability. There were some reports of unintended resets on real time kernels where the timer may be slow and cause the heartbeat to be late. Netpoll will also have the same problem because the timer irq will be unavailable. Using the new heartbeat code, the ASF firmware will also check the ring condition before resetting the chip when the heartbeat is expiring. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tg3.c')
-rw-r--r--drivers/net/tg3.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 4eef798fbb7..6af8ebcf35f 100644
--- a/drivers/net/tg3.c
+++ b/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);