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 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 5F4C6C433F5 for ; Tue, 11 Jan 2022 13:08:02 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C783183050; Tue, 11 Jan 2022 14:07:47 +0100 (CET) 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="SWgy1RqF"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1B20A81E3E; Tue, 11 Jan 2022 11:24:22 +0100 (CET) Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) (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 094E18142A for ; Tue, 11 Jan 2022 11:24:19 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=hmz007@gmail.com Received: by mail-pj1-x102c.google.com with SMTP id r16-20020a17090a0ad000b001b276aa3aabso4422789pje.0 for ; Tue, 11 Jan 2022 02:24:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=uHrzz2tg7bDszoI0qqpfW9BmaEMgjQ/WjcpZP56BGMU=; b=SWgy1RqFI27k6E35xn3cwdhLuy6PYnHTar32vxalJDB2e+HUjHRaKqzniGDozGwlhE q6G/Hi5xp5USkSu3G/T3SxWkhB40LpedA0xq86d19OZkGpcpRgE95ntvP/W/kAMw2xeM 8dPzZY/jKhKajVGyjMju2+ckJ8gEhHehfsRSyAxF/Nlpn9EgW7xIJkMDdCw9TkGF6YXm yGw1vdXGZtFy5wbwA6MI3GH4HBrXg2oeDK5gRi0xWRZJA/miTy2QI/MPl2/USmi35XrV HvQeTWrSz/W8alvB3Aa2LfvDaXrULo739BxydH0HzA445hqtGFYz3Cipavxe9XqRsgEH PNfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=uHrzz2tg7bDszoI0qqpfW9BmaEMgjQ/WjcpZP56BGMU=; b=5ra3rB3kWCUQIBYon48u+iOzMfO0h7GBvZ0AFD5uwT+BcNi7p6U13zC6bWrXpSoEo0 b6VN+g+bKdwgQJRSJEwQcOvEsz3iIzYoBU49ml02cytEzHYEkpNx3hMaOxzmws3e+F+k ae0uBbSy6ZCdFeo+hNGbZIFzFopxLRSzOeMNBKX5PxrGJKzE9vHPYQN6YUrwVl3+apfd 3YdWVpPQ1mn4Aqm73mkNTBXYjryMQ97Uugg76RBmsIQUQ8ZsKzms7I06gwk8GsDbQ9VN Spq+kkWMcnEPIK7mRFWfTxCC4zN+IcNLtweZvcBDA8t8ZGgZPEyj4qd/8Y3lGrIyr+zI ayRQ== X-Gm-Message-State: AOAM531liE/A0NdZlV+S6QVj9h/WlsDtVDENP/8RRoVtzxsNIAhb7vt+ tlNewpHNUulmVTQKGAZp33I= X-Google-Smtp-Source: ABdhPJzfcPNG7HY/rqKfJg2QL2qdSCJ3IA/XXRHVAH23JNApHK6mfXgnZJGg40yiyZxAIMi4IfbKWA== X-Received: by 2002:a17:90b:1292:: with SMTP id fw18mr2417063pjb.36.1641896657114; Tue, 11 Jan 2022 02:24:17 -0800 (PST) Received: from jensen.next ([113.109.227.110]) by smtp.gmail.com with ESMTPSA id m14sm9073092pff.151.2022.01.11.02.24.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jan 2022 02:24:16 -0800 (PST) From: hmz007 To: peng.fan@nxp.com, jh80.chung@samsung.com, ley.foon.tan@intel.com, u-boot@lists.denx.de Cc: hmz007 Subject: [PATCH] mmc: dw_mmc: Fixes timeout issue for FIFO mode Date: Tue, 11 Jan 2022 18:24:11 +0800 Message-Id: <20220111102411.16666-1-hmz007@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Tue, 11 Jan 2022 14:07:42 +0100 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.2 at phobos.denx.de X-Virus-Status: Clean Clearing the DTO interrupt should be unnecessary, and it would potentially result in never receiving this interrupt again. Do power-on or reset from uboot for a while can reproduce the issue: dwmci_data_transfer: Timeout waiting for data! mmc_load_image_raw_sector: mmc block read error Tested on NanoPi R4S with SanDisk Extreme PRO 32GB. Fixes: 8cb9d3ed3a ("mmc: dw_mmc: Fixes data read when receiving DTO interrupt in FIFO mode") Signed-off-by: hmz007 --- drivers/mmc/dw_mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c index a949dad574..8fa26b340b 100644 --- a/drivers/mmc/dw_mmc.c +++ b/drivers/mmc/dw_mmc.c @@ -168,7 +168,7 @@ static int dwmci_data_transfer(struct dwmci_host *host, struct mmc_data *data) if (data->flags == MMC_DATA_READ && (mask & (DWMCI_INTMSK_RXDR | DWMCI_INTMSK_DTO))) { dwmci_writel(host, DWMCI_RINTSTS, - DWMCI_INTMSK_RXDR | DWMCI_INTMSK_DTO); + DWMCI_INTMSK_RXDR); while (size) { ret = dwmci_fifo_ready(host, DWMCI_FIFO_EMPTY, -- 2.34.1