aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000e/netdev.c
diff options
context:
space:
mode:
authorBruce Allan <bruce.w.allan@intel.com>2011-03-18 20:27:20 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-04-13 22:17:06 -0400
commit1bba4386ab4f67a53c9649268dd9c83bc6110a9b (patch)
tree5519c317c5f2828422c7cb44fa6251bae5b5aff9 /drivers/net/e1000e/netdev.c
parent563988dcfe706457ec7049d59e18d6147179bb0a (diff)
e1000e: convert short duration msleep() to usleep_range()
With durations less than 20ms, the jiffies or legacy timer backed msleep() may sleep ~20ms which might not be what the caller expects. Instead, it is recommended to use the hrtimers backed usleep_range(). For more, see Documentation/timers/timers-howto.txt. Issues reported by checkpatch. In addition, remove unnecessary sleep in e1000e_write_nvm_spi(). 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>
Diffstat (limited to 'drivers/net/e1000e/netdev.c')
-rw-r--r--drivers/net/e1000e/netdev.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 506a0a0043b3..909c8de58c15 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -2902,7 +2902,7 @@ static void e1000_configure_rx(struct e1000_adapter *adapter)
2902 rctl = er32(RCTL); 2902 rctl = er32(RCTL);
2903 ew32(RCTL, rctl & ~E1000_RCTL_EN); 2903 ew32(RCTL, rctl & ~E1000_RCTL_EN);
2904 e1e_flush(); 2904 e1e_flush();
2905 msleep(10); 2905 usleep_range(10000, 20000);
2906 2906
2907 if (adapter->flags2 & FLAG2_DMA_BURST) { 2907 if (adapter->flags2 & FLAG2_DMA_BURST) {
2908 /* 2908 /*
@@ -3383,7 +3383,7 @@ void e1000e_down(struct e1000_adapter *adapter)
3383 ew32(TCTL, tctl); 3383 ew32(TCTL, tctl);
3384 /* flush both disables and wait for them to finish */ 3384 /* flush both disables and wait for them to finish */
3385 e1e_flush(); 3385 e1e_flush();
3386 msleep(10); 3386 usleep_range(10000, 20000);
3387 3387
3388 napi_disable(&adapter->napi); 3388 napi_disable(&adapter->napi);
3389 e1000_irq_disable(adapter); 3389 e1000_irq_disable(adapter);
@@ -3418,7 +3418,7 @@ void e1000e_reinit_locked(struct e1000_adapter *adapter)
3418{ 3418{
3419 might_sleep(); 3419 might_sleep();
3420 while (test_and_set_bit(__E1000_RESETTING, &adapter->state)) 3420 while (test_and_set_bit(__E1000_RESETTING, &adapter->state))
3421 msleep(1); 3421 usleep_range(1000, 2000);
3422 e1000e_down(adapter); 3422 e1000e_down(adapter);
3423 e1000e_up(adapter); 3423 e1000e_up(adapter);
3424 clear_bit(__E1000_RESETTING, &adapter->state); 3424 clear_bit(__E1000_RESETTING, &adapter->state);
@@ -5028,7 +5028,7 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
5028 } 5028 }
5029 5029
5030 while (test_and_set_bit(__E1000_RESETTING, &adapter->state)) 5030 while (test_and_set_bit(__E1000_RESETTING, &adapter->state))
5031 msleep(1); 5031 usleep_range(1000, 2000);
5032 /* e1000e_down -> e1000e_reset dependent on max_frame_size & mtu */ 5032 /* e1000e_down -> e1000e_reset dependent on max_frame_size & mtu */
5033 adapter->max_frame_size = max_frame; 5033 adapter->max_frame_size = max_frame;
5034 e_info("changing MTU from %d to %d\n", netdev->mtu, new_mtu); 5034 e_info("changing MTU from %d to %d\n", netdev->mtu, new_mtu);