mhi: core: allow communication during shutdown

MHI clients allowed to communicate with external
soc via MHI during shutdown. Only disable MHI
communication after receiving shutdown notification.

CRs-Fixed: 2037184
Change-Id: If69f61a244a6175256753dea361085fa5f9afeac
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
This commit is contained in:
Sujeev Dias 2017-04-21 14:47:02 -07:00 committed by Gerrit - the friendly Code Review server
parent 0bdf562cc7
commit 36603a2a72

View file

@ -29,11 +29,9 @@ static int mhi_ssr_notify_cb(struct notifier_block *nb,
mhi_log(mhi_dev_ctxt, MHI_MSG_INFO, mhi_log(mhi_dev_ctxt, MHI_MSG_INFO,
"Received ESOC notifcation:%lu crashed:%d\n", action, crashed); "Received ESOC notifcation:%lu crashed:%d\n", action, crashed);
switch (action) { switch (action) {
case SUBSYS_BEFORE_SHUTDOWN: case SUBSYS_AFTER_SHUTDOWN:
/*
* update internal states only, we'll clean up MHI context /* Disable internal state, no more communication */
* after device shutdown completely.
*/
write_lock_irq(&mhi_dev_ctxt->pm_xfer_lock); write_lock_irq(&mhi_dev_ctxt->pm_xfer_lock);
cur_state = mhi_tryset_pm_state(mhi_dev_ctxt, cur_state = mhi_tryset_pm_state(mhi_dev_ctxt,
MHI_PM_LD_ERR_FATAL_DETECT); MHI_PM_LD_ERR_FATAL_DETECT);
@ -42,8 +40,6 @@ static int mhi_ssr_notify_cb(struct notifier_block *nb,
mhi_log(mhi_dev_ctxt, MHI_MSG_INFO, mhi_log(mhi_dev_ctxt, MHI_MSG_INFO,
"Failed to transition to state 0x%x from 0x%x\n", "Failed to transition to state 0x%x from 0x%x\n",
MHI_PM_LD_ERR_FATAL_DETECT, cur_state); MHI_PM_LD_ERR_FATAL_DETECT, cur_state);
break;
case SUBSYS_AFTER_SHUTDOWN:
if (mhi_dev_ctxt->mhi_pm_state != MHI_PM_DISABLE) if (mhi_dev_ctxt->mhi_pm_state != MHI_PM_DISABLE)
process_disable_transition(MHI_PM_SHUTDOWN_PROCESS, process_disable_transition(MHI_PM_SHUTDOWN_PROCESS,
mhi_dev_ctxt); mhi_dev_ctxt);