diff mbox

mmc: block: Fix cmd error reset failure path

Message ID 558473bd-9fea-6f95-4eb1-9d72b5a25234@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Adrian Hunter Feb. 27, 2017, 7:36 a.m. UTC
Commit 4e1f780032c5 ("mmc: block: break out mmc_blk_rw_cmd_abort()")
assumed the request had not completed, but in one case it had. Fix that.

Fixes: 4e1f780032c5 ("mmc: block: break out mmc_blk_rw_cmd_abort()")
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 drivers/mmc/core/block.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Linus Walleij Feb. 27, 2017, 2:08 p.m. UTC | #1
On Mon, Feb 27, 2017 at 8:36 AM, Adrian Hunter <adrian.hunter@intel.com> wrote:

> Commit 4e1f780032c5 ("mmc: block: break out mmc_blk_rw_cmd_abort()")
> assumed the request had not completed, but in one case it had. Fix that.
>
> Fixes: 4e1f780032c5 ("mmc: block: break out mmc_blk_rw_cmd_abort()")
> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>

Ouch.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Adrian Hunter March 13, 2017, 12:43 p.m. UTC | #2
On 27/02/17 16:08, Linus Walleij wrote:
> On Mon, Feb 27, 2017 at 8:36 AM, Adrian Hunter <adrian.hunter@intel.com> wrote:
> 
>> Commit 4e1f780032c5 ("mmc: block: break out mmc_blk_rw_cmd_abort()")
>> assumed the request had not completed, but in one case it had. Fix that.
>>
>> Fixes: 4e1f780032c5 ("mmc: block: break out mmc_blk_rw_cmd_abort()")
>> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
> 
> Ouch.
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Seems it was applied to the wrong base.  I have sent it again with V2 of the
CQE patches.

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index b6d1497c395f..b277ce50a391 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -1708,7 +1708,8 @@  static void mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *new_req)
 		case MMC_BLK_CMD_ERR:
 			req_pending = mmc_blk_rw_cmd_err(md, card, brq, old_req, req_pending);
 			if (mmc_blk_reset(md, card->host, type)) {
-				mmc_blk_rw_cmd_abort(card, old_req);
+				if (req_pending)
+					mmc_blk_rw_cmd_abort(card, old_req);
 				mmc_blk_rw_try_restart(mq, new_req, mqrq_cur);
 				return;
 			}