Commit 0d451e79 authored by Carolyn Wyborny's avatar Carolyn Wyborny Committed by Jeff Kirsher

igb: Cleanups to fix msleep warnings

This patch fixes WARNING:MSLEEP found by checkpatch check.
Signed-off-by: default avatarCarolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent c502ea2e
...@@ -1212,7 +1212,7 @@ static s32 igb_get_cfg_done_82575(struct e1000_hw *hw) ...@@ -1212,7 +1212,7 @@ static s32 igb_get_cfg_done_82575(struct e1000_hw *hw)
while (timeout) { while (timeout) {
if (rd32(E1000_EEMNGCTL) & mask) if (rd32(E1000_EEMNGCTL) & mask)
break; break;
msleep(1); usleep_range(1000, 2000);
timeout--; timeout--;
} }
if (!timeout) if (!timeout)
...@@ -1312,7 +1312,7 @@ void igb_power_up_serdes_link_82575(struct e1000_hw *hw) ...@@ -1312,7 +1312,7 @@ void igb_power_up_serdes_link_82575(struct e1000_hw *hw)
/* flush the write to verify completion */ /* flush the write to verify completion */
wrfl(); wrfl();
msleep(1); usleep_range(1000, 2000);
} }
/** /**
...@@ -1407,7 +1407,7 @@ void igb_shutdown_serdes_link_82575(struct e1000_hw *hw) ...@@ -1407,7 +1407,7 @@ void igb_shutdown_serdes_link_82575(struct e1000_hw *hw)
/* flush the write to verify completion */ /* flush the write to verify completion */
wrfl(); wrfl();
msleep(1); usleep_range(1000, 2000);
} }
} }
...@@ -1442,7 +1442,7 @@ static s32 igb_reset_hw_82575(struct e1000_hw *hw) ...@@ -1442,7 +1442,7 @@ static s32 igb_reset_hw_82575(struct e1000_hw *hw)
wr32(E1000_TCTL, E1000_TCTL_PSP); wr32(E1000_TCTL, E1000_TCTL_PSP);
wrfl(); wrfl();
msleep(10); usleep_range(10000, 20000);
ctrl = rd32(E1000_CTRL); ctrl = rd32(E1000_CTRL);
...@@ -1920,7 +1920,7 @@ void igb_rx_fifo_flush_82575(struct e1000_hw *hw) ...@@ -1920,7 +1920,7 @@ void igb_rx_fifo_flush_82575(struct e1000_hw *hw)
} }
/* Poll all queues to verify they have shut down */ /* Poll all queues to verify they have shut down */
for (ms_wait = 0; ms_wait < 10; ms_wait++) { for (ms_wait = 0; ms_wait < 10; ms_wait++) {
msleep(1); usleep_range(1000, 2000);
rx_enabled = 0; rx_enabled = 0;
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
rx_enabled |= rd32(E1000_RXDCTL(i)); rx_enabled |= rd32(E1000_RXDCTL(i));
...@@ -1948,7 +1948,7 @@ void igb_rx_fifo_flush_82575(struct e1000_hw *hw) ...@@ -1948,7 +1948,7 @@ void igb_rx_fifo_flush_82575(struct e1000_hw *hw)
wr32(E1000_RCTL, temp_rctl); wr32(E1000_RCTL, temp_rctl);
wr32(E1000_RCTL, temp_rctl | E1000_RCTL_EN); wr32(E1000_RCTL, temp_rctl | E1000_RCTL_EN);
wrfl(); wrfl();
msleep(2); usleep_range(2000, 3000);
/* Enable RX queues that were previously enabled and restore our /* Enable RX queues that were previously enabled and restore our
* previous state * previous state
...@@ -2236,7 +2236,7 @@ static s32 igb_reset_hw_82580(struct e1000_hw *hw) ...@@ -2236,7 +2236,7 @@ static s32 igb_reset_hw_82580(struct e1000_hw *hw)
wr32(E1000_TCTL, E1000_TCTL_PSP); wr32(E1000_TCTL, E1000_TCTL_PSP);
wrfl(); wrfl();
msleep(10); usleep_range(10000, 11000);
/* Determine whether or not a global dev reset is requested */ /* Determine whether or not a global dev reset is requested */
if (global_device_reset && if (global_device_reset &&
...@@ -2254,7 +2254,7 @@ static s32 igb_reset_hw_82580(struct e1000_hw *hw) ...@@ -2254,7 +2254,7 @@ static s32 igb_reset_hw_82580(struct e1000_hw *hw)
/* Add delay to insure DEV_RST has time to complete */ /* Add delay to insure DEV_RST has time to complete */
if (global_device_reset) if (global_device_reset)
msleep(5); usleep_range(5000, 6000);
ret_val = igb_get_auto_rd_done(hw); ret_val = igb_get_auto_rd_done(hw);
if (ret_val) { if (ret_val) {
......
...@@ -1261,7 +1261,7 @@ s32 igb_get_auto_rd_done(struct e1000_hw *hw) ...@@ -1261,7 +1261,7 @@ s32 igb_get_auto_rd_done(struct e1000_hw *hw)
while (i < AUTO_READ_DONE_TIMEOUT) { while (i < AUTO_READ_DONE_TIMEOUT) {
if (rd32(E1000_EECD) & E1000_EECD_AUTO_RD) if (rd32(E1000_EECD) & E1000_EECD_AUTO_RD)
break; break;
msleep(1); usleep_range(1000, 2000);
i++; i++;
} }
......
...@@ -2240,7 +2240,7 @@ void igb_power_down_phy_copper(struct e1000_hw *hw) ...@@ -2240,7 +2240,7 @@ void igb_power_down_phy_copper(struct e1000_hw *hw)
hw->phy.ops.write_reg(hw, GS40G_COPPER_SPEC, power_reg); hw->phy.ops.write_reg(hw, GS40G_COPPER_SPEC, power_reg);
} }
hw->phy.ops.write_reg(hw, PHY_CONTROL, mii_reg); hw->phy.ops.write_reg(hw, PHY_CONTROL, mii_reg);
msleep(1); usleep_range(1000, 2000);
} }
/** /**
......
...@@ -283,7 +283,7 @@ static int igb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) ...@@ -283,7 +283,7 @@ static int igb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
} }
while (test_and_set_bit(__IGB_RESETTING, &adapter->state)) while (test_and_set_bit(__IGB_RESETTING, &adapter->state))
msleep(1); usleep_range(1000, 2000);
if (ecmd->autoneg == AUTONEG_ENABLE) { if (ecmd->autoneg == AUTONEG_ENABLE) {
hw->mac.autoneg = 1; hw->mac.autoneg = 1;
...@@ -396,7 +396,7 @@ static int igb_set_pauseparam(struct net_device *netdev, ...@@ -396,7 +396,7 @@ static int igb_set_pauseparam(struct net_device *netdev,
adapter->fc_autoneg = pause->autoneg; adapter->fc_autoneg = pause->autoneg;
while (test_and_set_bit(__IGB_RESETTING, &adapter->state)) while (test_and_set_bit(__IGB_RESETTING, &adapter->state))
msleep(1); usleep_range(1000, 2000);
if (adapter->fc_autoneg == AUTONEG_ENABLE) { if (adapter->fc_autoneg == AUTONEG_ENABLE) {
hw->fc.requested_mode = e1000_fc_default; hw->fc.requested_mode = e1000_fc_default;
...@@ -883,7 +883,7 @@ static int igb_set_ringparam(struct net_device *netdev, ...@@ -883,7 +883,7 @@ static int igb_set_ringparam(struct net_device *netdev,
} }
while (test_and_set_bit(__IGB_RESETTING, &adapter->state)) while (test_and_set_bit(__IGB_RESETTING, &adapter->state))
msleep(1); usleep_range(1000, 2000);
if (!netif_running(adapter->netdev)) { if (!netif_running(adapter->netdev)) {
for (i = 0; i < adapter->num_tx_queues; i++) for (i = 0; i < adapter->num_tx_queues; i++)
...@@ -1413,7 +1413,7 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data) ...@@ -1413,7 +1413,7 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data)
/* Disable all the interrupts */ /* Disable all the interrupts */
wr32(E1000_IMC, ~0); wr32(E1000_IMC, ~0);
wrfl(); wrfl();
msleep(10); usleep_range(10000, 11000);
/* Define all writable bits for ICS */ /* Define all writable bits for ICS */
switch (hw->mac.type) { switch (hw->mac.type) {
...@@ -1460,7 +1460,7 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data) ...@@ -1460,7 +1460,7 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data)
wr32(E1000_IMC, mask); wr32(E1000_IMC, mask);
wr32(E1000_ICS, mask); wr32(E1000_ICS, mask);
wrfl(); wrfl();
msleep(10); usleep_range(10000, 11000);
if (adapter->test_icr & mask) { if (adapter->test_icr & mask) {
*data = 3; *data = 3;
...@@ -1482,7 +1482,7 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data) ...@@ -1482,7 +1482,7 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data)
wr32(E1000_IMS, mask); wr32(E1000_IMS, mask);
wr32(E1000_ICS, mask); wr32(E1000_ICS, mask);
wrfl(); wrfl();
msleep(10); usleep_range(10000, 11000);
if (!(adapter->test_icr & mask)) { if (!(adapter->test_icr & mask)) {
*data = 4; *data = 4;
...@@ -1504,7 +1504,7 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data) ...@@ -1504,7 +1504,7 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data)
wr32(E1000_IMC, ~mask); wr32(E1000_IMC, ~mask);
wr32(E1000_ICS, ~mask); wr32(E1000_ICS, ~mask);
wrfl(); wrfl();
msleep(10); usleep_range(10000, 11000);
if (adapter->test_icr & mask) { if (adapter->test_icr & mask) {
*data = 5; *data = 5;
...@@ -1516,7 +1516,7 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data) ...@@ -1516,7 +1516,7 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data)
/* Disable all the interrupts */ /* Disable all the interrupts */
wr32(E1000_IMC, ~0); wr32(E1000_IMC, ~0);
wrfl(); wrfl();
msleep(10); usleep_range(10000, 11000);
/* Unhook test interrupt handler */ /* Unhook test interrupt handler */
if (adapter->flags & IGB_FLAG_HAS_MSIX) if (adapter->flags & IGB_FLAG_HAS_MSIX)
......
...@@ -1784,7 +1784,7 @@ void igb_down(struct igb_adapter *adapter) ...@@ -1784,7 +1784,7 @@ void igb_down(struct igb_adapter *adapter)
wr32(E1000_TCTL, tctl); wr32(E1000_TCTL, tctl);
/* flush both disables and wait for them to finish */ /* flush both disables and wait for them to finish */
wrfl(); wrfl();
msleep(10); usleep_range(10000, 11000);
igb_irq_disable(adapter); igb_irq_disable(adapter);
...@@ -1824,7 +1824,7 @@ void igb_reinit_locked(struct igb_adapter *adapter) ...@@ -1824,7 +1824,7 @@ void igb_reinit_locked(struct igb_adapter *adapter)
{ {
WARN_ON(in_interrupt()); WARN_ON(in_interrupt());
while (test_and_set_bit(__IGB_RESETTING, &adapter->state)) while (test_and_set_bit(__IGB_RESETTING, &adapter->state))
msleep(1); usleep_range(1000, 2000);
igb_down(adapter); igb_down(adapter);
igb_up(adapter); igb_up(adapter);
clear_bit(__IGB_RESETTING, &adapter->state); clear_bit(__IGB_RESETTING, &adapter->state);
...@@ -5142,7 +5142,7 @@ static int igb_change_mtu(struct net_device *netdev, int new_mtu) ...@@ -5142,7 +5142,7 @@ static int igb_change_mtu(struct net_device *netdev, int new_mtu)
max_frame = ETH_FRAME_LEN + ETH_FCS_LEN; max_frame = ETH_FRAME_LEN + ETH_FCS_LEN;
while (test_and_set_bit(__IGB_RESETTING, &adapter->state)) while (test_and_set_bit(__IGB_RESETTING, &adapter->state))
msleep(1); usleep_range(1000, 2000);
/* igb_down has a dependency on max_frame_size */ /* igb_down has a dependency on max_frame_size */
adapter->max_frame_size = max_frame; adapter->max_frame_size = max_frame;
......
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