linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Adrian Hunter <adrian.hunter@intel.com>
Cc: Chris Ball <chris@printf.net>, linux-mmc <linux-mmc@vger.kernel.org>
Subject: Re: [PATCH 3/3] mmc: sdhci: Disable re-tuning for HS400
Date: Tue, 2 Dec 2014 10:35:35 +0100	[thread overview]
Message-ID: <CAPDyKFq30Qkx8rW1ixavv=UdBjcQfsz6kDvcfmcTq4A4ziptUQ@mail.gmail.com> (raw)
In-Reply-To: <1417439766-5063-4-git-send-email-adrian.hunter@intel.com>

On 1 December 2014 at 14:16, Adrian Hunter <adrian.hunter@intel.com> wrote:
> Re-tuning for HS400 mode must be done in HS200
> mode. Currently there is no support for that.
> That needs to be reflected in the code.
> Specifically, if tuning is executed in HS400 mode
> then return an error, and if the re-tuning timer
> is running when switching to HS400 mode, then
> disable the timer.
>
> Note that periodic re-tuning is not expected
> to be needed for HS400 but re-tuning is still
> needed after the host controller has lost power.

Why can't the old values be restored instead of trigger a re-tuning?

> In the case of suspend/resume that is not necessary
> because the card is fully re-initialised. That
> just leaves runtime suspend/resume with no support
> for HS400 re-tuning.
>
> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
> ---
>  drivers/mmc/host/sdhci.c | 16 +++++++++++++++-
>  1 file changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 2efa7fe..a7c9e67 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -1476,8 +1476,18 @@ void sdhci_set_uhs_signaling(struct sdhci_host *host, unsigned timing)
>         else if ((timing == MMC_TIMING_UHS_DDR50) ||
>                  (timing == MMC_TIMING_MMC_DDR52))
>                 ctrl_2 |= SDHCI_CTRL_UHS_DDR50;
> -       else if (timing == MMC_TIMING_MMC_HS400)
> +       else if (timing == MMC_TIMING_MMC_HS400) {
>                 ctrl_2 |= SDHCI_CTRL_HS400; /* Non-standard */
> +               /*
> +                * Periodic re-tuning for HS400 is not expected to be needed, so
> +                * disable it here.

Urgh, I don't like that the periodic tuning is handled by the host. We
should never had merged that.

How about trying to move the periodic tuning to be handled by the mmc
core instead?

> +                */
> +               if (host->flags & SDHCI_USING_RETUNING_TIMER) {
> +                       host->flags &= ~SDHCI_USING_RETUNING_TIMER;
> +                       del_timer_sync(&host->tuning_timer);
> +                       host->flags &= ~SDHCI_NEEDS_RETUNING;
> +               }
> +       }
>         sdhci_writew(host, ctrl_2, SDHCI_HOST_CONTROL2);
>  }
>  EXPORT_SYMBOL_GPL(sdhci_set_uhs_signaling);
> @@ -1897,7 +1907,11 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
>          * tuning function has to be executed.
>          */
>         switch (host->timing) {
> +       /* HS400 tuning is done in HS200 mode */
>         case MMC_TIMING_MMC_HS400:
> +               err = -EINVAL;
> +               goto out_unlock;
> +
>         case MMC_TIMING_MMC_HS200:
>         case MMC_TIMING_UHS_SDR104:
>                 break;
> --
> 1.9.1
>

Kind regards
Uffe

  reply	other threads:[~2014-12-02  9:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-01 13:16 [PATCH 0/3] mmc: sdhci: Disable re-tuning for HS400 Adrian Hunter
2014-12-01 13:16 ` [PATCH 1/3] mmc: sdhci: Tuning should not change max_blk_count Adrian Hunter
2014-12-01 13:16 ` [PATCH 2/3] mmc: sdhci: Add out_unlock to sdhci_execute_tuning Adrian Hunter
2014-12-01 13:16 ` [PATCH 3/3] mmc: sdhci: Disable re-tuning for HS400 Adrian Hunter
2014-12-02  9:35   ` Ulf Hansson [this message]
2014-12-02 10:08     ` Adrian Hunter
2014-12-02 11:20       ` Ulf Hansson
2014-12-02 12:28         ` Adrian Hunter
2014-12-02 14:06           ` Ulf Hansson

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='CAPDyKFq30Qkx8rW1ixavv=UdBjcQfsz6kDvcfmcTq4A4ziptUQ@mail.gmail.com' \
    --to=ulf.hansson@linaro.org \
    --cc=adrian.hunter@intel.com \
    --cc=chris@printf.net \
    --cc=linux-mmc@vger.kernel.org \
    /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).