mmc: block: fix dump cmdq registers on request timeout

Timeout handler executed on softirq context. cmdq dumpstate() api resumes
platform device and it can't be executed on softirq context. Request
completion callback schedules error handler work in case of timeout error.
This change moves CQE registers dump to the error handler callback.

Change-Id: Iea26ca5240f6031218dcf374cafcf2708df1f125
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
This commit is contained in:
Konstantin Dorfman 2015-06-30 17:39:43 +03:00 committed by Subhash Jadavani
parent ea5bb47711
commit 396e0ff6eb
2 changed files with 7 additions and 1 deletions

View file

@ -2972,7 +2972,6 @@ static enum blk_eh_timer_return mmc_blk_cmdq_req_timed_out(struct request *req)
struct mmc_request *mrq = &mq_rq->cmdq_req.mrq;
struct mmc_cmdq_req *cmdq_req = &mq_rq->cmdq_req;
host->cmdq_ops->dumpstate(host);
if (cmdq_req->cmdq_req_flags & DCMD)
mrq->cmd->error = -ETIMEDOUT;
else
@ -2997,6 +2996,10 @@ static void mmc_blk_cmdq_err(struct mmc_queue *mq)
struct mmc_cmdq_context_info *ctx_info = &host->cmdq_ctx;
pm_runtime_get_sync(&card->dev);
mmc_host_clk_hold(host);
host->cmdq_ops->dumpstate(host);
mmc_host_clk_release(host);
err = mmc_cmdq_halt(host, true);
if (err) {
pr_err("halt: failed: %d\n", err);

View file

@ -1547,6 +1547,9 @@ int mmc_cmdq_wait_for_dcmd(struct mmc_host *host,
mmc_hostname(host), cmd->opcode,
cmd->error);
err = cmd->error;
mmc_host_clk_hold(host);
host->cmdq_ops->dumpstate(host);
mmc_host_clk_release(host);
}
return err;
}