Re: [PATCH v3 1/2] mmc: renesas_sdhi: skip SCC error check when retuning

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

 



On 27 August 2018 at 17:13, Niklas Söderlund
<niklas.soderlund+renesas@xxxxxxxxxxxx> wrote:
> From: Masaharu Hayakawa <masaharu.hayakawa.ry@xxxxxxxxxxx>
>
> Checking for SCC error during retuning is unnecessary.
>
> Signed-off-by: Masaharu Hayakawa <masaharu.hayakawa.ry@xxxxxxxxxxx>
> [Niklas: fix small style issue]
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@xxxxxxxxxxxx>
>
> ---
>
> * Changes since v2
> - Add comment to describe why checking SCC errors when using 4 taps is
>   not needed.
>
> * Changes since v1
> - Use intermediate variable use_4tap to simplify check.
> ---
>  drivers/mmc/host/renesas_sdhi_core.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
> index 777e32b0e410e850..4427f0e7058f3ee5 100644
> --- a/drivers/mmc/host/renesas_sdhi_core.c
> +++ b/drivers/mmc/host/renesas_sdhi_core.c
> @@ -443,6 +443,19 @@ static int renesas_sdhi_select_tuning(struct tmio_mmc_host *host)
>  static bool renesas_sdhi_check_scc_error(struct tmio_mmc_host *host)
>  {
>         struct renesas_sdhi *priv = host_to_priv(host);
> +       bool use_4tap = host->pdata->flags & TMIO_MMC_HAVE_4TAP_HS400;
> +
> +       /*
> +        * Skip checking SCC errors when running on 4 taps in HS400 mode as
> +        * any retuning would still result in the same 4 taps being used.
> +        */
> +       if (!(host->mmc->ios.timing == MMC_TIMING_UHS_SDR104) &&
> +           !(host->mmc->ios.timing == MMC_TIMING_MMC_HS200) &&
> +           !(host->mmc->ios.timing == MMC_TIMING_MMC_HS400 && !use_4tap))
> +               return false;
> +
> +       if (host->mmc->doing_retune)

To keep the tuning internals close to the mmc core, please add a new
inline function in include/linux/mmc/host.h to give the value of the
"doing_retune", something along the lines of this:

/* Allows hosts to distinguish between re-tuning and first time tuning. */
static inline bool mmc_doing_retune(struct mmc_host *host)
{
        return host->doing_retune == 1;
}

And of course in separate patch.

[...]

Otherwise this looks okay to me.

Kind regards
Uffe




[Index of Archives]     [Linux Memonry Technology]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux