From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 041B7C4332F for ; Thu, 9 Nov 2023 09:47:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232566AbjKIJrV (ORCPT ); Thu, 9 Nov 2023 04:47:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233237AbjKIJrI (ORCPT ); Thu, 9 Nov 2023 04:47:08 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 66BC72D7E; Thu, 9 Nov 2023 01:47:06 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4A45E12FC; Thu, 9 Nov 2023 01:47:50 -0800 (PST) Received: from [10.1.39.38] (e133047.arm.com [10.1.39.38]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 42FDA3F703; Thu, 9 Nov 2023 01:47:02 -0800 (PST) Message-ID: Date: Thu, 9 Nov 2023 09:47:00 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V2 3/6] mmc: block: Be sure to wait while busy in CQE error recovery Content-Language: en-US To: Adrian Hunter , Ulf Hansson , =?UTF-8?Q?Kornel_Dul=C4=99ba?= , Radoslaw Biernacki , Gwendal Grignou , Asutosh Das Cc: Chaotian Jing , Bhavya Kapoor , Kamal Dasu , Al Cooper , Haibo Chen , Shaik Sajida Bhanu , Sai Krishna Potthuri , Victor Shih , Ben Chuang , Thierry Reding , Aniruddha Tvs Rao , Chun-Hung Wu , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20231103084720.6886-1-adrian.hunter@intel.com> <20231103084720.6886-4-adrian.hunter@intel.com> From: Christian Loehle In-Reply-To: <20231103084720.6886-4-adrian.hunter@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/11/2023 08:47, Adrian Hunter wrote: > 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 Reviewed-by: Christian Loehle > --- > 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 */