Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp763448ybj; Thu, 7 May 2020 07:09:01 -0700 (PDT) X-Google-Smtp-Source: APiQypL/PDda++SNhcmXtx+QFavksx5wZmZV24XdnIGinSNqzghUn9C6iRPsQZ7/Zu+l99LOlWif X-Received: by 2002:a17:907:9481:: with SMTP id dm1mr12787660ejc.268.1588860541553; Thu, 07 May 2020 07:09:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588860541; cv=none; d=google.com; s=arc-20160816; b=OsyVe0aHS7VkvdjPkANGVs18zS5bRkHSRF5b21/zXzibQuXj7ytKl8Ux+AlKw70hIt Io01WBa1hUw04LoMKQoQD7x773VBedtnirhDw5mklRr2GTkhcgimVjzXCu+abCA0E1Ex OrXR60PnxCpijkJJaKLm9E1uIgKrTqreiP2R/dkSDg9qKxS45cVF2CY5QOSPU3CvEOF+ BamyCL01UAmNf2TULU402Ku22g1SRDGHten58yVM9vE3iF9p3WT0ny4rhQBXOnogSQtB +OK2/h15Qsj2UMtM8g2d5hp3dmkjVpstCOY3JzywQYF7aixqGjTrke5stpRwqaZZBHil holg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:references:cc:to:from:subject:ironport-sdr :ironport-sdr; bh=JR7qu63ecwvG6G6Ilyum3XRl4VHS7+M94u931LiESik=; b=y4DTYx4Ikrbz7Bkf33qTvPXm9oWaXsga5pNFdcEKaZUQHhUKaXr0nFt24vgKsYOyzs 0w0gn4V/0AcRQ919q00axnUkh/LtaoqJfdxtoDp+wcB1sousFJWRz71OKffqoR+srQDN J4tCQcjfwXr+WdKo3k+kFq9du0bLr0XHsFOS2EVFcm09ox2VvBr5K8+3gq108+YadDfS oTHB1tIfoZNibyrCHWMQHjF6IPxTpQf4iJm+LKZDH3+s+UwVCHDPSM7XzreSw8hW9Tn6 xFf4CRE35rTeRlmaDInvUL5bJXVmeBmh70JofbkwL/MV7V0TtHr2Kjoq5Nzoduk4w1CU 5QiA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u26si3249644edb.4.2020.05.07.07.08.37; Thu, 07 May 2020 07:09:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726683AbgEGOGA (ORCPT + 99 others); Thu, 7 May 2020 10:06:00 -0400 Received: from mga02.intel.com ([134.134.136.20]:59853 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726267AbgEGOF7 (ORCPT ); Thu, 7 May 2020 10:05:59 -0400 IronPort-SDR: RP/Y2f1PV6Emv49xb6l2YoaXl7/QebIatPptIWObMuuctY/UK0QSHCdI1hudmEjixDfd464bDX /sPvo1RSme8g== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 May 2020 07:05:58 -0700 IronPort-SDR: 5tCBvfLrV57N2TTqBGhMqkkL/5QL+bUuW+LU44NCJSYKO4wgf/ixNS2eiWonlITIrNCWcGxFft bqNf61n2K5pA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,363,1583222400"; d="scan'208";a="339361341" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.157]) ([10.237.72.157]) by orsmga001.jf.intel.com with ESMTP; 07 May 2020 07:05:55 -0700 Subject: [PATCH] mmc: block: Fix request completion in the CQE timeout path From: Adrian Hunter To: Veerabhadrarao Badiganti , ulf.hansson@linaro.org Cc: stummala@codeaurora.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Sarthak Garg , stable@vger.kernel.org, Baolin Wang , Yoshihiro Shimoda , Thomas Gleixner , Christoph Hellwig References: <1588775643-18037-1-git-send-email-vbadigan@codeaurora.org> <1588775643-18037-3-git-send-email-vbadigan@codeaurora.org> Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <66747f4c-e61f-509f-a3cc-7e3499a844e4@intel.com> Date: Thu, 7 May 2020 17:06:15 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 in the timeout handler became 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 Fixes: ad73d6feadbd7b ("mmc: complete requests from ->timeout") Cc: stable@vger.kernel.org --- This is the patch I alluded to when replying to "mmc: core: Fix recursive locking issue in CQE recovery path" 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