linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-mmc <linux-mmc@vger.kernel.org>,
	Veerabhadrarao Badiganti <vbadigan@codeaurora.org>,
	Sahitya Tummala <stummala@codeaurora.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-arm-msm <linux-arm-msm@vger.kernel.org>,
	Sarthak Garg <sartgarg@codeaurora.org>,
	Baolin Wang <baolin.wang@linaro.org>,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Christoph Hellwig <hch@lst.de>
Subject: [PATCH RESEND] mmc: block: Fix request completion in the CQE timeout path
Date: Fri,  8 May 2020 09:22:27 +0300	[thread overview]
Message-ID: <20200508062227.23144-1-adrian.hunter@intel.com> (raw)
In-Reply-To: <CAPDyKFo10JFbe7ZFnRBE2e55eGs-odAWYxU+Ep0S74003aLGpg@mail.gmail.com>

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 ad73d6feadbd7b ("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: Adrian Hunter <adrian.hunter@intel.com>
Fixes: ad73d6feadbd7b ("mmc: complete requests from ->timeout")
Cc: stable@vger.kernel.org
---
 drivers/mmc/core/queue.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c
index 72bef39d7011..10ea67892b5f 100644
--- a/drivers/mmc/core/queue.c
+++ b/drivers/mmc/core/queue.c
@@ -110,8 +110,7 @@ static enum blk_eh_timer_return mmc_cqe_timed_out(struct request *req)
 				mmc_cqe_recovery_notifier(mrq);
 			return BLK_EH_RESET_TIMER;
 		}
-		/* No timeout (XXX: huh? comment doesn't make much sense) */
-		blk_mq_complete_request(req);
+		/* The request has gone already */
 		return BLK_EH_DONE;
 	default:
 		/* Timeout is handled by mmc core */
-- 
2.17.1


  reply	other threads:[~2020-05-08  6:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-06 14:34 [PATCH V1 0/2] CQE fixes Veerabhadrarao Badiganti
2020-05-06 14:34 ` [PATCH V1 1/2] mmc: core: Check request type before completing the request Veerabhadrarao Badiganti
2020-05-06 17:06   ` Adrian Hunter
2020-05-08  8:12   ` Ulf Hansson
2020-05-06 14:34 ` [PATCH V1 2/2] mmc: core: Fix recursive locking issue in CQE recovery path Veerabhadrarao Badiganti
2020-05-07 11:48   ` Adrian Hunter
2020-05-07 14:06     ` [PATCH] mmc: block: Fix request completion in the CQE timeout path Adrian Hunter
2020-05-08  5:25       ` Ulf Hansson
2020-05-08  6:22         ` Adrian Hunter [this message]
2020-05-08  8:17           ` [PATCH RESEND] " Ulf Hansson
2020-05-07 16:15   ` [PATCH V2] mmc: core: Fix recursive locking issue in CQE recovery path Veerabhadrarao Badiganti
2020-05-07 17:21     ` Adrian Hunter
2020-05-08  8:12     ` Ulf Hansson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200508062227.23144-1-adrian.hunter@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=baolin.wang@linaro.org \
    --cc=hch@lst.de \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=sartgarg@codeaurora.org \
    --cc=stummala@codeaurora.org \
    --cc=tglx@linutronix.de \
    --cc=ulf.hansson@linaro.org \
    --cc=vbadigan@codeaurora.org \
    --cc=yoshihiro.shimoda.uh@renesas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).