Commit c077dc5e authored by Adrian Hunter's avatar Adrian Hunter Committed by Ulf Hansson

mmc: block: Fix request completion in the CQE timeout path

First, it should be noted that the CQE timeout (60 seconds) is substantial
so a CQE request that times out is really stuck, and the race between
timeout and completion is extremely unlikely. Nevertheless this patch
fixes an issue with it.

Commit ad73d6fe ("mmc: complete requests from ->timeout")
preserved the existing functionality, to complete the request.
However that had only been necessary because the block layer
timeout handler had been marking the request to prevent it from being
completed normally. That restriction was removed at the same time, the
result being that a request that has gone will have been completed anyway.
That is, the completion was unnecessary.

At the time, the unnecessary completion was harmless because the block
layer would ignore it, although that changed in kernel v5.0.

Note for stable, this patch will not apply cleanly without patch "mmc:
core: Fix recursive locking issue in CQE recovery path"
Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Fixes: ad73d6fe ("mmc: complete requests from ->timeout")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20200508062227.23144-1-adrian.hunter@intel.comSigned-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 39a22f73
...@@ -110,8 +110,7 @@ static enum blk_eh_timer_return mmc_cqe_timed_out(struct request *req) ...@@ -110,8 +110,7 @@ static enum blk_eh_timer_return mmc_cqe_timed_out(struct request *req)
mmc_cqe_recovery_notifier(mrq); mmc_cqe_recovery_notifier(mrq);
return BLK_EH_RESET_TIMER; return BLK_EH_RESET_TIMER;
} }
/* No timeout (XXX: huh? comment doesn't make much sense) */ /* The request has gone already */
blk_mq_complete_request(req);
return BLK_EH_DONE; return BLK_EH_DONE;
default: default:
/* Timeout is handled by mmc core */ /* Timeout is handled by mmc core */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment