Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp738889rdb; Wed, 1 Nov 2023 00:39:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFpZI1PVH4Bpp7l+wnotMb+nGfathgAkIpCPr8fDp4vmo4mLpcGctn+og1xULOs7mQa6QpY X-Received: by 2002:a05:6870:815:b0:1e9:9c39:a580 with SMTP id fw21-20020a056870081500b001e99c39a580mr17763513oab.7.1698824341579; Wed, 01 Nov 2023 00:39:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698824341; cv=none; d=google.com; s=arc-20160816; b=XBrfMXsM+1mVXsfoZSPxuO1/1TQ6WsjqQP4K8dXUXU2R3W1wY1cxm8+fS6WjYZnm3p rRAHh5B+2JqYAuHHo3qZcWdlHfkiL80A4Xz6NBiSC2b21AQGz/COeEsnyYquTBsqtoTQ X2s6tEWKNf8F0E4S0arIyosblPPMgWG6eaCx+2P7DV0b3CwJbQ1XuysVe+dvH5Cp0hOi KGyLu9R3HQA8Ej7TPKwcFD4fvozlfzM/E+wAXGsPjggPGemQ8SfXS/Wyeaj4Su8bNDbJ /Hosm+gPW9LpUThGrcoD/FJtQgzBhA0aQ2e4OaGUWS+mzWUl5K2xXF9OpBk1H9S3ZMD9 k8fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:organization :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5J0htK/ANZECTLyddEuMj3zEZVPZu/LSWK9MeetjuA0=; fh=B/ymYvz68TmAYsy3osQThBsQqGybcLhrtzuZ248faME=; b=QhmjuHf2/C0rjJ+JlGDQsEyTWaOQgy6S9WAHUBzrU/hUTHSnP4eSvxKgfAUvPnpspe EE9p1dfFnu+msPhcs6EYdAgGggp9Sb6Qwai8xYH8xt28+Q2ZTm+CrJ7Phw8SLeOHBEFd gkqPO7Pr4E6xF/5GSeHqKToRkCktHJFXvsdA60bs2Lb2SFAY0Hh8UiR44nZpTdO4EhzJ x4oSMPtdrrEFBr6w4ZnV/xUhyJIQrRHfa/HI2Hsbf7qWwCGzHBYeu17ZykjVQJpfQe03 uxZitiMueNFQLxcFNxEWwAmlxuWCvJzDbviD6I5OXX9yjHyPqsm3o2qt28cIA3KxM08/ OlwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=LSmvbWQD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id bs192-20020a6328c9000000b005b4ef61bfc7si2317503pgb.596.2023.11.01.00.39.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 00:39:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=LSmvbWQD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 53B1380C0A47; Wed, 1 Nov 2023 00:39:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231245AbjKAHi5 (ORCPT + 99 others); Wed, 1 Nov 2023 03:38:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231422AbjKAHiz (ORCPT ); Wed, 1 Nov 2023 03:38:55 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03AECED; Wed, 1 Nov 2023 00:38:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698824330; x=1730360330; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CPuhmUzZJc2Fl7jj6hRHKrHunHiCOvwemWTDCOmv/zs=; b=LSmvbWQDuaVWXy4noa/jJCf4Ics4FsHz6K/5RuUsWFL6HznUGcbGV4uB PGs5xAZW0tfGJk1ayiJ6PsrFTZbi9RIFY05jGuVjsjoiNX/UCpd4Uz+28 WVHHxqqGcxvNUK/Hv48cgCdCVP84cbMRjUv4R7kmkyOkfdfXHlxsI8pvP pZbrq/inBmbcC4PY3e7+vdhJOE/zWnOlYzmvHxCxD4Ykbmanwf8/7OSEA zlewnbVCHfBFq5FFq0RkSKq49yTsR4tibbz+5zSgSJkKwv1JJC4pstd7+ yDdwS0ZVO6g9ebTqk9vsjL2pH7WxdUv7GPy0oMf/diQJ4S/91J+Yd0keZ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10880"; a="9982635" X-IronPort-AV: E=Sophos;i="6.03,267,1694761200"; d="scan'208";a="9982635" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2023 00:38:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10880"; a="934357517" X-IronPort-AV: E=Sophos;i="6.03,267,1694761200"; d="scan'208";a="934357517" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO ahunter-VirtualBox.home\044ger.corp.intel.com) ([10.252.34.17]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2023 00:38:43 -0700 From: Adrian Hunter To: Ulf Hansson , =?UTF-8?q?Kornel=20Dul=C4=99ba?= , Radoslaw Biernacki , Gwendal Grignou , Ritesh Harjani , Asutosh Das Cc: Chaotian Jing , Aswath Govindraju , Bhavya Kapoor , Kamal Dasu , Al Cooper , Haibo Chen , Bhupesh Sharma , Shaik Sajida Bhanu , Sai Krishna Potthuri , Swati Agarwal , Victor Shih , Ben Chuang , Thierry Reding , Aniruddha Tvs Rao , Chun-Hung Wu , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/5] mmc: block: Do not lose cache flush during CQE error recovery Date: Wed, 1 Nov 2023 09:38:23 +0200 Message-Id: <20231101073827.4772-2-adrian.hunter@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231101073827.4772-1-adrian.hunter@intel.com> References: <20231101073827.4772-1-adrian.hunter@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 01 Nov 2023 00:39:00 -0700 (PDT) During CQE error recovery, error-free data commands get requeued if there is any data left to transfer, but non-data commands are completed even though they have not been processed. Requeue them instead. Note the only non-data command is cache flush, which would have resulted in a cache flush being lost if it was queued at the time of CQE recovery. Fixes: 1e8e55b67030 ("mmc: block: Add CQE support") Cc: stable@vger.kernel.org Signed-off-by: Adrian Hunter --- drivers/mmc/core/block.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index 3a8f27c3e310..4a32b756b7d8 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -1482,6 +1482,8 @@ static void mmc_blk_cqe_complete_rq(struct mmc_queue *mq, struct request *req) blk_mq_requeue_request(req, true); else __blk_mq_end_request(req, BLK_STS_OK); + } else if (mq->in_recovery) { + blk_mq_requeue_request(req, true); } else { blk_mq_end_request(req, BLK_STS_OK); } -- 2.34.1