diff options
-rw-r--r-- | drivers/net/tg3.c | 20 | ||||
-rw-r--r-- | drivers/net/tg3.h | 1 |
2 files changed, 19 insertions, 2 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 4eef798fbb7b..6af8ebcf35f0 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -6690,13 +6690,29 @@ static void tg3_timer(unsigned long __opaque) | |||
6690 | tp->timer_counter = tp->timer_multiplier; | 6690 | tp->timer_counter = tp->timer_multiplier; |
6691 | } | 6691 | } |
6692 | 6692 | ||
6693 | /* Heartbeat is only sent once every 2 seconds. */ | 6693 | /* Heartbeat is only sent once every 2 seconds. |
6694 | * | ||
6695 | * The heartbeat is to tell the ASF firmware that the host | ||
6696 | * driver is still alive. In the event that the OS crashes, | ||
6697 | * ASF needs to reset the hardware to free up the FIFO space | ||
6698 | * that may be filled with rx packets destined for the host. | ||
6699 | * If the FIFO is full, ASF will no longer function properly. | ||
6700 | * | ||
6701 | * Unintended resets have been reported on real time kernels | ||
6702 | * where the timer doesn't run on time. Netpoll will also have | ||
6703 | * same problem. | ||
6704 | * | ||
6705 | * The new FWCMD_NICDRV_ALIVE3 command tells the ASF firmware | ||
6706 | * to check the ring condition when the heartbeat is expiring | ||
6707 | * before doing the reset. This will prevent most unintended | ||
6708 | * resets. | ||
6709 | */ | ||
6694 | if (!--tp->asf_counter) { | 6710 | if (!--tp->asf_counter) { |
6695 | if (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) { | 6711 | if (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) { |
6696 | u32 val; | 6712 | u32 val; |
6697 | 6713 | ||
6698 | tg3_write_mem(tp, NIC_SRAM_FW_CMD_MBOX, | 6714 | tg3_write_mem(tp, NIC_SRAM_FW_CMD_MBOX, |
6699 | FWCMD_NICDRV_ALIVE2); | 6715 | FWCMD_NICDRV_ALIVE3); |
6700 | tg3_write_mem(tp, NIC_SRAM_FW_CMD_LEN_MBOX, 4); | 6716 | tg3_write_mem(tp, NIC_SRAM_FW_CMD_LEN_MBOX, 4); |
6701 | /* 5 seconds timeout */ | 6717 | /* 5 seconds timeout */ |
6702 | tg3_write_mem(tp, NIC_SRAM_FW_CMD_DATA_MBOX, 5); | 6718 | tg3_write_mem(tp, NIC_SRAM_FW_CMD_DATA_MBOX, 5); |
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h index f9c81baca8d8..f7462c2ccc0a 100644 --- a/drivers/net/tg3.h +++ b/drivers/net/tg3.h | |||
@@ -1537,6 +1537,7 @@ | |||
1537 | #define FWCMD_NICDRV_FIX_DMAR 0x00000005 | 1537 | #define FWCMD_NICDRV_FIX_DMAR 0x00000005 |
1538 | #define FWCMD_NICDRV_FIX_DMAW 0x00000006 | 1538 | #define FWCMD_NICDRV_FIX_DMAW 0x00000006 |
1539 | #define FWCMD_NICDRV_ALIVE2 0x0000000d | 1539 | #define FWCMD_NICDRV_ALIVE2 0x0000000d |
1540 | #define FWCMD_NICDRV_ALIVE3 0x0000000e | ||
1540 | #define NIC_SRAM_FW_CMD_LEN_MBOX 0x00000b7c | 1541 | #define NIC_SRAM_FW_CMD_LEN_MBOX 0x00000b7c |
1541 | #define NIC_SRAM_FW_CMD_DATA_MBOX 0x00000b80 | 1542 | #define NIC_SRAM_FW_CMD_DATA_MBOX 0x00000b80 |
1542 | #define NIC_SRAM_FW_ASF_STATUS_MBOX 0x00000c00 | 1543 | #define NIC_SRAM_FW_ASF_STATUS_MBOX 0x00000c00 |