cnss2: Handle -ETIMEDOUT properly for MHI power on failure

If MHI power on returns -ETIMEDOUT, controller needs to take care
the cleanup by calling MHI power down. Force to set the power on
bit for driver internal MHI state to make sure it can be handled
properly later.

Change-Id: Icdeb3fc10a18cf643710240aa4984af61c8b5195
Signed-off-by: Yue Ma <yuem@codeaurora.org>
This commit is contained in:
Yue Ma 2021-02-04 15:50:59 -08:00
commit c690a7dbd6

View file

@ -1530,11 +1530,16 @@ int cnss_pci_start_mhi(struct cnss_pci_data *pci_priv)
pci_priv->mhi_ctrl->timeout_ms = timeout;
/* -ETIMEDOUT means MHI power on has succeeded but timed out
* for firmware mission mode event, so handle it properly.
*/
if (ret == -ETIMEDOUT)
if (ret == -ETIMEDOUT) {
/* This is a special case needs to be handled that if MHI
* power on returns -ETIMEDOUT, controller needs to take care
* the cleanup by calling MHI power down. Force to set the bit
* for driver internal MHI state to make sure it can be handled
* properly later.
*/
set_bit(CNSS_MHI_POWER_ON, &pci_priv->mhi_state);
ret = cnss_pci_handle_mhi_poweron_timeout(pci_priv);
}
return ret;
}