mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 00:24:41 -04:00
cnss2: retry mhi fast suspend if mhi returns EBUSY
Add code to retry mhi fast suspend if mhi layer has pending packets and returns EBUSY. Change-Id: Ifb9ee8371c092db3fd7bece2de1e7166ac6f303f Signed-off-by: Mohammed Siddiq <msiddiq@codeaurora.org>
This commit is contained in:
parent
0a69438bf7
commit
d87467913d
1 changed files with 10 additions and 10 deletions
|
|
@ -1737,20 +1737,20 @@ static int cnss_pci_set_mhi_state(struct cnss_pci_data *pci_priv,
|
|||
break;
|
||||
case CNSS_MHI_SUSPEND:
|
||||
mutex_lock(&pci_priv->mhi_ctrl->pm_mutex);
|
||||
retry:
|
||||
if (pci_priv->drv_connected_last) {
|
||||
ret = mhi_pm_fast_suspend(pci_priv->mhi_ctrl, true);
|
||||
} else {
|
||||
ret = mhi_pm_suspend(pci_priv->mhi_ctrl);
|
||||
/* in some corner case, when cnss try to suspend,
|
||||
* there is still packets pending in mhi layer,
|
||||
* so retry suspend to save roll back effort.
|
||||
*/
|
||||
while (ret == -EBUSY && retry < MHI_SUSPEND_RETRY_CNT) {
|
||||
usleep_range(5000, 6000);
|
||||
retry++;
|
||||
cnss_pr_err("mhi is busy, retry #%u", retry);
|
||||
ret = mhi_pm_suspend(pci_priv->mhi_ctrl);
|
||||
}
|
||||
}
|
||||
/* in some corner case, when cnss try to suspend,
|
||||
* there is still packets pending in mhi layer,
|
||||
* so retry suspend to save roll back effort.
|
||||
*/
|
||||
if (ret == -EBUSY && retry++ < MHI_SUSPEND_RETRY_CNT) {
|
||||
usleep_range(5000, 6000);
|
||||
cnss_pr_err("mhi is busy, retry #%u", retry);
|
||||
goto retry;
|
||||
}
|
||||
mutex_unlock(&pci_priv->mhi_ctrl->pm_mutex);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in a new issue