diff options
Diffstat (limited to 'recipes-bsp/u-boot/files/v2019.07/0007-mmc-dwmmc-Enable-small-delay-before-returning-error.patch')
-rw-r--r-- | recipes-bsp/u-boot/files/v2019.07/0007-mmc-dwmmc-Enable-small-delay-before-returning-error.patch | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/recipes-bsp/u-boot/files/v2019.07/0007-mmc-dwmmc-Enable-small-delay-before-returning-error.patch b/recipes-bsp/u-boot/files/v2019.07/0007-mmc-dwmmc-Enable-small-delay-before-returning-error.patch new file mode 100644 index 0000000..8da5892 --- /dev/null +++ b/recipes-bsp/u-boot/files/v2019.07/0007-mmc-dwmmc-Enable-small-delay-before-returning-error.patch | |||
@@ -0,0 +1,60 @@ | |||
1 | From 17366d3b46cf70a8fa4d807519790ef4b1b03772 Mon Sep 17 00:00:00 2001 | ||
2 | From: "Ang, Chee Hong" <chee.hong.ang@intel.com> | ||
3 | Date: Wed, 30 Jan 2019 21:47:36 -0800 | ||
4 | Subject: [PATCH 07/12] mmc: dwmmc: Enable small delay before returning error | ||
5 | |||
6 | 'SET_BLOCKLEN' may occasionally fail on first attempt. | ||
7 | This patch enable a small delay in dwmci_send_cmd() on | ||
8 | busy, I/O or CRC error to allow the MMC controller recovers | ||
9 | from the failure/error on subsequent retries. | ||
10 | |||
11 | Signed-off-by: Ang, Chee Hong <chee.hong.ang@intel.com> | ||
12 | --- | ||
13 | drivers/mmc/dw_mmc.c | 14 ++++++++++---- | ||
14 | 1 file changed, 10 insertions(+), 4 deletions(-) | ||
15 | |||
16 | diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c | ||
17 | index 1992d61182..8b9c6a8e60 100644 | ||
18 | --- a/drivers/mmc/dw_mmc.c | ||
19 | +++ b/drivers/mmc/dw_mmc.c | ||
20 | @@ -294,8 +294,11 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, | ||
21 | if (data) | ||
22 | flags = dwmci_set_transfer_mode(host, data); | ||
23 | |||
24 | - if ((cmd->resp_type & MMC_RSP_136) && (cmd->resp_type & MMC_RSP_BUSY)) | ||
25 | - return -1; | ||
26 | + if ((cmd->resp_type & MMC_RSP_136) && | ||
27 | + (cmd->resp_type & MMC_RSP_BUSY)) { | ||
28 | + ret = -1; | ||
29 | + goto delay_ret; | ||
30 | + } | ||
31 | |||
32 | if (cmd->cmdidx == MMC_CMD_STOP_TRANSMISSION) | ||
33 | flags |= DWMCI_CMD_ABORT_STOP; | ||
34 | @@ -344,11 +347,13 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, | ||
35 | return -ETIMEDOUT; | ||
36 | } else if (mask & DWMCI_INTMSK_RE) { | ||
37 | debug("%s: Response Error.\n", __func__); | ||
38 | - return -EIO; | ||
39 | + ret = -EIO; | ||
40 | + goto delay_ret; | ||
41 | } else if ((cmd->resp_type & MMC_RSP_CRC) && | ||
42 | (mask & DWMCI_INTMSK_RCRC)) { | ||
43 | debug("%s: Response CRC Error.\n", __func__); | ||
44 | - return -EIO; | ||
45 | + ret = -EIO; | ||
46 | + goto delay_ret; | ||
47 | } | ||
48 | |||
49 | |||
50 | @@ -387,6 +392,7 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, | ||
51 | } | ||
52 | } | ||
53 | |||
54 | +delay_ret: | ||
55 | udelay(100); | ||
56 | |||
57 | return ret; | ||
58 | -- | ||
59 | 2.21.0 | ||
60 | |||