* [PATCH 2/9][TG3]: Improve ASF heartbeat.
@ 2006-09-27 20:34 Michael Chan
2006-09-27 23:01 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Michael Chan @ 2006-09-27 20:34 UTC (permalink / raw)
To: davem, linville; +Cc: netdev
[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>
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 4eef798..6af8ebc 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -6690,13 +6690,29 @@ static void tg3_timer(unsigned long __op
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/drivers/net/tg3.h b/drivers/net/tg3.h
index f9c81ba..f7462c2 100644
--- a/drivers/net/tg3.h
+++ b/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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 2/9][TG3]: Improve ASF heartbeat.
2006-09-27 20:34 [PATCH 2/9][TG3]: Improve ASF heartbeat Michael Chan
@ 2006-09-27 23:01 ` David Miller
2006-09-27 23:08 ` Michael Chan
0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2006-09-27 23:01 UTC (permalink / raw)
To: mchan; +Cc: linville, netdev
From: "Michael Chan" <mchan@broadcom.com>
Date: Wed, 27 Sep 2006 13:34:25 -0700
> [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>
Applied.
But what exactly is meant by "checking the ring condition"?
Does it mean that if the ASF heartbeat times out, ASF will
check to see if the TX and/or RX ring are still making forward
progress and abort the reset if so?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 2/9][TG3]: Improve ASF heartbeat.
2006-09-27 23:01 ` David Miller
@ 2006-09-27 23:08 ` Michael Chan
0 siblings, 0 replies; 3+ messages in thread
From: Michael Chan @ 2006-09-27 23:08 UTC (permalink / raw)
To: David Miller; +Cc: linville, netdev
On Wed, 2006-09-27 at 16:01 -0700, David Miller wrote:
> But what exactly is meant by "checking the ring condition"?
>
> Does it mean that if the ASF heartbeat times out, ASF will
> check to see if the TX and/or RX ring are still making forward
> progress and abort the reset if so?
>
Exactly. If the rx ring is not empty, it will check to see if the
consumer index of the rx ring is making forward progress.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-09-27 23:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-27 20:34 [PATCH 2/9][TG3]: Improve ASF heartbeat Michael Chan
2006-09-27 23:01 ` David Miller
2006-09-27 23:08 ` Michael Chan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).