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 9356BC433EF for ; Mon, 31 Jan 2022 22:09:05 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BA63983678; Mon, 31 Jan 2022 23:09:02 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=ziswiler.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 2DF88801B2; Mon, 31 Jan 2022 23:09:00 +0100 (CET) Received: from mout.perfora.net (mout.perfora.net [74.208.4.194]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2A2F4801B2 for ; Mon, 31 Jan 2022 23:08:57 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=ziswiler.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=marcel@ziswiler.com Received: from localhost.localdomain ([81.221.85.15]) by mrelay.perfora.net (mreueus003 [74.208.5.2]) with ESMTPSA (Nemesis) id 0MXJY3-1mlB4G2Gwv-00WC6H; Mon, 31 Jan 2022 23:08:41 +0100 From: Marcel Ziswiler To: u-boot@lists.denx.de Cc: Michael Walle , "NXP i . MX U-Boot Team" , Jaehoon Chung , Sean Anderson , Marcel Ziswiler , Fabio Estevam , Peng Fan , Stefano Babic Subject: [PATCH v1] mmc: fsl_esdhc_imx: fix watermark level in dma Date: Mon, 31 Jan 2022 23:08:31 +0100 Message-Id: <20220131220831.386771-1-marcel@ziswiler.com> X-Mailer: git-send-email 2.34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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.5 at phobos.denx.de X-Virus-Status: Clean From: Marcel Ziswiler Seems that we need the waterlevel setting not only for PIO mode as without this at least the i.MX 8M Mini won't boot anymore when being written by such a U-Boot. Corruption has also been observed both on the i.MX 6 as well as i.MX 8M Mini when using ums on the eMMC. Fix this by setting the watermark level again regardless of whether in DMA or PIO mode. Fixes: 41c6a22fc296 ("mmc: fsl_esdhc_imx: simplify esdhc_setup_data()") Signed-off-by: Marcel Ziswiler --- drivers/mmc/fsl_esdhc_imx.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/fsl_esdhc_imx.c b/drivers/mmc/fsl_esdhc_imx.c index 9299635f50..efa5ed0af7 100644 --- a/drivers/mmc/fsl_esdhc_imx.c +++ b/drivers/mmc/fsl_esdhc_imx.c @@ -336,9 +336,8 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc, } } - if (IS_ENABLED(CONFIG_SYS_FSL_ESDHC_USE_PIO)) - esdhc_setup_watermark_level(priv, data); - else + esdhc_setup_watermark_level(priv, data); + if (!IS_ENABLED(CONFIG_SYS_FSL_ESDHC_USE_PIO)) esdhc_setup_dma(priv, data); /* Calculate the timeout period for data transactions */ -- 2.34.1