diff options
| author | Neerav Parikh <neerav.parikh@intel.com> | 2014-09-13 03:40:44 -0400 |
|---|---|---|
| committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2014-10-23 23:38:03 -0400 |
| commit | f98a20068dfcc16d1292d3e4d0d690e123da1538 (patch) | |
| tree | b55ac83c349eecd0bad3688441e708e16e0870d8 | |
| parent | 8c570dcc8cbabd7bf1a8eb7eb7cc16a1a37b6c0f (diff) | |
i40e/i40evf: Use usleep_range() instead of udelay()
As per the Documentation/timers/timers-howto.txt it is preferred to use
usleep_range() instead of udelay() if the delay value is > 10us in
non-atomic contexts.
So, replacing all the instances of udelay() with 10 or greater than 10
micro seconds delay in the driver and using usleep_range() instead.
Change-ID: Iaa2ab499a4c26f6005e5d86cc421407ef9de16c7
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Neerav Parikh <neerav.parikh@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| -rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_main.c | 6 | ||||
| -rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 2 | ||||
| -rw-r--r-- | drivers/net/ethernet/intel/i40evf/i40evf_main.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index d40fc3b9c46e..f7464e87d521 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c | |||
| @@ -3440,7 +3440,7 @@ static int i40e_pf_txq_wait(struct i40e_pf *pf, int pf_q, bool enable) | |||
| 3440 | if (enable == !!(tx_reg & I40E_QTX_ENA_QENA_STAT_MASK)) | 3440 | if (enable == !!(tx_reg & I40E_QTX_ENA_QENA_STAT_MASK)) |
| 3441 | break; | 3441 | break; |
| 3442 | 3442 | ||
| 3443 | udelay(10); | 3443 | usleep_range(10, 20); |
| 3444 | } | 3444 | } |
| 3445 | if (i >= I40E_QUEUE_WAIT_RETRY_LIMIT) | 3445 | if (i >= I40E_QUEUE_WAIT_RETRY_LIMIT) |
| 3446 | return -ETIMEDOUT; | 3446 | return -ETIMEDOUT; |
| @@ -3466,7 +3466,7 @@ static int i40e_vsi_control_tx(struct i40e_vsi *vsi, bool enable) | |||
| 3466 | /* warn the TX unit of coming changes */ | 3466 | /* warn the TX unit of coming changes */ |
| 3467 | i40e_pre_tx_queue_cfg(&pf->hw, pf_q, enable); | 3467 | i40e_pre_tx_queue_cfg(&pf->hw, pf_q, enable); |
| 3468 | if (!enable) | 3468 | if (!enable) |
| 3469 | udelay(10); | 3469 | usleep_range(10, 20); |
| 3470 | 3470 | ||
| 3471 | for (j = 0; j < 50; j++) { | 3471 | for (j = 0; j < 50; j++) { |
| 3472 | tx_reg = rd32(hw, I40E_QTX_ENA(pf_q)); | 3472 | tx_reg = rd32(hw, I40E_QTX_ENA(pf_q)); |
| @@ -3526,7 +3526,7 @@ static int i40e_pf_rxq_wait(struct i40e_pf *pf, int pf_q, bool enable) | |||
| 3526 | if (enable == !!(rx_reg & I40E_QRX_ENA_QENA_STAT_MASK)) | 3526 | if (enable == !!(rx_reg & I40E_QRX_ENA_QENA_STAT_MASK)) |
| 3527 | break; | 3527 | break; |
| 3528 | 3528 | ||
| 3529 | udelay(10); | 3529 | usleep_range(10, 20); |
| 3530 | } | 3530 | } |
| 3531 | if (i >= I40E_QUEUE_WAIT_RETRY_LIMIT) | 3531 | if (i >= I40E_QUEUE_WAIT_RETRY_LIMIT) |
| 3532 | return -ETIMEDOUT; | 3532 | return -ETIMEDOUT; |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c index 4eeed267e4b7..fff3c276736b 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | |||
| @@ -674,7 +674,7 @@ void i40e_reset_vf(struct i40e_vf *vf, bool flr) | |||
| 674 | * that the requested op was completed | 674 | * that the requested op was completed |
| 675 | * successfully | 675 | * successfully |
| 676 | */ | 676 | */ |
| 677 | udelay(10); | 677 | usleep_range(10, 20); |
| 678 | reg = rd32(hw, I40E_VPGEN_VFRSTAT(vf->vf_id)); | 678 | reg = rd32(hw, I40E_VPGEN_VFRSTAT(vf->vf_id)); |
| 679 | if (reg & I40E_VPGEN_VFRSTAT_VFRD_MASK) { | 679 | if (reg & I40E_VPGEN_VFRSTAT_VFRD_MASK) { |
| 680 | rsd = true; | 680 | rsd = true; |
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c index c51bc7a33bc5..dabe6a4220c6 100644 --- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c +++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c | |||
| @@ -1494,7 +1494,7 @@ static void i40evf_reset_task(struct work_struct *work) | |||
| 1494 | 1494 | ||
| 1495 | while (test_and_set_bit(__I40EVF_IN_CRITICAL_TASK, | 1495 | while (test_and_set_bit(__I40EVF_IN_CRITICAL_TASK, |
| 1496 | &adapter->crit_section)) | 1496 | &adapter->crit_section)) |
| 1497 | udelay(500); | 1497 | usleep_range(500, 1000); |
| 1498 | 1498 | ||
| 1499 | if (adapter->flags & I40EVF_FLAG_RESET_NEEDED) { | 1499 | if (adapter->flags & I40EVF_FLAG_RESET_NEEDED) { |
| 1500 | dev_info(&adapter->pdev->dev, "Requesting reset from PF\n"); | 1500 | dev_info(&adapter->pdev->dev, "Requesting reset from PF\n"); |
| @@ -1980,7 +1980,7 @@ static int i40evf_check_reset_complete(struct i40e_hw *hw) | |||
| 1980 | if ((rstat == I40E_VFR_VFACTIVE) || | 1980 | if ((rstat == I40E_VFR_VFACTIVE) || |
| 1981 | (rstat == I40E_VFR_COMPLETED)) | 1981 | (rstat == I40E_VFR_COMPLETED)) |
| 1982 | return 0; | 1982 | return 0; |
| 1983 | udelay(10); | 1983 | usleep_range(10, 20); |
| 1984 | } | 1984 | } |
| 1985 | return -EBUSY; | 1985 | return -EBUSY; |
| 1986 | } | 1986 | } |
