Patch "mmc: sdhci-esdhc-imx: disable the CMD CRC check for standard tuning" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    mmc: sdhci-esdhc-imx: disable the CMD CRC check for standard tuning

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     mmc-sdhci-esdhc-imx-disable-the-cmd-crc-check-for-st.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit a737405165d4a54e7c23ce433d05344ffaa58038
Author: Haibo Chen <haibo.chen@xxxxxxx>
Date:   Tue May 26 18:22:02 2020 +0800

    mmc: sdhci-esdhc-imx: disable the CMD CRC check for standard tuning
    
    [ Upstream commit 16e40e5b1e3c6646fd90d0c3186703d209216f03 ]
    
    In current code, we add 1ms dealy after each tuning command for standard
    tuning method. Adding this 1ms dealy is because USDHC default check the
    CMD CRC and DATA line. If detect the CMD CRC, USDHC standard tuning
    IC logic do not wait for the tuning data sending out by the card, trigger
    the buffer read ready interrupt immediately, and step to next cycle. So
    when next time the new tuning command send out by USDHC, card may still
    not send out the tuning data of the upper command,then some eMMC cards
    may stuck, can't response to any command, block the whole tuning procedure.
    
    If do not check the CMD CRC for tuning, then do not has this issue. USDHC
    will wait for the tuning data of each tuning command and check them. If the
    tuning data pass the check, it also means the CMD line also okay for tuning.
    
    So this patch disable the CMD CRC check for tuning, save some time for the
    whole tuning procedure.
    
    Signed-off-by: Haibo Chen <haibo.chen@xxxxxxx>
    Link: https://lore.kernel.org/r/1590488522-9292-2-git-send-email-haibo.chen@xxxxxxx
    Signed-off-by: Ulf Hansson <ulf.hansson@xxxxxxxxxx>
    Stable-dep-of: 1e336aa0c025 ("mmc: sdhci-esdhc-imx: correct the tuning start tap and step setting")
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index 22bb5499f515..453ac2b6910c 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -89,6 +89,7 @@
 /* NOTE: the minimum valid tuning start tap for mx6sl is 1 */
 #define ESDHC_TUNING_START_TAP_DEFAULT	0x1
 #define ESDHC_TUNING_START_TAP_MASK	0x7f
+#define ESDHC_TUNING_CMD_CRC_CHECK_DISABLE	(1 << 7)
 #define ESDHC_TUNING_STEP_MASK		0x00070000
 #define ESDHC_TUNING_STEP_SHIFT		16
 
@@ -1246,6 +1247,18 @@ static void sdhci_esdhc_imx_hwinit(struct sdhci_host *host)
 				tmp |= imx_data->boarddata.tuning_step
 					<< ESDHC_TUNING_STEP_SHIFT;
 			}
+
+			/* Disable the CMD CRC check for tuning, if not, need to
+			 * add some delay after every tuning command, because
+			 * hardware standard tuning logic will directly go to next
+			 * step once it detect the CMD CRC error, will not wait for
+			 * the card side to finally send out the tuning data, trigger
+			 * the buffer read ready interrupt immediately. If usdhc send
+			 * the next tuning command some eMMC card will stuck, can't
+			 * response, block the tuning procedure or the first command
+			 * after the whole tuning procedure always can't get any response.
+			 */
+			 tmp |= ESDHC_TUNING_CMD_CRC_CHECK_DISABLE;
 			writel(tmp, host->ioaddr + ESDHC_TUNING_CTRL);
 		} else if (imx_data->socdata->flags & ESDHC_FLAG_MAN_TUNING) {
 			/*
@@ -1587,8 +1600,6 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
 	if (err)
 		goto disable_ahb_clk;
 
-	host->tuning_delay = 1;
-
 	sdhci_esdhc_imx_hwinit(host);
 
 	err = sdhci_add_host(host);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux