diff options
author | Bruce Allan <bruce.w.allan@intel.com> | 2011-03-18 20:27:20 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2011-04-13 22:17:06 -0400 |
commit | 1bba4386ab4f67a53c9649268dd9c83bc6110a9b (patch) | |
tree | 5519c317c5f2828422c7cb44fa6251bae5b5aff9 /drivers/net/e1000e/82571.c | |
parent | 563988dcfe706457ec7049d59e18d6147179bb0a (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/82571.c')
-rw-r--r-- | drivers/net/e1000e/82571.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c index 89a69035e538..9fedbca66dfd 100644 --- a/drivers/net/e1000e/82571.c +++ b/drivers/net/e1000e/82571.c | |||
@@ -594,7 +594,7 @@ static s32 e1000_get_hw_semaphore_82573(struct e1000_hw *hw) | |||
594 | 594 | ||
595 | extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP; | 595 | extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP; |
596 | 596 | ||
597 | msleep(2); | 597 | usleep_range(2000, 4000); |
598 | i++; | 598 | i++; |
599 | } while (i < MDIO_OWNERSHIP_TIMEOUT); | 599 | } while (i < MDIO_OWNERSHIP_TIMEOUT); |
600 | 600 | ||
@@ -816,7 +816,7 @@ static s32 e1000_update_nvm_checksum_82571(struct e1000_hw *hw) | |||
816 | 816 | ||
817 | /* Check for pending operations. */ | 817 | /* Check for pending operations. */ |
818 | for (i = 0; i < E1000_FLASH_UPDATES; i++) { | 818 | for (i = 0; i < E1000_FLASH_UPDATES; i++) { |
819 | msleep(1); | 819 | usleep_range(1000, 2000); |
820 | if ((er32(EECD) & E1000_EECD_FLUPD) == 0) | 820 | if ((er32(EECD) & E1000_EECD_FLUPD) == 0) |
821 | break; | 821 | break; |
822 | } | 822 | } |
@@ -840,7 +840,7 @@ static s32 e1000_update_nvm_checksum_82571(struct e1000_hw *hw) | |||
840 | ew32(EECD, eecd); | 840 | ew32(EECD, eecd); |
841 | 841 | ||
842 | for (i = 0; i < E1000_FLASH_UPDATES; i++) { | 842 | for (i = 0; i < E1000_FLASH_UPDATES; i++) { |
843 | msleep(1); | 843 | usleep_range(1000, 2000); |
844 | if ((er32(EECD) & E1000_EECD_FLUPD) == 0) | 844 | if ((er32(EECD) & E1000_EECD_FLUPD) == 0) |
845 | break; | 845 | break; |
846 | } | 846 | } |
@@ -930,7 +930,7 @@ static s32 e1000_get_cfg_done_82571(struct e1000_hw *hw) | |||
930 | if (er32(EEMNGCTL) & | 930 | if (er32(EEMNGCTL) & |
931 | E1000_NVM_CFG_DONE_PORT_0) | 931 | E1000_NVM_CFG_DONE_PORT_0) |
932 | break; | 932 | break; |
933 | msleep(1); | 933 | usleep_range(1000, 2000); |
934 | timeout--; | 934 | timeout--; |
935 | } | 935 | } |
936 | if (!timeout) { | 936 | if (!timeout) { |
@@ -1037,7 +1037,7 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw) | |||
1037 | ew32(TCTL, E1000_TCTL_PSP); | 1037 | ew32(TCTL, E1000_TCTL_PSP); |
1038 | e1e_flush(); | 1038 | e1e_flush(); |
1039 | 1039 | ||
1040 | msleep(10); | 1040 | usleep_range(10000, 20000); |
1041 | 1041 | ||
1042 | /* | 1042 | /* |
1043 | * Must acquire the MDIO ownership before MAC reset. | 1043 | * Must acquire the MDIO ownership before MAC reset. |