mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 12:58:12 -04:00
Merge "msm: mhi_dev: Poll for ipa_dma_disable during MHI suspend"
This commit is contained in:
commit
cff2da1a99
1 changed files with 21 additions and 5 deletions
|
|
@ -22,7 +22,10 @@
|
|||
#define MHI_SM_FUNC_ENTRY() MHI_SM_DBG("ENTRY\n")
|
||||
#define MHI_SM_FUNC_EXIT() MHI_SM_DBG("EXIT\n")
|
||||
|
||||
#define PCIE_EP_TIMER_US 500000000
|
||||
#define PCIE_EP_TIMER_US 500000000
|
||||
#define MHI_IPA_DISABLE_DELAY_MS 10
|
||||
#define MHI_IPA_DISABLE_COUNTER 20
|
||||
|
||||
|
||||
static inline const char *mhi_sm_dev_event_str(enum mhi_dev_event state)
|
||||
{
|
||||
|
|
@ -591,7 +594,7 @@ static int mhi_sm_prepare_suspend(enum mhi_dev_state new_state)
|
|||
{
|
||||
enum mhi_dev_state old_state;
|
||||
struct ep_pcie_inactivity inact_param;
|
||||
int res = 0, rc;
|
||||
int res = 0, rc, wait_timeout = 0;
|
||||
|
||||
MHI_SM_DBG("Switching event:%d\n", new_state);
|
||||
|
||||
|
|
@ -668,11 +671,24 @@ static int mhi_sm_prepare_suspend(enum mhi_dev_state new_state)
|
|||
(new_state == MHI_DEV_M3_STATE))) {
|
||||
if (mhi_sm_ctx->mhi_dev->use_ipa) {
|
||||
MHI_SM_DBG("Disable IPA with ipa_dma_disable()\n");
|
||||
res = ipa_dma_disable();
|
||||
if (res) {
|
||||
MHI_SM_ERR("IPA disable failed\n");
|
||||
while (wait_timeout < MHI_IPA_DISABLE_COUNTER) {
|
||||
/* wait for the disable to finish */
|
||||
res = ipa_dma_disable();
|
||||
if (!res)
|
||||
break;
|
||||
MHI_SM_ERR
|
||||
("IPA disable fail cnt:%d\n",
|
||||
wait_timeout);
|
||||
msleep(MHI_IPA_DISABLE_DELAY_MS);
|
||||
wait_timeout++;
|
||||
}
|
||||
|
||||
if (wait_timeout >= MHI_IPA_DISABLE_COUNTER) {
|
||||
MHI_SM_ERR
|
||||
("Fail to disable IPA for M3\n");
|
||||
goto exit;
|
||||
}
|
||||
MHI_SM_ERR("IPA DMA successfully disabled\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue