summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSujeev Dias <sdias@codeaurora.org>2016-06-01 17:06:57 -0700
committerSujeev Dias <sdias@codeaurora.org>2017-02-21 17:12:01 -0800
commit8526dcd42590d3d4d87b4141996e03b25023d1fc (patch)
treec43d390f48ff870bdbbc691a86c97da950d99c93
parent683cb7801ea873103b09008db6c13c73adec2829 (diff)
mhi: core: Do not reset doorbell mode during MHI_M3 abort
In order to avoid being out of sync between MHI client and MHI host, host shall not reset the doorbell modes for hardware channels during MHI_M3 state transition abort. CRs-Fixed: 1023725 Change-Id: I6c742fc968fd57d71a86039bf1f3f65b1362bc90 Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
-rw-r--r--drivers/platform/msm/mhi/mhi_states.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/platform/msm/mhi/mhi_states.c b/drivers/platform/msm/mhi/mhi_states.c
index b841d51d1f1d..5dca3b65e38d 100644
--- a/drivers/platform/msm/mhi/mhi_states.c
+++ b/drivers/platform/msm/mhi/mhi_states.c
@@ -80,7 +80,8 @@ static void conditional_chan_db_write(
spin_unlock_irqrestore(&mhi_dev_ctxt->db_write_lock[chan], flags);
}
-static void ring_all_chan_dbs(struct mhi_device_ctxt *mhi_dev_ctxt)
+static void ring_all_chan_dbs(struct mhi_device_ctxt *mhi_dev_ctxt,
+ bool reset_db_mode)
{
u32 i = 0;
struct mhi_ring *local_ctxt = NULL;
@@ -89,7 +90,7 @@ static void ring_all_chan_dbs(struct mhi_device_ctxt *mhi_dev_ctxt)
for (i = 0; i < MHI_MAX_CHANNELS; ++i)
if (VALID_CHAN_NR(i)) {
local_ctxt = &mhi_dev_ctxt->mhi_local_chan_ctxt[i];
- if (IS_HARDWARE_CHANNEL(i))
+ if (IS_HARDWARE_CHANNEL(i) && reset_db_mode)
mhi_dev_ctxt->flags.db_mode[i] = 1;
if ((local_ctxt->wp != local_ctxt->rp) ||
((local_ctxt->wp != local_ctxt->rp) &&
@@ -186,7 +187,7 @@ static int process_m0_transition(
if (mhi_dev_ctxt->flags.mhi_initialized) {
ring_all_ev_dbs(mhi_dev_ctxt);
- ring_all_chan_dbs(mhi_dev_ctxt);
+ ring_all_chan_dbs(mhi_dev_ctxt, true);
ring_all_cmd_dbs(mhi_dev_ctxt);
}
atomic_dec(&mhi_dev_ctxt->flags.data_pending);
@@ -618,7 +619,7 @@ static int process_amss_transition(
"Failed to set local chan state ret %d\n", r);
return r;
}
- ring_all_chan_dbs(mhi_dev_ctxt);
+ ring_all_chan_dbs(mhi_dev_ctxt, true);
mhi_log(MHI_MSG_INFO,
"Notifying clients that MHI is enabled\n");
enable_clients(mhi_dev_ctxt, mhi_dev_ctxt->dev_exec_env);
@@ -632,7 +633,7 @@ static int process_amss_transition(
i, r);
return r;
}
- ring_all_chan_dbs(mhi_dev_ctxt);
+ ring_all_chan_dbs(mhi_dev_ctxt, true);
}
ring_all_ev_dbs(mhi_dev_ctxt);
atomic_dec(&mhi_dev_ctxt->flags.data_pending);
@@ -1008,7 +1009,7 @@ unlock:
if (abort_m3) {
atomic_inc(&mhi_dev_ctxt->flags.data_pending);
write_unlock_irqrestore(&mhi_dev_ctxt->xfer_lock, flags);
- ring_all_chan_dbs(mhi_dev_ctxt);
+ ring_all_chan_dbs(mhi_dev_ctxt, false);
ring_all_cmd_dbs(mhi_dev_ctxt);
atomic_dec(&mhi_dev_ctxt->flags.data_pending);
mhi_deassert_device_wake(mhi_dev_ctxt);