[U-Boot] mmc: mtk-sd: add WATCHDOG_RESET() to prevent watchdog timeout
diff mbox series

Message ID 1563505487-14005-1-git-send-email-weijie.gao@mediatek.com
State Accepted
Commit caa332336d6b2b2109894ac12e839bdc79a678b1
Delegated to: Peng Fan
Headers show
Series
  • [U-Boot] mmc: mtk-sd: add WATCHDOG_RESET() to prevent watchdog timeout
Related show

Commit Message

Weijie Gao July 19, 2019, 3:04 a.m. UTC
When reading large data in once (reading 512MiB is tested on MT7623), a
watchdog timeout is triggered due to watchdog not being fed.

This patch adds WATCHDOG_RESET() to msdc_start_data() so the watchdog will
be fed every 1024 blocks are read/written.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
---
 drivers/mmc/mtk-sd.c | 3 +++
 1 file changed, 3 insertions(+)

Patch
diff mbox series

diff --git a/drivers/mmc/mtk-sd.c b/drivers/mmc/mtk-sd.c
index e0ac3e9d69..49085090c8 100644
--- a/drivers/mmc/mtk-sd.c
+++ b/drivers/mmc/mtk-sd.c
@@ -13,6 +13,7 @@ 
 #include <errno.h>
 #include <malloc.h>
 #include <stdbool.h>
+#include <watchdog.h>
 #include <asm/gpio.h>
 #include <dm/pinctrl.h>
 #include <linux/bitops.h>
@@ -623,6 +624,8 @@  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;