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); } From patchwork Wed Nov 1 07:38:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 160458 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp244180vqx; Wed, 1 Nov 2023 00:39:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH4l+piOY+VjVYor99/5yJ7yM89cbmYuPedzsp+OfOYwIamWqZfUuWx6I0DrP+kmO5j6VP/ X-Received: by 2002:a17:90a:5d07:b0:26b:4a9e:3c7e with SMTP id s7-20020a17090a5d0700b0026b4a9e3c7emr13614005pji.4.1698824349480; Wed, 01 Nov 2023 00:39:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698824349; cv=none; d=google.com; s=arc-20160816; b=bxUKrGO+14en/WyZQu2zdBCCmhS21vjQnB5X5bSiFOpxvY8z72ULSrjbTioFf8STE7 a7Jo/ZiJGtr0k9jZjKDUJdIT0FNjUwEUyPfezxj7cDeOFAc9FGzqnLxq4dRm39W/MA0h fYRboSC/CcvDWzIF5g6rm1dzixYv6alqpbRSRhHWH8+3/s0vdUozn/LptgW5YGTvUoPx jf9Mp3rMba6QpX2JW6qvMbBA9/Zdp34srFzCpNmlq7KZ8PzsioYJjygCc3MPDtybeD2d pc/+4BSc8etUiUGERQ1qgz0aYLhzkS8qF6UEeEKYBE/mcFUbrE94sLI9RtgbuUlWhDcr cEdw== 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=xB18ET7k5Cab0qNbVr1XjceBMbRVUdXjO5899oGyQyI=; fh=B/ymYvz68TmAYsy3osQThBsQqGybcLhrtzuZ248faME=; b=uUk+Nr0NrV0dw0tzKf01pL9vpf/UakSoHrl6H8hCQhLKw47N27fYK3VLg4KeTSBmkH RgK6JlQTMFcUjN6jLsHcLLbzSqDcVnQYsifvKVgkPlEa9XkpbAHik3KagbSncqUUwBd7 uIPsLpsqYisC7ZeJIZQFhJ7UJMNpkQY8fiSXYJT9V6eKve5EZASZ89830ZufbX/vRnv4 iOxPtvE4QD08FKyuJvRCZAVjSI6CeOo9LiOejQg2OqsR+8msfxOrq1eGMTsEedSpx2Gh 0QyX/idC+m553+bMeBKw3gXrVnq3hEBHBc2/mS+SA0xgDvD5x8lkzuyZF4YYAcE1SZTP mNfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HFMC2Ejy; 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id gv20-20020a17090b11d400b00280708b2eaasi273211pjb.158.2023.11.01.00.39.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 00:39:09 -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=HFMC2Ejy; 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 831D78030B58; Wed, 1 Nov 2023 00:39:08 -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 S231540AbjKAHjF (ORCPT + 35 others); Wed, 1 Nov 2023 03:39:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231546AbjKAHjC (ORCPT ); Wed, 1 Nov 2023 03:39:02 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66C19F1; Wed, 1 Nov 2023 00:38:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698824336; x=1730360336; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=cUiL60Q4g/FFeKGo5RkMz2YZaR7uRt/yFxzYNEjO4gA=; b=HFMC2EjyhNFdp6DvAAJJNhT9T5VA8pjN30dI8XYcFTARdvBxSiC6T1Rt S1/LzCcPBKWfNMs7HNrhwjZ3Kh6eBFobtN/pC33fPGLPC4t6OJifmfXfc R9J0r8u8I69PncfIEbAQBd8q6wwxngXtTJvYbtqqpoH/WFRk8GyxX5zV/ hFDTAt12dIowltk7xx36uOFL4qESbCnBFu9u9Xk5sBKs2jV5NrJpiHQJ2 Q69GtM0fSQFXvGn2xlXXlSD5mvSe23BOhQchRuFUD9FsVR7z0aV9r+c5c Z9XZDt89WI1Ji94FUsrmsrJJEB9zRA/2GlZ//UUwtWHmfsD1XeAlhRNZ6 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10880"; a="9982674" X-IronPort-AV: E=Sophos;i="6.03,267,1694761200"; d="scan'208";a="9982674" 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:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10880"; a="934357534" X-IronPort-AV: E=Sophos;i="6.03,267,1694761200"; d="scan'208";a="934357534" 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:49 -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 2/5] mmc: cqhci: Increase recovery halt timeout Date: Wed, 1 Nov 2023 09:38:24 +0200 Message-Id: <20231101073827.4772-3-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:08 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781346441237530640 X-GMAIL-MSGID: 1781346441237530640 Failing to halt complicates the recovery. Additionally, unless the card or controller are stuck, which is expected to be very rare, then the halt should succeed, so it is better to wait. Set a large timeout. Fixes: a4080225f51d ("mmc: cqhci: support for command queue enabled host") Cc: stable@vger.kernel.org Signed-off-by: Adrian Hunter --- drivers/mmc/host/cqhci-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/cqhci-core.c b/drivers/mmc/host/cqhci-core.c index b3d7d6d8d654..15f5a069af1f 100644 --- a/drivers/mmc/host/cqhci-core.c +++ b/drivers/mmc/host/cqhci-core.c @@ -984,10 +984,10 @@ static bool cqhci_halt(struct mmc_host *mmc, unsigned int timeout) /* * After halting we expect to be able to use the command line. We interpret the * failure to halt to mean the data lines might still be in use (and the upper - * layers will need to send a STOP command), so we set the timeout based on a - * generous command timeout. + * layers will need to send a STOP command), however failing to halt complicates + * the recovery, so set a timeout that would reasonably allow I/O to complete. */ -#define CQHCI_START_HALT_TIMEOUT 5 +#define CQHCI_START_HALT_TIMEOUT 500 static void cqhci_recovery_start(struct mmc_host *mmc) { From patchwork Wed Nov 1 07:38:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 160459 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp244230vqx; Wed, 1 Nov 2023 00:39:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH2vWftl6D1ukxrPZsbvgOnuL46tGc6XCObgsICSBMsDejcKD2ZPSFp0TW05nduuLbxFTgX X-Received: by 2002:a25:69cd:0:b0:da1:137a:315b with SMTP id e196-20020a2569cd000000b00da1137a315bmr13254823ybc.17.1698824359881; Wed, 01 Nov 2023 00:39:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698824359; cv=none; d=google.com; s=arc-20160816; b=nGdc7dlwnjUWph2TSq4gWt/YpFReZR55Wm4Oepo6MnW6zbn4aNLCe9gF30BVamYYw4 IlBpnFZy+Vf7Gcy1kQZgtDXPIB+oeLUKGz1vu6GIJ6KbO2vxP3o/FETxEBzTZWPDjjSs Ojdht+mOhvhOBZ2aDxsNC+YoIH6j8ph5LxO6uugdah54CevxMAI4JtI+l0osOR34BYkU 5iBFuAUKYdYec/uFaqXEsYnPX2fWDbiOGbqeR6cwjAkJTYMUF+wy7O++OtmcFdpPUMel NRzbEqT7HT+0aNTLKd/lwHjD0jgfg/wwNJxQzrwfRDX5WvCfUFKs7Z/nQm2H9biNL+wA WAOA== 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=0ujTn+DR9HZ4nFmpW/WRmU1wpFxEf+lLTPzALBDZpxc=; fh=B/ymYvz68TmAYsy3osQThBsQqGybcLhrtzuZ248faME=; b=YPweBVeL+s7j2txuX0rF1YUPYyPtaADo1497ElbpX6NQU7EUaVnz4HzZ4yr/E+ytVx s9Oj7NkLe2WMiUQTQxSuCc/0UgarUEUMyt/DQsWoQm3NllGYhX8jWQ8UhhCNOQPZBFIg aPyyBDgqy5ivbiQmmMYQHaNQwyIpa5NjvZ3eM36EpWoDflGo1+ubB4ww8JveK4/WtWaD uB6efX/lEd0XouWP7IoJpa9fiaV1J3RQRGkEA23L8XXN0eG9t6ruv4NaB+/iuWfIhuXc lVDXmHkSpchnmmk49onUYyh21GmXv1S37mZXtPup7WyucdWKJt23BjbZ635XFz+ldXcl 2POQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Fk5NDugE; 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id m1-20020a632601000000b0057942bfab4dsi2461953pgm.395.2023.11.01.00.39.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 00:39:19 -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=Fk5NDugE; 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 1DF38802BE7C; Wed, 1 Nov 2023 00:39:19 -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 S231502AbjKAHjN (ORCPT + 35 others); Wed, 1 Nov 2023 03:39:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231546AbjKAHjJ (ORCPT ); Wed, 1 Nov 2023 03:39:09 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 626CAF1; Wed, 1 Nov 2023 00:39:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698824342; x=1730360342; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mP6Mo3+Nw1x4znWMjlIBYHth0os2JHcW2xe8+eVSNhY=; b=Fk5NDugEh7G6OXgsIM3eKpBOmbFfYY7AhcLFHr9YxliH8ioVKFrZ331X p7srR8DmUbbRV4DI+hMsSSFED0kpiS6Ijj3d16F5B+TIzRomU7Fm/8GwE 7unuV3OqyXeZBKcGnPWEzT6sn0cRbzY2ovMYUCQEbIaEgCUDMmej9f3aq EZ80E/16tOb8oPzXKzYb6F+6soKTCeLubJzXZeB0Q+QeZshJ7vkuN3eFM /WdU1szGU4Ms3eRckC7XMd1IhLkzQzUa4kMcOKUOIw+s8i6AfXH8ofY1+ noXORxBV2hurFm7CAiaDac+OIj1BULp8QsmnYEvWSktUcx/6b09Fiw1Q6 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10880"; a="9982709" X-IronPort-AV: E=Sophos;i="6.03,267,1694761200"; d="scan'208";a="9982709" 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:39:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10880"; a="934357542" X-IronPort-AV: E=Sophos;i="6.03,267,1694761200"; d="scan'208";a="934357542" 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:55 -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 3/5] mmc: block: Be sure to wait while busy in CQE error recovery Date: Wed, 1 Nov 2023 09:38:25 +0200 Message-Id: <20231101073827.4772-4-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:19 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781346451880319177 X-GMAIL-MSGID: 1781346451880319177 STOP command does not guarantee to wait while busy, but subsequent command MMC_CMDQ_TASK_MGMT to discard the queue will fail if the card is busy, so be sure to wait by employing mmc_poll_for_busy(). Fixes: 72a5af554df8 ("mmc: core: Add support for handling CQE requests") Cc: stable@vger.kernel.org Signed-off-by: Adrian Hunter --- drivers/mmc/core/core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 3d3e0ca52614..befde2bd26d3 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -553,6 +553,8 @@ int mmc_cqe_recovery(struct mmc_host *host) cmd.busy_timeout = MMC_CQE_RECOVERY_TIMEOUT; mmc_wait_for_cmd(host, &cmd, 0); + mmc_poll_for_busy(host->card, MMC_CQE_RECOVERY_TIMEOUT, true, MMC_BUSY_IO); + memset(&cmd, 0, sizeof(cmd)); cmd.opcode = MMC_CMDQ_TASK_MGMT; cmd.arg = 1; /* Discard entire queue */ From patchwork Wed Nov 1 07:38:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 160460 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp244483vqx; Wed, 1 Nov 2023 00:40:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEJ4VwmbM6HJknxI2HFfkhPc+hTQ4fU8XZ91tAG/iOVX7O0yeMWgysxcIgri8xQpsJCY+/v X-Received: by 2002:a05:6358:5e16:b0:169:7e97:6fd with SMTP id q22-20020a0563585e1600b001697e9706fdmr5979748rwn.5.1698824404769; Wed, 01 Nov 2023 00:40:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698824404; cv=none; d=google.com; s=arc-20160816; b=JhKfwXqtm1PzARl0gFgAbwmQmuPINUVjyP3MgZZ1K87sEIukcUtemP04JRTbajbpsx z6FIbni720wIhkvuS5noBy/P77/MYK4XXw26EfeHX5dbjKjT+TIR7Cr/e1OlUlBYGem/ Rkc9X2S4sFD5o7tgVM/9OFc7Wr2djNIfoyVsdi6qUT0zV0Xr0ne5AezIIT4jOzQ3ugQE 3DsCdyEDytESmhVSozSoNdhtK+QMvzQKWFGKuQBaYpdAZ6gu3Yk7K4l5s7w8SQG7bXhN 1ZLFs74EmkYtZ4aXSGKmx6sy2jd7y63plenrX5xYoaOqer2by8dx+OzqhjirbhLM1NWB 6nNw== 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=BTKYkLTvs/mbKW2eEVWXGznLCcf8HQLLSg1ZPbBOAj8=; fh=B/ymYvz68TmAYsy3osQThBsQqGybcLhrtzuZ248faME=; b=ryymRPr9RQVFRD+pzA0lXOlK6RV24dORoVsC1k3LaFJOxxkQhBq6Z8ln6QRqHdSQWg aRiLt/RA1rX7p7tulAeObXBqnXZyWzIo8sAkJhx1Ho0VzIfB8q14XRfAyEcMw3Hg3LlC egZ6NlgOHHRZAyYAE0ianj2VVQCzagPqPyaAhhfnrr8vuxsUXXuXtslHw4jrj3x9xCm/ ldGQqCbIMZL2LXglJESTM3c0vwdy9HXMTd4tqFGI/XZqMM04/F4/ZpHcYADVOGbK+z/D VAW4j663m6R9ul8Lg4gpoKk1L8TWHWyT2eNc+XyjOQ2vO0agBmE+w0a12Jc2N5kPeOyZ 2gdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MGWbMVRO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id c194-20020a6335cb000000b005b7ce261d0dsi2451134pga.402.2023.11.01.00.40.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 00:40:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MGWbMVRO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id B21ED80BC82F; Wed, 1 Nov 2023 00:39:59 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231896AbjKAHj1 (ORCPT + 35 others); Wed, 1 Nov 2023 03:39:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231630AbjKAHjR (ORCPT ); Wed, 1 Nov 2023 03:39:17 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36CAD10A; Wed, 1 Nov 2023 00:39:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698824349; x=1730360349; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OV8RDN4Bd1h5BCWBvIEygF8kScSzkr9HTkdiwgabNdQ=; b=MGWbMVROvCPDxaUTNeEs+0wnNKXWI2Vy9lmow5DFZeNW+h7nlsa4A1ZP iyPCv4mKyw3Qtk2qKKgeRdiAzZgD9Cx7h6mW8F1nUDjn5TxFlellSNVNN M9FWHWAHp3jFbnKJSXIVZ/1JgFROWYZQJ8jvN9ygh750g2fpkgctchoxi TKO7/saiOMILCSaMLoQSyqrMTiKoWiG2N/3kqMi5RdD8/Xenv+QMfdNVM HmR5fBQo4qquZsGlebuVTk0E32fX09JKJeOd+YM0dM5mlm9kQRENykIRF 91q2q5Fy5QuZutYeVV5GmPd3MqZpqoxOaIrgTbrXc0+SdmgFnsjOQjGR6 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10880"; a="9982762" X-IronPort-AV: E=Sophos;i="6.03,267,1694761200"; d="scan'208";a="9982762" 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:39:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10880"; a="934357556" X-IronPort-AV: E=Sophos;i="6.03,267,1694761200"; d="scan'208";a="934357556" 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:39:01 -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 4/5] mmc: block: Retry commands in CQE error recovery Date: Wed, 1 Nov 2023 09:38:26 +0200 Message-Id: <20231101073827.4772-5-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=-1.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email 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 (pete.vger.email [0.0.0.0]); Wed, 01 Nov 2023 00:39:59 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781346498995229874 X-GMAIL-MSGID: 1781346498995229874 It is important that MMC_CMDQ_TASK_MGMT command to discard the queue is successful because otherwise a subsequent reset might fail to flush the cache first. Retry it and the previous STOP command. Fixes: 72a5af554df8 ("mmc: core: Add support for handling CQE requests") Cc: stable@vger.kernel.org Signed-off-by: Adrian Hunter --- drivers/mmc/core/core.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index befde2bd26d3..a8c17b4cd737 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -551,7 +551,7 @@ int mmc_cqe_recovery(struct mmc_host *host) cmd.flags = MMC_RSP_R1B | MMC_CMD_AC; cmd.flags &= ~MMC_RSP_CRC; /* Ignore CRC */ cmd.busy_timeout = MMC_CQE_RECOVERY_TIMEOUT; - mmc_wait_for_cmd(host, &cmd, 0); + mmc_wait_for_cmd(host, &cmd, MMC_CMD_RETRIES); mmc_poll_for_busy(host->card, MMC_CQE_RECOVERY_TIMEOUT, true, MMC_BUSY_IO); @@ -561,10 +561,13 @@ int mmc_cqe_recovery(struct mmc_host *host) cmd.flags = MMC_RSP_R1B | MMC_CMD_AC; cmd.flags &= ~MMC_RSP_CRC; /* Ignore CRC */ cmd.busy_timeout = MMC_CQE_RECOVERY_TIMEOUT; - err = mmc_wait_for_cmd(host, &cmd, 0); + err = mmc_wait_for_cmd(host, &cmd, MMC_CMD_RETRIES); host->cqe_ops->cqe_recovery_finish(host); + if (err) + err = mmc_wait_for_cmd(host, &cmd, MMC_CMD_RETRIES); + mmc_retune_release(host); return err; From patchwork Wed Nov 1 07:38:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 160461 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp244755vqx; Wed, 1 Nov 2023 00:40:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHW92DRThetdJFkxhYUnfMssoXaMNcj0c1dyx3/WQvKN/KRQ/9UTPM5uFstyWdr4F8lR15q X-Received: by 2002:a81:b101:0:b0:5a8:1d18:a16 with SMTP id p1-20020a81b101000000b005a81d180a16mr15935139ywh.36.1698824450961; Wed, 01 Nov 2023 00:40:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698824450; cv=none; d=google.com; s=arc-20160816; b=kN3S/UlLERGr1juujTW1AJv0ut9+gebDCsvma7/2oBePHFXBcDKL8hsX2gdlRFGNTc hEor8N/Y3+JmsziMvNeA8F8MQFPxOvb6v9J/70mgn9X2HaQgtrubWbgz+IKV2yIXtGCW pLQGK91bbOJdJlFnxQ0lWkiKLvUm319YTPZ4bvzhY/Dg8c9j/9AsVu+8eZ4SJ6caHXsF Bjghlk7xzBlP66EXn60s6sdk4LCQL6YCzX4Xxg3N6ayPdswrI2DtS7nMLF+Np/K6AnxW m5UTXQ3iWa+CK4ylswHcS80hDVA7n6+tvEwxjZ3qwkKS9EXV/NM8ec51mkf2O9QNEx4g bDSA== 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=tpX7xtorvfWLarLy44cdEIWdEqybZbNqpJR9ejqJ/0k=; fh=B/ymYvz68TmAYsy3osQThBsQqGybcLhrtzuZ248faME=; b=hXZIVpxSGyjFce3SAm6E1M9za7ZbQpdLoso6GAIwBC5cVQ3cI+bdJNebZQUy19UbBG +oJHQ10K1kKkE4KIIZ8mXh2hql+Sk8v0Vgw4C+hFCNmuVJVHVLJon0EFyfAHORks/tmM 4QX9ke51QwKeJ5MC5OyQ4rI5VDGr96Y8MAVZBEi89z590qn5x4T05Tf3PJd6ihWL20MS hfub4QsAVvHUB2AoxmnZ7jycP0I16uIv2hTmkMsKNRbNQ+JqvuEtuMrpmZxafYli3hs4 8uI2RBAPCmt9Nywh1NLX93rtBz+G8STl4g34kFZu5yERxntPIDbKh5hCVeVm+3CUkwG/ yt8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HhhnBPDy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id s130-20020a637788000000b005b3bcd9d7f8si2472952pgc.808.2023.11.01.00.40.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 00:40:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HhhnBPDy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id BF9FB8080C4E; Wed, 1 Nov 2023 00:40:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231881AbjKAHjg (ORCPT + 35 others); Wed, 1 Nov 2023 03:39:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232090AbjKAHjY (ORCPT ); Wed, 1 Nov 2023 03:39:24 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F446138; Wed, 1 Nov 2023 00:39:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698824355; x=1730360355; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rTwdYfLJeq6qzplpdM8wdKPNTVjN4KmxEwCf/vATSGo=; b=HhhnBPDyVXooeT+AbCIYT1zvjvu0mqStiyq9EkluV78EPXTq5BUjoE3j dLDwOyOqqvYG1ytCoqyuITjBrB7+mNHT2tlRFP5Qw8BLSjBWd5jckvxK+ iVmb+NYg7Ts5EiGPgIPA8iyRvag00+Mz5UkSNygDUzIPcA0dVUbs80kF8 fJce9rOVHubU+kYKryyo/vFjBljHB7G1p7fBNsCbE7sFIm8Cr4z4aeTBy 0veoYCi3fh37xuIIieXSj+SemUwSvjxlLiklb2fAGkFYbgOuSPYc8mOO8 3agwbVdDQIunPg9H7U0UWWM5IdpQ711587UfvxvuXx7ziBprNRqDrrIzf g==; X-IronPort-AV: E=McAfee;i="6600,9927,10880"; a="9982771" X-IronPort-AV: E=Sophos;i="6.03,267,1694761200"; d="scan'208";a="9982771" 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:39:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10880"; a="934357581" X-IronPort-AV: E=Sophos;i="6.03,267,1694761200"; d="scan'208";a="934357581" 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:39:08 -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 5/5] mmc: cqhci: Warn of halt or task clear failure Date: Wed, 1 Nov 2023 09:38:27 +0200 Message-Id: <20231101073827.4772-6-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=-1.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email 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 (lipwig.vger.email [0.0.0.0]); Wed, 01 Nov 2023 00:40:17 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781346547075177742 X-GMAIL-MSGID: 1781346547075177742 A correctly operating controller should successfully halt and clear tasks. Failure may result in errors elsewhere, so promote messages from debug to warnings. Signed-off-by: Adrian Hunter --- drivers/mmc/host/cqhci-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/cqhci-core.c b/drivers/mmc/host/cqhci-core.c index 15f5a069af1f..948799a0980c 100644 --- a/drivers/mmc/host/cqhci-core.c +++ b/drivers/mmc/host/cqhci-core.c @@ -942,8 +942,8 @@ static bool cqhci_clear_all_tasks(struct mmc_host *mmc, unsigned int timeout) ret = cqhci_tasks_cleared(cq_host); if (!ret) - pr_debug("%s: cqhci: Failed to clear tasks\n", - mmc_hostname(mmc)); + pr_warn("%s: cqhci: Failed to clear tasks\n", + mmc_hostname(mmc)); return ret; } @@ -976,7 +976,7 @@ static bool cqhci_halt(struct mmc_host *mmc, unsigned int timeout) ret = cqhci_halted(cq_host); if (!ret) - pr_debug("%s: cqhci: Failed to halt\n", mmc_hostname(mmc)); + pr_warn("%s: cqhci: Failed to halt\n", mmc_hostname(mmc)); return ret; }