]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
e1000e: disable far-end loopback mode on ESB2
authorBruce Allan <bruce.w.allan@intel.com>
Fri, 13 May 2011 07:19:42 +0000 (07:19 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 10 Jun 2011 03:31:24 +0000 (20:31 -0700)
The ESB2 LAN includes a debug feature that enables far-end loopback (FELB)
of the SerDes/Kumeran interface.  This feature is activated when receiving
a sequence of symbols that includes a reserved codeword.  On a perfect
link, FELB would never be activated.  In the presence of bit errors, there
is a very small, but non-zero, probability of FELB being activated.

If the FELB is activated, the SerDes link becomes non-functional and must
be reset.  It could also corrupt the switching tables in the switch since
the ESB2 is transmitting packets with a different source MAC address.

This patch disables the FELB feature.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/e1000e/es2lan.c
drivers/net/e1000e/hw.h

index f4bbeb22f51fd3f1b8de807f82802a05b380df54..c0ecb2d9fdb7abc1a47a240af1c5698f4e1b3edc 100644 (file)
@@ -836,6 +836,7 @@ static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)
        struct e1000_mac_info *mac = &hw->mac;
        u32 reg_data;
        s32 ret_val;
+       u16 kum_reg_data;
        u16 i;
 
        e1000_initialize_hw_bits_80003es2lan(hw);
@@ -861,6 +862,13 @@ static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)
        /* Setup link and flow control */
        ret_val = e1000e_setup_link(hw);
 
+       /* Disable IBIST slave mode (far-end loopback) */
+       e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM,
+                                       &kum_reg_data);
+       kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE;
+       e1000_write_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM,
+                                        kum_reg_data);
+
        /* Set the transmit descriptor write-back policy */
        reg_data = er32(TXDCTL(0));
        reg_data = (reg_data & ~E1000_TXDCTL_WTHRESH) |
index 6c2fa8327f5c814a78ff3db778e2ed694b22c6a1..dde584f5ccc7a33a8bbec822fef3d0af266206ec 100644 (file)
@@ -312,6 +312,7 @@ enum e1e_registers {
 #define E1000_KMRNCTRLSTA_DIAG_OFFSET  0x3    /* Kumeran Diagnostic */
 #define E1000_KMRNCTRLSTA_TIMEOUTS     0x4    /* Kumeran Timeouts */
 #define E1000_KMRNCTRLSTA_INBAND_PARAM 0x9    /* Kumeran InBand Parameters */
+#define E1000_KMRNCTRLSTA_IBIST_DISABLE        0x0200 /* Kumeran IBIST Disable */
 #define E1000_KMRNCTRLSTA_DIAG_NELPBK  0x1000 /* Nearend Loopback mode */
 #define E1000_KMRNCTRLSTA_K1_CONFIG    0x7
 #define E1000_KMRNCTRLSTA_K1_ENABLE    0x0002