mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Aapo Vienamo <avienamo@nvidia.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Jonathan Hunter <jonathanh@nvidia.com>
Cc: linux-mmc@vger.kernel.org, linux-tegra@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] mmc: tegra: Implement periodic pad calibration
Date: Wed, 22 Aug 2018 13:56:57 +0300	[thread overview]
Message-ID: <3bdbaef6-522d-92ea-c0d1-1aea9fd069d9@intel.com> (raw)
In-Reply-To: <1534757013-4524-3-git-send-email-avienamo@nvidia.com>

On 20/08/18 12:23, Aapo Vienamo wrote:
> Rerun the pad calibration procedure before sdhci_request() if
> the 100 ms recalibration interval has been exceeded.
> 
> Signed-off-by: Aapo Vienamo <avienamo@nvidia.com>

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
>  drivers/mmc/host/sdhci-tegra.c | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
> index 94624ec..ef18a0c 100644
> --- a/drivers/mmc/host/sdhci-tegra.c
> +++ b/drivers/mmc/host/sdhci-tegra.c
> @@ -30,6 +30,7 @@
>  #include <linux/mmc/mmc.h>
>  #include <linux/mmc/slot-gpio.h>
>  #include <linux/gpio/consumer.h>
> +#include <linux/ktime.h>
>  
>  #include "sdhci-pltfm.h"
>  
> @@ -122,6 +123,7 @@ struct sdhci_tegra {
>  	struct pinctrl_state *pinctrl_state_1v8;
>  
>  	struct sdhci_tegra_autocal_offsets autocal_offsets;
> +	ktime_t last_calib;
>  
>  	u32 default_tap;
>  	u32 default_trim;
> @@ -533,6 +535,22 @@ static void tegra_sdhci_parse_pad_autocal_dt(struct sdhci_host *host)
>  		autocal->pull_down_hs400 = autocal->pull_down_1v8;
>  }
>  
> +static void tegra_sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
> +{
> +	struct sdhci_host *host = mmc_priv(mmc);
> +	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
> +	struct sdhci_tegra *tegra_host = sdhci_pltfm_priv(pltfm_host);
> +	ktime_t since_calib = ktime_sub(ktime_get(), tegra_host->last_calib);
> +
> +	/* 100 ms calibration interval is specified in the TRM */
> +	if (ktime_to_ms(since_calib) > 100) {
> +		tegra_sdhci_pad_autocalib(host);
> +		tegra_host->last_calib = ktime_get();
> +	}
> +
> +	sdhci_request(mmc, mrq);
> +}
> +
>  static void tegra_sdhci_parse_tap_and_trim(struct sdhci_host *host)
>  {
>  	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
> @@ -1014,6 +1032,10 @@ static int sdhci_tegra_probe(struct platform_device *pdev)
>  				sdhci_tegra_start_signal_voltage_switch;
>  	}
>  
> +	/* Hook to periodically rerun pad calibration */
> +	if (soc_data->nvquirks & NVQUIRK_HAS_PADCALIB)
> +		host->mmc_host_ops.request = tegra_sdhci_request;
> +
>  	host->mmc_host_ops.hs400_enhanced_strobe =
>  			tegra_sdhci_hs400_enhanced_strobe;
>  
> 


  reply	other threads:[~2018-08-22 10:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-20  9:23 [PATCH 0/2] Tegra SDHCI rerun pad calibration periodically Aapo Vienamo
2018-08-20  9:23 ` [PATCH 1/2] mmc: sdhci: Export sdhci_request() Aapo Vienamo
2018-08-22 10:54   ` Adrian Hunter
2018-08-27 10:07   ` Ulf Hansson
2018-08-27 10:11     ` Thierry Reding
2018-08-20  9:23 ` [PATCH 2/2] mmc: tegra: Implement periodic pad calibration Aapo Vienamo
2018-08-22 10:56   ` Adrian Hunter [this message]
2018-08-31 14:00   ` Thierry Reding
2018-09-03  6:14   ` Ulf Hansson
2018-08-23  8:50 ` [PATCH 0/2] Tegra SDHCI rerun pad calibration periodically Thierry Reding
2018-08-27  9:55   ` 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=3bdbaef6-522d-92ea-c0d1-1aea9fd069d9@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=avienamo@nvidia.com \
    --cc=jonathanh@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=ulf.hansson@linaro.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

Powered by JetHome