diff mbox

[RESEND] igb: Reset TXPBSIZE to default value

Message ID 1421434779-20586-1-git-send-email-xander.huff@ni.com
State Not Applicable, archived
Delegated to: David Miller
Headers show

Commit Message

Xander Huff Jan. 16, 2015, 6:59 p.m. UTC
From: Jeff Westfahl <jeff.westfahl@ni.com>

The TXPBSIZE register of the i210 resets to its default value only
at power-on. It doesn't reset if you reboot the system, only if you
pull power. If something (another driver, another OS, etc.) modifies
this register from its default value, the igb driver doesn't function
correctly. It detects a hang of the transmitter and continuously resets
the adapter. Here we set this value to its default when resetting the
i210 to resolve this issue.

Signed-off-by: Jeff Westfahl <jeff.westfahl@ni.com>
Signed-off-by: Xander Huff <xander.huff@ni.com>
---
 drivers/net/ethernet/intel/igb/e1000_82575.c   | 4 ++++
 drivers/net/ethernet/intel/igb/e1000_defines.h | 3 +++
 drivers/net/ethernet/intel/igb/e1000_regs.h    | 1 +
 3 files changed, 8 insertions(+)

Comments

Vick, Matthew Jan. 16, 2015, 7:41 p.m. UTC | #1
On 1/16/15, 10:59 AM, "Xander Huff" <xander.huff@ni.com> wrote:

>From: Jeff Westfahl <jeff.westfahl@ni.com>
>
>The TXPBSIZE register of the i210 resets to its default value only
>at power-on. It doesn't reset if you reboot the system, only if you
>pull power. If something (another driver, another OS, etc.) modifies
>this register from its default value, the igb driver doesn't function
>correctly. It detects a hang of the transmitter and continuously resets
>the adapter. Here we set this value to its default when resetting the
>i210 to resolve this issue.

This should have already been resolved last May in commit
27dff8b2f680ce966b5d959be9d69dd0edd92e3b ("igb: add defaults for i210
TX/RX PBSIZE"). Are you running the latest upstream kernel?

Cheers,
Matthew

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Xander Huff Jan. 16, 2015, 8:09 p.m. UTC | #2
On 1/16/2015 1:41 PM, Vick, Matthew wrote:
> On 1/16/15, 10:59 AM, "Xander Huff" <xander.huff@ni.com> wrote:
>
>> From: Jeff Westfahl <jeff.westfahl@ni.com>
>>
>> The TXPBSIZE register of the i210 resets to its default value only
>> at power-on. It doesn't reset if you reboot the system, only if you
>> pull power. If something (another driver, another OS, etc.) modifies
>> this register from its default value, the igb driver doesn't function
>> correctly. It detects a hang of the transmitter and continuously resets
>> the adapter. Here we set this value to its default when resetting the
>> i210 to resolve this issue.
>
> This should have already been resolved last May in commit
> 27dff8b2f680ce966b5d959be9d69dd0edd92e3b ("igb: add defaults for i210
> TX/RX PBSIZE"). Are you running the latest upstream kernel?
>
> Cheers,
> Matthew
>
Looks like you're correct. Please disregard this patch.
diff mbox

Patch

diff --git a/drivers/net/ethernet/intel/igb/e1000_82575.c b/drivers/net/ethernet/intel/igb/e1000_82575.c
index 0f69ef8..855a39e 100644
--- a/drivers/net/ethernet/intel/igb/e1000_82575.c
+++ b/drivers/net/ethernet/intel/igb/e1000_82575.c
@@ -2238,6 +2238,10 @@  static s32 igb_reset_hw_82580(struct e1000_hw *hw)
 	wr32(E1000_TCTL, E1000_TCTL_PSP);
 	wrfl();
 
+	if (hw->mac.type == e1000_i210)
+		/* TXPBSIZE resets only on power-up. */
+		wr32(E1000_TXPBSIZE, E1000_TXPBSIZE_RESET);
+
 	usleep_range(10000, 11000);
 
 	/* Determine whether or not a global dev reset is requested */
diff --git a/drivers/net/ethernet/intel/igb/e1000_defines.h b/drivers/net/ethernet/intel/igb/e1000_defines.h
index 217f813..d8e3c59 100644
--- a/drivers/net/ethernet/intel/igb/e1000_defines.h
+++ b/drivers/net/ethernet/intel/igb/e1000_defines.h
@@ -305,6 +305,9 @@ 
 #define E1000_TCTL_COLD   0x003ff000    /* collision distance */
 #define E1000_TCTL_RTLC   0x01000000    /* Re-transmit on late collision */
 
+/* Transmit Packet Buffer Size */
+#define E1000_TXPBSIZE_RESET 0x04000014
+
 /* DMA Coalescing register fields */
 #define E1000_DMACR_DMACWT_MASK         0x00003FFF /* DMA Coal Watchdog Timer */
 #define E1000_DMACR_DMACTHR_MASK        0x00FF0000 /* DMA Coal Rx Threshold */
diff --git a/drivers/net/ethernet/intel/igb/e1000_regs.h b/drivers/net/ethernet/intel/igb/e1000_regs.h
index 6f0490d..7e2325b 100644
--- a/drivers/net/ethernet/intel/igb/e1000_regs.h
+++ b/drivers/net/ethernet/intel/igb/e1000_regs.h
@@ -60,6 +60,7 @@ 
 #define E1000_TCTL     0x00400  /* TX Control - RW */
 #define E1000_TCTL_EXT 0x00404  /* Extended TX Control - RW */
 #define E1000_TIPG     0x00410  /* TX Inter-packet gap -RW */
+#define E1000_TXPBSIZE 0x03404  /* Transmit Packet Buffer Size - RW */
 #define E1000_AIT      0x00458  /* Adaptive Interframe Spacing Throttle - RW */
 #define E1000_LEDCTL   0x00E00  /* LED Control - RW */
 #define E1000_LEDMUX   0x08130  /* LED MUX Control */