From patchwork Wed Nov 1 07:38:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 160457 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp244160vqx; Wed, 1 Nov 2023 00:39:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHTF4iPdmi1TmaOoYhGT4Ls0itrX8au4Lcz9yecO3qU2iXcYne7Q6ZKAvFLaGXcE1hpfxWw X-Received: by 2002:a05:6a00:138f:b0:6bb:4360:159e with SMTP id t15-20020a056a00138f00b006bb4360159emr19415170pfg.17.1698824343205; Wed, 01 Nov 2023 00:39:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698824343; cv=none; d=google.com; s=arc-20160816; b=LLC5Q7w9BT0TkRDBZOYqEuRYEIS+co++p5GurCpx/BlTPAdgfsbWN8rtU6pP7q8VTj wl4GZEla3y1h18JvrsKht+NOB4XVd88qsb0kISUj4WWq9VA58FK7NyDTT3NKBfpHJ8w5 OMgh6VRwMVveIEEQ5J4h/cewvR1aFLP1Sk2jO4mConSNmuvhWPze0xLrTcjb7fssGUMj xsyHCBxwPkvzh/TTHv7XTMxteWFsDt/wZdyMpR+heQDorLXG07Z2nuRNxHq6PQcCdXam 8ac3TDzPdCgs83WJvS2smf3ordrhzpbbTlk99i5RFy2Z1oy2tpb/5cQOXTc9piJY9ETc +uBw== 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 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id fi26-20020a056a00399a00b0068e3f550763si1110837pfb.101.2023.11.01.00.39.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 00:39:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; 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 23.128.96.37 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 511F780C0A47; Wed, 1 Nov 2023 00:39:02 -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 S231436AbjKAHi5 (ORCPT + 35 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_Dul=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 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:02 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781346434670623989 X-GMAIL-MSGID: 1781346434670623989 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); }