@@ -902,7 +902,7 @@ i40e_status i40e_asq_send_command(struct i40e_hw *hw,
* we need to wait for desc write back
*/
if (!details->async && !details->postpone) {
- u32 total_delay = 0;
+ unsigned long timeout_end = jiffies + usecs_to_jiffies(hw->aq.asq_cmd_timeout);
do {
/* AQ designers suggest use of head for better
@@ -910,9 +910,8 @@ i40e_status i40e_asq_send_command(struct i40e_hw *hw,
*/
if (i40e_asq_done(hw))
break;
- udelay(50);
- total_delay += 50;
- } while (total_delay < hw->aq.asq_cmd_timeout);
+ usleep_range(25, 50);
+ } while (time_before(jiffies, timeout_end));
}
/* if ready, copy the desc back to temp */