Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp738984rdb; Wed, 1 Nov 2023 00:39:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH2Wc/ZeRzyEvEnMnDvgKVcnp2nLX7PF8hO4x8vpk0Qb/xLrcEf2szbGaNZd2O0GqXAfX6a X-Received: by 2002:a9d:6197:0:b0:6cd:da93:90ce with SMTP id g23-20020a9d6197000000b006cdda9390cemr14473543otk.19.1698824357664; Wed, 01 Nov 2023 00:39:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698824357; cv=none; d=google.com; s=arc-20160816; b=MD6ffYTjVlPVakfD+OsRnT4iMQQcP2L9TqI1gDiOoeaceAC+Yl7n5kNtMjNhLqMToJ C/jhHM8q26xs4dc+blsWRsB2WBAa1HAcY6doFCpegTo4BjgY8y44uK5RKJ20r9z6y39+ +M7sFG2YypV5faZY0PC8u09CQcT8kN3KR6JDGtWh245Psyfo85z2fYMY8GF4KstNrBM8 +rcn/Fs2yQdUtcotbW0ICZ2igCEU33BkNuo/l9B2KR+Iwqp6PvD7dxypQ5RikFEfoblH Cg7EpsJY/eBO3iYmYb8IzHhR387/o3N6gfV5qzGxiw5QP+nKKj9WS6QFEjYANvrF6aP6 7KGw== 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 Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id s21-20020a056a0008d500b00690daa48517si1080254pfu.200.2023.11.01.00.39.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 00:39:17 -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 594BF802F334; Wed, 1 Nov 2023 00:39:16 -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 S231645AbjKAHjM (ORCPT + 99 others); Wed, 1 Nov 2023 03:39:12 -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=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 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 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:16 -0700 (PDT) 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 */ -- 2.34.1