public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: mingming lee <mingming.lee@mediatek.com>
To: u-boot@lists.denx.de
Subject: [PATCH 6/7] mmc: mtk-sd: fix hang when data read quickly
Date: Mon, 23 Dec 2019 17:28:28 +0800	[thread overview]
Message-ID: <20191223092829.11017-7-mingming.lee@mediatek.com> (raw)
In-Reply-To: <20191223092829.11017-1-mingming.lee@mediatek.com>

For CMD21 tuning data, the 128/64 bytes data may coming in very
short time, before msdc_start_data(), the read data has already
come, in this case, clear MSDC_INT will cause the interrupt disappear
and lead to the thread hang.

the solution is just clear all interrupts before command was sent.

Signed-off-by: mingming lee <mingming.lee@mediatek.com>
---
 drivers/mmc/mtk-sd.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/mmc/mtk-sd.c b/drivers/mmc/mtk-sd.c
index 23413731dc..b0365877d7 100644
--- a/drivers/mmc/mtk-sd.c
+++ b/drivers/mmc/mtk-sd.c
@@ -14,7 +14,6 @@
 #include <malloc.h>
 #include <mapmem.h>
 #include <stdbool.h>
-#include <watchdog.h>
 #include <asm/gpio.h>
 #include <dm/pinctrl.h>
 #include <linux/bitops.h>
@@ -531,6 +530,7 @@ static int msdc_start_command(struct msdc_host *host, struct mmc_cmd *cmd,
 		blocks = data->blocks;
 
 	writel(CMD_INTS_MASK, &host->base->msdc_int);
+	writel(DATA_INTS_MASK, &host->base->msdc_int);
 	writel(blocks, &host->base->sdc_blk_num);
 	writel(cmd->cmdarg, &host->base->sdc_arg);
 	writel(rawcmd, &host->base->sdc_cmd);
@@ -677,13 +677,9 @@ static int msdc_start_data(struct msdc_host *host, struct mmc_data *data)
 	u32 size;
 	int ret;
 
-	WATCHDOG_RESET();
-
 	if (data->flags == MMC_DATA_WRITE)
 		host->last_data_write = 1;
 
-	writel(DATA_INTS_MASK, &host->base->msdc_int);
-
 	size = data->blocks * data->blocksize;
 
 	if (data->flags == MMC_DATA_WRITE)
-- 
2.18.0

  parent reply	other threads:[~2019-12-23  9:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-23  9:28 [PATCH 0/7] Add support for MediaTek MT8512 Soc mingming lee
2019-12-23  9:28 ` [PATCH 1/7] ARM: MediaTek: Add support for MediaTek MT8512 SoC mingming lee
2019-12-23 20:02   ` Ryder Lee
2019-12-23 20:29     ` Oleksandr Rybalko
2019-12-23  9:28 ` [PATCH 2/7] clk: mediatek: adjust common driver for mt8512 mingming lee
2019-12-23 19:50   ` Ryder Lee
2019-12-24  2:53     ` Mingming Lee
2019-12-23  9:28 ` [PATCH 3/7] clk: mediatek: add driver support for MT8512 mingming lee
2019-12-23  9:28 ` [PATCH 4/7] pinctrl: mediatek: add driver " mingming lee
2019-12-23  9:28 ` [PATCH 5/7] mmc: mtk-sd: add support for MediaTek MT8512/MT8110 SoCs mingming lee
2019-12-23  9:28 ` mingming lee [this message]
2019-12-23  9:28 ` [PATCH 7/7] ARM: MediaTek: add basic support for MT8512 boards mingming lee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191223092829.11017-7-mingming.lee@mediatek.com \
    --to=mingming.lee@mediatek.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox