1 From 793bed29e78cc54d989333d756fef51efaca4e56 Mon Sep 17 00:00:00 2001
2 From: Weijie Gao <weijie.gao@mediatek.com>
3 Date: Tue, 26 Jul 2022 09:29:18 +0800
4 Subject: [PATCH 58/71] mmc: mtk-sd: add support to display verbose error log
6 Add an option to enable debug log, and also display verbose error log for
9 Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
11 drivers/mmc/Kconfig | 8 ++++++++
12 drivers/mmc/Makefile | 4 ++++
13 drivers/mmc/mtk-sd.c | 24 +++++++++++++++---------
14 3 files changed, 27 insertions(+), 9 deletions(-)
16 --- a/drivers/mmc/Kconfig
17 +++ b/drivers/mmc/Kconfig
18 @@ -812,6 +812,14 @@ config MMC_MTK
19 This is needed if support for any SD/SDIO/MMC devices is required.
23 + bool "Display verbose error log"
27 + Enable this option to allow verbose error log being displayed for
33 --- a/drivers/mmc/Makefile
34 +++ b/drivers/mmc/Makefile
35 @@ -84,3 +84,7 @@ obj-$(CONFIG_RENESAS_SDHI) += tmio-comm
36 obj-$(CONFIG_MMC_BCM2835) += bcm2835_sdhost.o
37 obj-$(CONFIG_MMC_MTK) += mtk-sd.o
38 obj-$(CONFIG_MMC_SDHCI_F_SDH30) += f_sdh30.o
40 +ifdef CONFIG_MMC_MTK_DEBUG
41 +CFLAGS_mtk-sd.o += -DDEBUG
43 --- a/drivers/mmc/mtk-sd.c
44 +++ b/drivers/mmc/mtk-sd.c
45 @@ -778,18 +778,24 @@ static int msdc_ops_send_cmd(struct udev
48 (cmd->cmdidx == MMC_CMD_SEND_TUNING_BLOCK ||
49 - cmd->cmdidx == MMC_CMD_SEND_TUNING_BLOCK_HS200)))
50 + cmd->cmdidx == MMC_CMD_SEND_TUNING_BLOCK_HS200))) {
51 + dev_dbg(dev, "MSDC start command failure with %d, cmd=%d, arg=0x%x\n",
52 + cmd_ret, cmd->cmdidx, cmd->cmdarg);
56 - data_ret = msdc_start_data(host, data);
67 + data_ret = msdc_start_data(host, data);
72 + dev_dbg(dev, "MSDC start data failure with %d, cmd=%d, arg=0x%x\n",
73 + data_ret, cmd->cmdidx, cmd->cmdarg);
78 static void msdc_set_timeout(struct msdc_host *host, u32 ns, u32 clks)