Skip to content

Commit c70a3a9

Browse files
committed
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/jkirsher/net
2 parents c71d8eb + b57e35b commit c70a3a9

File tree

20 files changed

+65
-6
lines changed

20 files changed

+65
-6
lines changed

drivers/net/e1000/e1000_ethtool.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data)
838838

839839
/* Disable all the interrupts */
840840
ew32(IMC, 0xFFFFFFFF);
841+
E1000_WRITE_FLUSH();
841842
msleep(10);
842843

843844
/* Test each interrupt */
@@ -856,6 +857,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data)
856857
adapter->test_icr = 0;
857858
ew32(IMC, mask);
858859
ew32(ICS, mask);
860+
E1000_WRITE_FLUSH();
859861
msleep(10);
860862

861863
if (adapter->test_icr & mask) {
@@ -873,6 +875,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data)
873875
adapter->test_icr = 0;
874876
ew32(IMS, mask);
875877
ew32(ICS, mask);
878+
E1000_WRITE_FLUSH();
876879
msleep(10);
877880

878881
if (!(adapter->test_icr & mask)) {
@@ -890,6 +893,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data)
890893
adapter->test_icr = 0;
891894
ew32(IMC, ~mask & 0x00007FFF);
892895
ew32(ICS, ~mask & 0x00007FFF);
896+
E1000_WRITE_FLUSH();
893897
msleep(10);
894898

895899
if (adapter->test_icr) {
@@ -901,6 +905,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data)
901905

902906
/* Disable all the interrupts */
903907
ew32(IMC, 0xFFFFFFFF);
908+
E1000_WRITE_FLUSH();
904909
msleep(10);
905910

906911
/* Unhook test interrupt handler */
@@ -1394,6 +1399,7 @@ static int e1000_run_loopback_test(struct e1000_adapter *adapter)
13941399
if (unlikely(++k == txdr->count)) k = 0;
13951400
}
13961401
ew32(TDT, k);
1402+
E1000_WRITE_FLUSH();
13971403
msleep(200);
13981404
time = jiffies; /* set the start time for the receive */
13991405
good_cnt = 0;

drivers/net/e1000/e1000_hw.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ s32 e1000_reset_hw(struct e1000_hw *hw)
446446
/* Must reset the PHY before resetting the MAC */
447447
if ((hw->mac_type == e1000_82541) || (hw->mac_type == e1000_82547)) {
448448
ew32(CTRL, (ctrl | E1000_CTRL_PHY_RST));
449+
E1000_WRITE_FLUSH();
449450
msleep(5);
450451
}
451452

@@ -3752,6 +3753,7 @@ static s32 e1000_acquire_eeprom(struct e1000_hw *hw)
37523753
/* Clear SK and CS */
37533754
eecd &= ~(E1000_EECD_CS | E1000_EECD_SK);
37543755
ew32(EECD, eecd);
3756+
E1000_WRITE_FLUSH();
37553757
udelay(1);
37563758
}
37573759

@@ -3824,6 +3826,7 @@ static void e1000_release_eeprom(struct e1000_hw *hw)
38243826
eecd &= ~E1000_EECD_SK; /* Lower SCK */
38253827

38263828
ew32(EECD, eecd);
3829+
E1000_WRITE_FLUSH();
38273830

38283831
udelay(hw->eeprom.delay_usec);
38293832
} else if (hw->eeprom.type == e1000_eeprom_microwire) {

drivers/net/e1000e/es2lan.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,6 +1313,7 @@ static s32 e1000_read_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
13131313
kmrnctrlsta = ((offset << E1000_KMRNCTRLSTA_OFFSET_SHIFT) &
13141314
E1000_KMRNCTRLSTA_OFFSET) | E1000_KMRNCTRLSTA_REN;
13151315
ew32(KMRNCTRLSTA, kmrnctrlsta);
1316+
e1e_flush();
13161317

13171318
udelay(2);
13181319

@@ -1347,6 +1348,7 @@ static s32 e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
13471348
kmrnctrlsta = ((offset << E1000_KMRNCTRLSTA_OFFSET_SHIFT) &
13481349
E1000_KMRNCTRLSTA_OFFSET) | data;
13491350
ew32(KMRNCTRLSTA, kmrnctrlsta);
1351+
e1e_flush();
13501352

13511353
udelay(2);
13521354

drivers/net/e1000e/ethtool.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
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;

drivers/net/e1000e/ich8lan.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ static void e1000_toggle_lanphypc_value_ich8lan(struct e1000_hw *hw)
283283
ctrl |= E1000_CTRL_LANPHYPC_OVERRIDE;
284284
ctrl &= ~E1000_CTRL_LANPHYPC_VALUE;
285285
ew32(CTRL, ctrl);
286+
e1e_flush();
286287
udelay(10);
287288
ctrl &= ~E1000_CTRL_LANPHYPC_OVERRIDE;
288289
ew32(CTRL, ctrl);
@@ -1230,9 +1231,11 @@ s32 e1000_configure_k1_ich8lan(struct e1000_hw *hw, bool k1_enable)
12301231
ew32(CTRL, reg);
12311232

12321233
ew32(CTRL_EXT, ctrl_ext | E1000_CTRL_EXT_SPD_BYPS);
1234+
e1e_flush();
12331235
udelay(20);
12341236
ew32(CTRL, ctrl_reg);
12351237
ew32(CTRL_EXT, ctrl_ext);
1238+
e1e_flush();
12361239
udelay(20);
12371240

12381241
out:
@@ -2134,8 +2137,7 @@ static s32 e1000_read_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words,
21342137

21352138
ret_val = 0;
21362139
for (i = 0; i < words; i++) {
2137-
if ((dev_spec->shadow_ram) &&
2138-
(dev_spec->shadow_ram[offset+i].modified)) {
2140+
if (dev_spec->shadow_ram[offset+i].modified) {
21392141
data[i] = dev_spec->shadow_ram[offset+i].value;
21402142
} else {
21412143
ret_val = e1000_read_flash_word_ich8lan(hw,
@@ -3090,6 +3092,7 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
30903092
ret_val = e1000_acquire_swflag_ich8lan(hw);
30913093
e_dbg("Issuing a global reset to ich8lan\n");
30923094
ew32(CTRL, (ctrl | E1000_CTRL_RST));
3095+
/* cannot issue a flush here because it hangs the hardware */
30933096
msleep(20);
30943097

30953098
if (!ret_val)

drivers/net/e1000e/lib.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1986,6 +1986,7 @@ static s32 e1000_ready_nvm_eeprom(struct e1000_hw *hw)
19861986
/* Clear SK and CS */
19871987
eecd &= ~(E1000_EECD_CS | E1000_EECD_SK);
19881988
ew32(EECD, eecd);
1989+
e1e_flush();
19891990
udelay(1);
19901991

19911992
/*

drivers/net/e1000e/netdev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@
3131
#include <linux/module.h>
3232
#include <linux/types.h>
3333
#include <linux/init.h>
34-
#include <linux/interrupt.h>
3534
#include <linux/pci.h>
3635
#include <linux/vmalloc.h>
3736
#include <linux/pagemap.h>
3837
#include <linux/delay.h>
3938
#include <linux/netdevice.h>
39+
#include <linux/interrupt.h>
4040
#include <linux/tcp.h>
4141
#include <linux/ipv6.h>
4242
#include <linux/slab.h>

drivers/net/e1000e/phy.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,7 @@ static s32 __e1000_read_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 *data,
537537
kmrnctrlsta = ((offset << E1000_KMRNCTRLSTA_OFFSET_SHIFT) &
538538
E1000_KMRNCTRLSTA_OFFSET) | E1000_KMRNCTRLSTA_REN;
539539
ew32(KMRNCTRLSTA, kmrnctrlsta);
540+
e1e_flush();
540541

541542
udelay(2);
542543

@@ -609,6 +610,7 @@ static s32 __e1000_write_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 data,
609610
kmrnctrlsta = ((offset << E1000_KMRNCTRLSTA_OFFSET_SHIFT) &
610611
E1000_KMRNCTRLSTA_OFFSET) | data;
611612
ew32(KMRNCTRLSTA, kmrnctrlsta);
613+
e1e_flush();
612614

613615
udelay(2);
614616

drivers/net/igb/e1000_nvm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ static s32 igb_ready_nvm_eeprom(struct e1000_hw *hw)
285285
/* Clear SK and CS */
286286
eecd &= ~(E1000_EECD_CS | E1000_EECD_SK);
287287
wr32(E1000_EECD, eecd);
288+
wrfl();
288289
udelay(1);
289290
timeout = NVM_MAX_RETRY_SPI;
290291

drivers/net/igb/igb_ethtool.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,6 +1225,7 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data)
12251225

12261226
/* Disable all the interrupts */
12271227
wr32(E1000_IMC, ~0);
1228+
wrfl();
12281229
msleep(10);
12291230

12301231
/* Define all writable bits for ICS */
@@ -1268,6 +1269,7 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data)
12681269

12691270
wr32(E1000_IMC, mask);
12701271
wr32(E1000_ICS, mask);
1272+
wrfl();
12711273
msleep(10);
12721274

12731275
if (adapter->test_icr & mask) {
@@ -1289,6 +1291,7 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data)
12891291

12901292
wr32(E1000_IMS, mask);
12911293
wr32(E1000_ICS, mask);
1294+
wrfl();
12921295
msleep(10);
12931296

12941297
if (!(adapter->test_icr & mask)) {
@@ -1310,6 +1313,7 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data)
13101313

13111314
wr32(E1000_IMC, ~mask);
13121315
wr32(E1000_ICS, ~mask);
1316+
wrfl();
13131317
msleep(10);
13141318

13151319
if (adapter->test_icr & mask) {
@@ -1321,6 +1325,7 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data)
13211325

13221326
/* Disable all the interrupts */
13231327
wr32(E1000_IMC, ~0);
1328+
wrfl();
13241329
msleep(10);
13251330

13261331
/* Unhook test interrupt handler */

0 commit comments

Comments
 (0)