Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b481e20b authored by Konstantin Dorfman's avatar Konstantin Dorfman
Browse files

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: default avatarKonstantin Dorfman <kdorfman@codeaurora.org>
parent 6f524acc
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -2864,7 +2864,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
@@ -2889,6 +2888,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);
+3 −0
Original line number Diff line number Diff line
@@ -1264,6 +1264,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;
}