2828
2929/* ethtool support for e1000 */
3030
31- #include <linux/interrupt.h>
3231#include <linux/netdevice.h>
32+ #include <linux/interrupt.h>
3333#include <linux/ethtool.h>
3434#include <linux/pci.h>
3535#include <linux/slab.h>
@@ -964,6 +964,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data)
964964
965965 /* Disable all the interrupts */
966966 ew32 (IMC , 0xFFFFFFFF );
967+ e1e_flush ();
967968 usleep_range (10000 , 20000 );
968969
969970 /* Test each interrupt */
@@ -996,6 +997,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data)
996997 adapter -> test_icr = 0 ;
997998 ew32 (IMC , mask );
998999 ew32 (ICS , mask );
1000+ e1e_flush ();
9991001 usleep_range (10000 , 20000 );
10001002
10011003 if (adapter -> test_icr & mask ) {
@@ -1014,6 +1016,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data)
10141016 adapter -> test_icr = 0 ;
10151017 ew32 (IMS , mask );
10161018 ew32 (ICS , mask );
1019+ e1e_flush ();
10171020 usleep_range (10000 , 20000 );
10181021
10191022 if (!(adapter -> test_icr & mask )) {
@@ -1032,6 +1035,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data)
10321035 adapter -> test_icr = 0 ;
10331036 ew32 (IMC , ~mask & 0x00007FFF );
10341037 ew32 (ICS , ~mask & 0x00007FFF );
1038+ e1e_flush ();
10351039 usleep_range (10000 , 20000 );
10361040
10371041 if (adapter -> test_icr ) {
@@ -1043,6 +1047,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data)
10431047
10441048 /* Disable all the interrupts */
10451049 ew32 (IMC , 0xFFFFFFFF );
1050+ e1e_flush ();
10461051 usleep_range (10000 , 20000 );
10471052
10481053 /* Unhook test interrupt handler */
@@ -1276,6 +1281,7 @@ static int e1000_integrated_phy_loopback(struct e1000_adapter *adapter)
12761281 E1000_CTRL_FD ); /* Force Duplex to FULL */
12771282
12781283 ew32 (CTRL , ctrl_reg );
1284+ e1e_flush ();
12791285 udelay (500 );
12801286
12811287 return 0 ;
@@ -1418,6 +1424,7 @@ static int e1000_set_82571_fiber_loopback(struct e1000_adapter *adapter)
14181424 */
14191425#define E1000_SERDES_LB_ON 0x410
14201426 ew32 (SCTL , E1000_SERDES_LB_ON );
1427+ e1e_flush ();
14211428 usleep_range (10000 , 20000 );
14221429
14231430 return 0 ;
@@ -1513,6 +1520,7 @@ static void e1000_loopback_cleanup(struct e1000_adapter *adapter)
15131520 hw -> phy .media_type == e1000_media_type_internal_serdes ) {
15141521#define E1000_SERDES_LB_OFF 0x400
15151522 ew32 (SCTL , E1000_SERDES_LB_OFF );
1523+ e1e_flush ();
15161524 usleep_range (10000 , 20000 );
15171525 break ;
15181526 }
@@ -1592,6 +1600,7 @@ static int e1000_run_loopback_test(struct e1000_adapter *adapter)
15921600 k = 0 ;
15931601 }
15941602 ew32 (TDT , k );
1603+ e1e_flush ();
15951604 msleep (200 );
15961605 time = jiffies ; /* set the start time for the receive */
15971606 good_cnt = 0 ;
0 commit comments