diff options
| author | Linux Build Service Account <lnxbuild@quicinc.com> | 2017-08-20 01:17:09 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-08-20 01:17:09 -0700 |
| commit | 91e4f874193f19cd4dce320f6944380d4686a47e (patch) | |
| tree | 200eeecdecd6a20f628e3800e8a633b129088bc5 /drivers/platform | |
| parent | 7d8619d8fca9dfcaf2189b8a42eceee006441ad4 (diff) | |
| parent | a34763e5b34193d09ef4e7fc5e2d1e950d4f1538 (diff) | |
Merge "msm: gsi: check channel state on timeout" into msm-4.4
Diffstat (limited to 'drivers/platform')
| -rw-r--r-- | drivers/platform/msm/gsi/gsi.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/platform/msm/gsi/gsi.c b/drivers/platform/msm/gsi/gsi.c index b111a5904952..2ae2438032b7 100644 --- a/drivers/platform/msm/gsi/gsi.c +++ b/drivers/platform/msm/gsi/gsi.c @@ -1901,6 +1901,20 @@ int gsi_stop_channel(unsigned long chan_hdl) res = wait_for_completion_timeout(&ctx->compl, msecs_to_jiffies(GSI_STOP_CMD_TIMEOUT_MS)); if (res == 0) { + /* + * check channel state here in case the channel is stopped but + * the interrupt was not handled yet. + */ + val = gsi_readl(gsi_ctx->base + + GSI_EE_n_GSI_CH_k_CNTXT_0_OFFS(chan_hdl, + gsi_ctx->per.ee)); + ctx->state = (val & + GSI_EE_n_GSI_CH_k_CNTXT_0_CHSTATE_BMSK) >> + GSI_EE_n_GSI_CH_k_CNTXT_0_CHSTATE_SHFT; + if (ctx->state == GSI_CHAN_STATE_STOPPED) { + res = GSI_STATUS_SUCCESS; + goto free_lock; + } GSIDBG("chan_hdl=%lu timed out\n", chan_hdl); res = -GSI_STATUS_TIMED_OUT; goto free_lock; |
