All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Haibo Chen <haibo.chen@nxp.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	dl-linux-imx <linux-imx@nxp.com>, Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Sascha Hauer <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	Aisheng Dong <aisheng.dong@nxp.com>,
	Yangbo Lu <yangbo.lu@nxp.com>
Subject: Re: [PATCH 2/2] mmc: sdhci-esdhc-imx: disable the CMD CRC check for standard tuning
Date: Thu, 28 May 2020 12:14:40 +0200	[thread overview]
Message-ID: <CAPDyKFoSSS0rh06Kso44J+ZFQC16K+Xttw6gQfUiganHKG5BXg@mail.gmail.com> (raw)
In-Reply-To: <1590488522-9292-2-git-send-email-haibo.chen@nxp.com>

On Tue, 26 May 2020 at 12:32, <haibo.chen@nxp.com> wrote:
>
> From: Haibo Chen <haibo.chen@nxp.com>
>
> 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@nxp.com>

Applied for next, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/sdhci-esdhc-imx.c | 15 +++++++++++++--
>  1 file changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
> index 2cf7fa59270e..b0ddf3db440f 100644
> --- a/drivers/mmc/host/sdhci-esdhc-imx.c
> +++ b/drivers/mmc/host/sdhci-esdhc-imx.c
> @@ -91,6 +91,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
>
> @@ -1316,6 +1317,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) {
>                         /*
> @@ -1661,8 +1674,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);
> --
> 2.17.1
>

  reply	other threads:[~2020-05-28 10:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-26 10:22 [PATCH 1/2] mmc: sdhci-esdhc-imx: fix the mask for tuning start point haibo.chen
2020-05-26 10:22 ` [PATCH 2/2] mmc: sdhci-esdhc-imx: disable the CMD CRC check for standard tuning haibo.chen
2020-05-28 10:14   ` Ulf Hansson [this message]
2020-05-28 10:14 ` [PATCH 1/2] mmc: sdhci-esdhc-imx: fix the mask for tuning start point Ulf Hansson
2022-12-01 17:34 ` Kevin Groeneveld
2022-12-02  3:35   ` Bough Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPDyKFoSSS0rh06Kso44J+ZFQC16K+Xttw6gQfUiganHKG5BXg@mail.gmail.com \
    --to=ulf.hansson@linaro.org \
    --cc=adrian.hunter@intel.com \
    --cc=aisheng.dong@nxp.com \
    --cc=festevam@gmail.com \
    --cc=haibo.chen@nxp.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-imx@nxp.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=yangbo.lu@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.