From patchwork Tue May 28 06:01:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: linjunbao X-Patchwork-Id: 1940648 X-Patchwork-Delegate: jh80.chung@samsung.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=h7tMXfeK; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VpdjT15hjz20Q3 for ; Wed, 29 May 2024 02:47:41 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B812B88431; Tue, 28 May 2024 18:47:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="h7tMXfeK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AE0AA883FB; Tue, 28 May 2024 08:02:02 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 90EE5883A0 for ; Tue, 28 May 2024 08:02:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=meljbao@gmail.com Received: by mail-pj1-x1035.google.com with SMTP id 98e67ed59e1d1-2bf196037a7so99419a91.1 for ; Mon, 27 May 2024 23:02:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716876118; x=1717480918; darn=lists.denx.de; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=k+MAQJYl4mCmbGf5zOSquDLah5NskZuka44kJ9lWLjc=; b=h7tMXfeKjGIqdiPWjNyF4N9cRwVd+NEwfIQehCsLLT3BWUD4a5/UXp2Xi2HfyUezvE FxoH0cuUA+QQiiqMyEQ6wUb7uZXFRE74NWoPwD59PxBbWyDUT+SfbdI0gSg218gPLGom 4gadYiU5JULToX2dxmKg8n93VuCcMazMB3XcgcJJMUojF24GaG7qxRPZxHVdTvZPQ+lv rJLr6P/AsIT9WsI1TJ+62SQkBTGGW3W1IHzoWe44cS0qz8JwL04CGCd4abxeZWMYGLRU izVRLZfQZxsUaSmJXIYKvqgQY0LV43Ze1G7NxJmpyzj3MpZwSmzOaGYigqLWOOXKfMmP OFVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716876118; x=1717480918; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=k+MAQJYl4mCmbGf5zOSquDLah5NskZuka44kJ9lWLjc=; b=ZluG7yL7NHniHgMhJE53OEYTFysiA1w/fhEeAI0y0+s/KpF3iPEvhCNkSvnmzYDup0 iyWsUUsrd211ea+kUkzxiKv61ePihOONoEzlFLLUkLARs0IQN5GPL9YTrP/tszpT4+Y9 +Oc9sRiEkm3/p9sbN0YPbgoB3wS8Lt7zX06da2/7LzAIH2vj/T5PAFZAMtq8zi1SMGkh AFnP1BpxlXRhFLLPkYSyLKCLvVTXUi1JJkU4VH4VNJcSSKU3vkmpBWjPL7SOF9U4vjUt XCwPSR7e8c6frnsX4fN5Y8k+TQLkAu3tNg+/gF+M0G///35fpjxVf0pJdvGh6At8VJIk 7hVQ== X-Gm-Message-State: AOJu0Yytk3fcyY42fcEXmnSlM14zU0d7Ex3/Y46cqM0lORBqtZGp5XgS Uy+SkWbi3ZksYFUInEd73qtGlIYd6q65R4j38gBO/Xs0klBZcB5AcNkKAtIhAks= X-Google-Smtp-Source: AGHT+IE9EAj/0qg3uqfsx/B11N3PDkGaVr3ATO/RAJTbrjuFjEbddBLhiMdid35+KMHogZiJvPOIDA== X-Received: by 2002:a17:902:e801:b0:1f2:fbc8:643c with SMTP id d9443c01a7336-1f448f2e808mr125011805ad.3.1716876118114; Mon, 27 May 2024 23:01:58 -0700 (PDT) Received: from localhost.localdomain ([112.96.224.116]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f48fccb7c3sm35180735ad.228.2024.05.27.23.01.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 23:01:57 -0700 (PDT) From: linjunbao To: u-boot@lists.denx.de Cc: linjunbao Subject: [PATCH] mmc: return immediately once the dwmci data transfer fails Date: Tue, 28 May 2024 14:01:49 +0800 Message-Id: <20240528060149.674310-1-meljbao@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 28 May 2024 18:47:36 +0200 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.8 at phobos.denx.de X-Virus-Status: Clean Originally, when the host is in dma mode, the return status of dwmci_data_transfer() gets overlapped by the latter DWMCI_IDINTEN query. When the data transfer fails and the query succeeds, the failure gets escaped. Add quick return when data transfer fails. Signed-off-by: linjunbao --- drivers/mmc/dw_mmc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c index e103664145..e04872c432 100644 --- a/drivers/mmc/dw_mmc.c +++ b/drivers/mmc/dw_mmc.c @@ -372,6 +372,10 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, if (data) { ret = dwmci_data_transfer(host, data); + if (ret) { + debug("DWMCI data transfer fail.\n"); + return ret; + } /* only dma mode need it */ if (!host->fifo_mode) {