Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1381735ybj; Thu, 7 May 2020 23:24:17 -0700 (PDT) X-Google-Smtp-Source: APiQypJ4lUX0Rnnxmyn7511G4nk2jBl4/yHmT4yPqCnymF1V3SHyECekYDfrpYGstGadn/WdQ0NC X-Received: by 2002:a17:906:4548:: with SMTP id s8mr536858ejq.349.1588919057133; Thu, 07 May 2020 23:24:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588919057; cv=none; d=google.com; s=arc-20160816; b=HLbvLlzC7J53UIlF16LT+ZDVY9TNrpZzwfy0TnHISLeNdhU0HWecvkm6YnrLIY+XVJ erYssACo2PXQA7Wrvs2+5Pb836yREAcxdGb2DQzKZVltT5IhTM7jiJBePm3zkPbf/vyz aP2THYmAc0LHufXa7dgNtaNlddiTL6NHwGOPWBI3ftFicb8MkNI++ElKCur/UScLcUSP Xu95ENrsSDud3n5MFBOjEC8YuA3NkxFEico9pDReBJNLqf/mi/LLFZrTfmHt3x6ZL/vt qrOzLQxtRXfPBljYO2YLDKJ+HILPjossKC+uXB6OyaXR6vEDXWuF0xmkwrFClBOGxFlo nCeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:references:in-reply-to :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=ULPml9EZK+rMov9wHywCSBsaP/gMxBxwJQnS+kIEph0=; b=Y1IPmHXZTCR5S4OtluL/EHF63p73wqyKFRs7Gfjb8nD5a10ROnoR0q6M1VPAmAZCaK P5tub8NTwOu23fhrGLXNi3sNqv2fyAimrskw/ivpBOCpHYM5iaTyA4PwGrVr6dPX2Cw6 RM/Y/bzJdR5hRmOXEUSAZFWgOZEP6M+/36WdNZ/bmFonPrgjD0EFnwPs1C3EYLf4BGOT 0zPGdN1aMDrxei8Q1RB/jLXtOhP6shFBhJYam2og1zBUDdf2Oygvxg51Ppi8fpyzmgJj MIOYD+KcRgoJ9Yl5ZTM4007iavIo2rFABF60yMnv9U468JTDUjEgooSVkbYetj/4bSa2 c7Fw== 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 co2si403024edb.524.2020.05.07.23.23.54; Thu, 07 May 2020 23:24:17 -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 S1727816AbgEHGWR (ORCPT + 99 others); Fri, 8 May 2020 02:22:17 -0400 Received: from mga06.intel.com ([134.134.136.31]:24128 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727770AbgEHGWO (ORCPT ); Fri, 8 May 2020 02:22:14 -0400 IronPort-SDR: YwEr+wjliCFSMMF5hdlG5SkFgXtOTO77I9OtFK7cpkNHx/nyVa8kCIQE+8UqG7E6KXLst5HCt8 BFE2+ad9JhPg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 May 2020 23:22:10 -0700 IronPort-SDR: azBkB2zReMIRea4nr8iqnhF23nH8YNMx7xCa674lRJsz0a/NiGX79HxSVrTkw+t1KLQBS2ryzl Hj6QdGpZZndQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,366,1583222400"; d="scan'208";a="370353268" Received: from ahunter-desktop.fi.intel.com ([10.237.72.157]) by fmsmga001.fm.intel.com with ESMTP; 07 May 2020 23:22:07 -0700 From: Adrian Hunter To: Ulf Hansson Cc: linux-mmc , Veerabhadrarao Badiganti , Sahitya Tummala , Linux Kernel Mailing List , linux-arm-msm , Sarthak Garg , Baolin Wang , Yoshihiro Shimoda , Thomas Gleixner , Christoph Hellwig Subject: [PATCH RESEND] mmc: block: Fix request completion in the CQE timeout path Date: Fri, 8 May 2020 09:22:27 +0300 Message-Id: <20200508062227.23144-1-adrian.hunter@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki 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 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 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