diff options
Diffstat (limited to 'bsp/meta-altera/recipes-bsp/u-boot/files/v2019.07/0007-mmc-dwmmc-Enable-small-delay-before-returning-error.patch')
-rw-r--r-- | bsp/meta-altera/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/bsp/meta-altera/recipes-bsp/u-boot/files/v2019.07/0007-mmc-dwmmc-Enable-small-delay-before-returning-error.patch b/bsp/meta-altera/recipes-bsp/u-boot/files/v2019.07/0007-mmc-dwmmc-Enable-small-delay-before-returning-error.patch new file mode 100644 index 00000000..8da5892c --- /dev/null +++ b/bsp/meta-altera/recipes-bsp/u-boot/files/v2019.07/0007-mmc-dwmmc-Enable-small-delay-before-returning-error.patch @@ -0,0 +1,60 @@ +From 17366d3b46cf70a8fa4d807519790ef4b1b03772 Mon Sep 17 00:00:00 2001 +From: "Ang, Chee Hong" <chee.hong.ang@intel.com> +Date: Wed, 30 Jan 2019 21:47:36 -0800 +Subject: [PATCH 07/12] mmc: dwmmc: Enable small delay before returning error + +'SET_BLOCKLEN' may occasionally fail on first attempt. +This patch enable a small delay in dwmci_send_cmd() on +busy, I/O or CRC error to allow the MMC controller recovers +from the failure/error on subsequent retries. + +Signed-off-by: Ang, Chee Hong <chee.hong.ang@intel.com> +--- + drivers/mmc/dw_mmc.c | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c +index 1992d61182..8b9c6a8e60 100644 +--- a/drivers/mmc/dw_mmc.c ++++ b/drivers/mmc/dw_mmc.c +@@ -294,8 +294,11 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, + if (data) + flags = dwmci_set_transfer_mode(host, data); + +- if ((cmd->resp_type & MMC_RSP_136) && (cmd->resp_type & MMC_RSP_BUSY)) +- return -1; ++ if ((cmd->resp_type & MMC_RSP_136) && ++ (cmd->resp_type & MMC_RSP_BUSY)) { ++ ret = -1; ++ goto delay_ret; ++ } + + if (cmd->cmdidx == MMC_CMD_STOP_TRANSMISSION) + flags |= DWMCI_CMD_ABORT_STOP; +@@ -344,11 +347,13 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, + return -ETIMEDOUT; + } else if (mask & DWMCI_INTMSK_RE) { + debug("%s: Response Error.\n", __func__); +- return -EIO; ++ ret = -EIO; ++ goto delay_ret; + } else if ((cmd->resp_type & MMC_RSP_CRC) && + (mask & DWMCI_INTMSK_RCRC)) { + debug("%s: Response CRC Error.\n", __func__); +- return -EIO; ++ ret = -EIO; ++ goto delay_ret; + } + + +@@ -387,6 +392,7 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, + } + } + ++delay_ret: + udelay(100); + + return ret; +-- +2.21.0 + |