linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: linux-mmc <linux-mmc@vger.kernel.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Subject: Re: [PATCH] mmc: renesas_sdhi: abort tuning when timeout detected
Date: Tue, 8 Jun 2021 15:16:12 +0200	[thread overview]
Message-ID: <CAPDyKFo0jP-0yZd-89J7v4xdcBnH5H5yGa_s4a-hw=mkHxOrxg@mail.gmail.com> (raw)
In-Reply-To: <20210602073435.5955-1-wsa+renesas@sang-engineering.com>

On Wed, 2 Jun 2021 at 09:34, Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
>
> We have to bring the eMMC from sending-data state back to transfer state
> once we detected a CRC error (timeout) during tuning. So, send a stop
> command via mmc_abort_tuning().
>
> Fixes: 4f11997773b6 ("mmc: tmio: Add tuning support")
> Reported-by Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Applied for fixes and by adding a stable tag, thanks!

> ---
>
> Ulf, I'd think that mmc_abort_tuning() should be named
> mmc_abort_tuning_cmd() instead. Because we don't actually abort the
> tuning as a whole in this function. What do you think? I can prepare a
> patch if you agree.

Good point.

I have no strong opinion, but perhaps mmc_send_abort_tuning() is more
consistent with other function names?

Kind regards
Uffe


>
>  drivers/mmc/host/renesas_sdhi_core.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
> index 635bf31a6735..9029308c4a0f 100644
> --- a/drivers/mmc/host/renesas_sdhi_core.c
> +++ b/drivers/mmc/host/renesas_sdhi_core.c
> @@ -692,14 +692,19 @@ static int renesas_sdhi_execute_tuning(struct mmc_host *mmc, u32 opcode)
>
>         /* Issue CMD19 twice for each tap */
>         for (i = 0; i < 2 * priv->tap_num; i++) {
> +               int cmd_error;
> +
>                 /* Set sampling clock position */
>                 sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_TAPSET, i % priv->tap_num);
>
> -               if (mmc_send_tuning(mmc, opcode, NULL) == 0)
> +               if (mmc_send_tuning(mmc, opcode, &cmd_error) == 0)
>                         set_bit(i, priv->taps);
>
>                 if (sd_scc_read32(host, priv, SH_MOBILE_SDHI_SCC_SMPCMP) == 0)
>                         set_bit(i, priv->smpcmp);
> +
> +               if (cmd_error)
> +                       mmc_abort_tuning(mmc, opcode);
>         }
>
>         ret = renesas_sdhi_select_tuning(host);
> --
> 2.30.2
>

  parent reply	other threads:[~2021-06-08 13:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-02  7:34 [PATCH] mmc: renesas_sdhi: abort tuning when timeout detected Wolfram Sang
2021-06-03 13:36 ` Niklas Söderlund
2021-06-04  1:36 ` Yoshihiro Shimoda
2021-06-08 13:16 ` Ulf Hansson [this message]
2021-06-08 14:38   ` Wolfram Sang

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='CAPDyKFo0jP-0yZd-89J7v4xdcBnH5H5yGa_s4a-hw=mkHxOrxg@mail.gmail.com' \
    --to=ulf.hansson@linaro.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=wsa+renesas@sang-engineering.com \
    --cc=yoshihiro.shimoda.uh@renesas.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).