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

Commit 38af8977 authored by Pradeep P V K's avatar Pradeep P V K Committed by c_ppvk
Browse files

mmc: card: WARN_ON in cmdq completion context



Due to command queuing, there is a possibility of servicing
completion of multiple requests from hw irq context. So in
this case, hw irq will launch softirq for all requests which
were completed (irrespective of whether it was success or failure).

If one of the requests failed, then the softirq corresponding
to error ed request will set current cmdq state to CMDQ_STATE_ERR.
Because of this, subsequent completion softirqs for successful
requests will BUG_ON.

We should let higher layers know of completion of successful
requests. Hence change the BUG_ON to WARN_ON and skip
blk_end_request() only if the corresponding request has
an error (instead of checking if the cmdq state is in error)

Change-Id: Ieb7f9d12ba04b6ab6499bf29f3716b0ddfb880fb
Signed-off-by: default avatarPradeep P V K <ppvk@codeaurora.org>
parent 4719c01d
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -3073,7 +3073,7 @@ void mmc_blk_cmdq_complete_rq(struct request *rq)
	 * or disable state so cannot receive any completion of
	 * or disable state so cannot receive any completion of
	 * other requests.
	 * other requests.
	 */
	 */
	BUG_ON(test_bit(CMDQ_STATE_ERR, &ctx_info->curr_state));
	WARN_ON(test_bit(CMDQ_STATE_ERR, &ctx_info->curr_state));


	/* clear pending request */
	/* clear pending request */
	BUG_ON(!test_and_clear_bit(cmdq_req->tag,
	BUG_ON(!test_and_clear_bit(cmdq_req->tag,
@@ -3107,7 +3107,7 @@ void mmc_blk_cmdq_complete_rq(struct request *rq)
out:
out:


	mmc_cmdq_clk_scaling_stop_busy(host, true, is_dcmd);
	mmc_cmdq_clk_scaling_stop_busy(host, true, is_dcmd);
	if (!test_bit(CMDQ_STATE_ERR, &ctx_info->curr_state)) {
	if (!(err || cmdq_req->resp_err)) {
		mmc_host_clk_release(host);
		mmc_host_clk_release(host);
		wake_up(&ctx_info->wait);
		wake_up(&ctx_info->wait);
		mmc_put_card(host->card);
		mmc_put_card(host->card);