Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3354a0f6 authored by Mohamed Abbas's avatar Mohamed Abbas Committed by John W. Linville
Browse files

iwlwifi: Check HW ready before prepare card.



Hardware may be ready for us to manage it without us trying to prepare
it first. Check if this is the case.

Signed-off-by: default avatarMohamed Abbas <mohamed.abbas@intel.com>
Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 7d5ca3b8
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -1812,6 +1812,11 @@ static int iwl_prepare_card_hw(struct iwl_priv *priv)


	IWL_DEBUG_INFO(priv, "iwl_prepare_card_hw enter \n");
	IWL_DEBUG_INFO(priv, "iwl_prepare_card_hw enter \n");


	ret = iwl_set_hw_ready(priv);
	if (priv->hw_ready)
		return ret;

	/* If HW is not ready, prepare the conditions to check again */
	iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
	iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
			CSR_HW_IF_CONFIG_REG_PREPARE);
			CSR_HW_IF_CONFIG_REG_PREPARE);


@@ -1819,6 +1824,7 @@ static int iwl_prepare_card_hw(struct iwl_priv *priv)
			~CSR_HW_IF_CONFIG_REG_BIT_NIC_PREPARE_DONE,
			~CSR_HW_IF_CONFIG_REG_BIT_NIC_PREPARE_DONE,
			CSR_HW_IF_CONFIG_REG_BIT_NIC_PREPARE_DONE, 150000);
			CSR_HW_IF_CONFIG_REG_BIT_NIC_PREPARE_DONE, 150000);


	/* HW should be ready by now, check again. */
	if (ret != -ETIMEDOUT)
	if (ret != -ETIMEDOUT)
		iwl_set_hw_ready(priv);
		iwl_set_hw_ready(priv);