Commit 1b5f5d38 authored by Marcin Formela's avatar Marcin Formela Committed by Jeff Kirsher
Browse files

i40e: fix retrying in i40e_aq_get_phy_capabilities



Fixed a bug where driver was breaking out of the loop and
reporting an error without retrying first.

Signed-off-by: default avatarMarcin Formela <marcin.formela@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 65c275e4
Loading
Loading
Loading
Loading
+10 −7
Original line number Diff line number Diff line
@@ -1577,18 +1577,21 @@ i40e_status i40e_aq_get_phy_capabilities(struct i40e_hw *hw,
		status = i40e_asq_send_command(hw, &desc, abilities,
					       abilities_size, cmd_details);

		if (status)
			break;

		if (hw->aq.asq_last_status == I40E_AQ_RC_EIO) {
		switch (hw->aq.asq_last_status) {
		case I40E_AQ_RC_EIO:
			status = I40E_ERR_UNKNOWN_PHY;
			break;
		} else if (hw->aq.asq_last_status == I40E_AQ_RC_EAGAIN) {
		case I40E_AQ_RC_EAGAIN:
			usleep_range(1000, 2000);
			total_delay++;
			status = I40E_ERR_TIMEOUT;
			break;
		/* also covers I40E_AQ_RC_OK */
		default:
			break;
		}
	} while ((hw->aq.asq_last_status != I40E_AQ_RC_OK) &&

	} while ((hw->aq.asq_last_status == I40E_AQ_RC_EAGAIN) &&
		(total_delay < max_delay));

	if (status)