Commit 274a85e0 authored by Bruce Allan's avatar Bruce Allan Committed by Jeff Kirsher

e1000e: fix scheduling while atomic bugs

The previous commit ce43a216 (e1000e:
cleanup USLEEP_RANGE checkpatch checks) converted a number of delays and
sleeps as recommended in ./Documentation/timers/timers-howto.txt.
Unfortunately, a few of the udelay() to usleep_range() conversions are in
code paths that are in an atomic context in which usleep_range() should
not be used.  Revert those specific changes.
Signed-off-by: default avatarBruce Allan <bruce.w.allan@intel.com>
Tested-by: default avatarJeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 8defe713
...@@ -165,7 +165,7 @@ s32 e1000e_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data) ...@@ -165,7 +165,7 @@ s32 e1000e_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data)
* the lower time out * the lower time out
*/ */
for (i = 0; i < (E1000_GEN_POLL_TIMEOUT * 3); i++) { for (i = 0; i < (E1000_GEN_POLL_TIMEOUT * 3); i++) {
usleep_range(50, 100); udelay(50);
mdic = er32(MDIC); mdic = er32(MDIC);
if (mdic & E1000_MDIC_READY) if (mdic & E1000_MDIC_READY)
break; break;
...@@ -190,7 +190,7 @@ s32 e1000e_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data) ...@@ -190,7 +190,7 @@ s32 e1000e_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data)
* reading duplicate data in the next MDIC transaction. * reading duplicate data in the next MDIC transaction.
*/ */
if (hw->mac.type == e1000_pch2lan) if (hw->mac.type == e1000_pch2lan)
usleep_range(100, 200); udelay(100);
return 0; return 0;
} }
...@@ -229,7 +229,7 @@ s32 e1000e_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data) ...@@ -229,7 +229,7 @@ s32 e1000e_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data)
* the lower time out * the lower time out
*/ */
for (i = 0; i < (E1000_GEN_POLL_TIMEOUT * 3); i++) { for (i = 0; i < (E1000_GEN_POLL_TIMEOUT * 3); i++) {
usleep_range(50, 100); udelay(50);
mdic = er32(MDIC); mdic = er32(MDIC);
if (mdic & E1000_MDIC_READY) if (mdic & E1000_MDIC_READY)
break; break;
...@@ -253,7 +253,7 @@ s32 e1000e_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data) ...@@ -253,7 +253,7 @@ s32 e1000e_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data)
* reading duplicate data in the next MDIC transaction. * reading duplicate data in the next MDIC transaction.
*/ */
if (hw->mac.type == e1000_pch2lan) if (hw->mac.type == e1000_pch2lan)
usleep_range(100, 200); udelay(100);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment