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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EF38EC43334 for ; Thu, 14 Jul 2022 23:58:47 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 14EAA840FF; Fri, 15 Jul 2022 01:58:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1657843125; bh=XwboNzl1QKFqTUSaKlacVj2aoCExEW8NUIXjpcD5zMs=; h=From:To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=D0izpTpk1LcKXI4v+che9h0HifXzmoVTpfdtqE1o2qhlZ2RFqcy9+X+drL0pfx/1G xpIwSg7yppz6NmZCH/VPkPlVQoy/7yUHfeBvZqTG/sS+9jCA9EVqquTXlvcgQENjJJ 4WDM6FZ1m//DoWz2OOk4PCxYr+JmdzW4DS1ZOIRiMMh4B1Zg2Glc3dySDQSVlyCSW1 EQKRz8Aim8sePE6pWECjmjN8H5lGIqyzuScZqj1ilsoVx/QvmUW5y0F32XG0L4L0be UsNfVoJrigk7ZZOJ/Jq9hj2C2XphGFnVez6Ll/1CwU3vJfHa45LUpnf76miwCLUqEd VdxT6OqsxhSyQ== Received: from tr.lan (ip-86-49-12-201.bb.vodafone.cz [86.49.12.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 19FAE840F9; Fri, 15 Jul 2022 01:58:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1657843123; bh=XwboNzl1QKFqTUSaKlacVj2aoCExEW8NUIXjpcD5zMs=; h=From:To:Cc:Subject:Date:From; b=zUiWkC8amdSqNYCU8HMKfdxo03yMqsmSVSC7FjnTnk+IphvH93NkUXpp3FB5UNd3d wiEI2iy3utgOz+EvOmf3u6I2eAj9Me1gTjzGxJcHnVSe6qZaDlUWHs3WfpxcVycV61 2Xs0HO/cVQFN+oLPtAwZUSha5JsUFsQ7EOA5EJQfEeA/nJ8EyhQh6dbs0bWOU4IsZP f4Sqz7USDwFvhmyam/ASkXuYAW1ug73Z6fpr6BqZV0YTsSP4VyXN7rdO1IVUMeNZdP jtEbdDXKJqTLs6WRIPT3J5bgjRXCVhxiSsXKLVLNKerp1NgxlomuMtWzEo50eKxVws 4bcxlI9OU4LMg== From: Marek Vasut To: u-boot@lists.denx.de Cc: Marek Vasut , Jaehoon Chung , Kirill Kapranov , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Pantelis Antoniou , Ye Li Subject: [PATCH] mmc: Do not send status of send_status is false Date: Fri, 15 Jul 2022 01:58:24 +0200 Message-Id: <20220714235824.421904-1-marex@denx.de> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Commit 44645f87de5 ("mmc: Fix mmc_switch excessive timeout") introduced a side effect where CMD13 SEND_STATUS is issued in case mmc_wait_dat0() does not return -ENOSYS and $send_status is not set. This happens on all hardware which does implement .mmc_wait_dat0 callback, e.g. i.MX8M . This leads to lengthy timeout before booting OS in case of eMMC in one of the HS200/HS400 modes, since the card cannot respond to CMD13 while downgrading from HS200/HS400 to regular HS mode. Fix this by adding the missing conditional. Fixes: 44645f87de5 ("mmc: Fix mmc_switch excessive timeout") Signed-off-by: Marek Vasut Cc: Jaehoon Chung Cc: Kirill Kapranov Cc: Marek BehĂșn Cc: Pantelis Antoniou Cc: Ye Li --- drivers/mmc/mmc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 12d29da528a..b62baca8457 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -831,6 +831,9 @@ static int __mmc_switch(struct mmc *mmc, u8 set, u8 index, u8 value, return 0; } + if (!send_status) + return 0; + /* Finally wait until the card is ready or indicates a failure * to switch. It doesn't hurt to use CMD13 here even if send_status * is false, because by now (after 'timeout_ms' ms) the bus should be -- 2.35.1