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>
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 7ffa94d..a030691 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -3263,7 +3263,6 @@
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
@@ -3288,6 +3287,10 @@
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);