Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1421022imm; Sun, 2 Sep 2018 23:15:45 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZoRWaWgKxoDJ2z0k+ie9PkYTrMfXktO8wV+sSqUhPTMT9MryJoXwHJGRGjZTmaf1kpPGT3 X-Received: by 2002:a65:4043:: with SMTP id h3-v6mr20612669pgp.207.1535955345376; Sun, 02 Sep 2018 23:15:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535955345; cv=none; d=google.com; s=arc-20160816; b=nAJI/IN5inHDUarUszmrsGONalbkJoO9Htr+q0XcHKClzJIeiqfWgOXUkK/H6ZYlQK fgq6tQ4fGdXJhl7oeGaI37CG24Gv/ioouk6WPSUczlltI9npV41wKUWqE7uLiY3E6t+S 0L9qdiG57JmdiOg35oZc6KGSkp1ZBI10SBj8pOMtnedJpmYvaLowkgo83Lqm0VpKaUAM JKxYTqVe7SdL+Rvtxe6N8CiduFs9fUnyhH7n0SF6rIiF98TODELmVAVy6hzkfNkPHlpp QkUn+WtdCGbhd725I4taDK4BNtlWKy1uHAsYI4rjgQamlb5N1QK7/dEx74pspTnUIvyY 0ePQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=We7LNafJy+Vt3sjW2KFoQGF5khqUR7daFFGymTNei7Y=; b=wr6TO9fw7E0sBCjK06TRVAgEFby/1Q2KiI4Lud3gsfea0UFt+ZCjkJBzsKTRI+4FSU xeMRorTaOxO34rFIq8J2dXCoKErJeCIBZOZDajQUkOUNYOb2KXWqgtKkQ/x3f/dF/p5l giKYUpvJVpXhJ5cqWkaYDbr5u/1Oh8gd/ODY4LP3rBGWOksxq4heZOYaHBnDRt0VFLDQ W2nl3sioxgc4ZtpHsjZHySVFtTOxnEL74xONgNLFy756w6zLN1LcKTcIOa+IfpnPsh7J kjLIftI9Ou/GWFYZoOBLSMCfxndj0klvDB0en3NuPnlJYQv1z8EQkS2faYHGezC35gO+ EppA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PdkXMHSL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 69-v6si17321297pla.505.2018.09.02.23.15.30; Sun, 02 Sep 2018 23:15:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PdkXMHSL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726763AbeICKdC (ORCPT + 99 others); Mon, 3 Sep 2018 06:33:02 -0400 Received: from mail-io0-f195.google.com ([209.85.223.195]:33881 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726102AbeICKdC (ORCPT ); Mon, 3 Sep 2018 06:33:02 -0400 Received: by mail-io0-f195.google.com with SMTP id c22-v6so15060033iob.1 for ; Sun, 02 Sep 2018 23:14:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=We7LNafJy+Vt3sjW2KFoQGF5khqUR7daFFGymTNei7Y=; b=PdkXMHSLD7r+dFnK/A/FRL6FJj44IMJjPoFbz0DGVdpEUiiNJcbD2wLbzxlYDa4WeK U+iLS1nqodELWcs3XEFBY7XzShBUZ085UEVoGTHLurSFR040gdVZ7wT6jKEK/xduimd2 FPthft25PJXwANoPBNXQrISjYaX2eDvLTmQNc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=We7LNafJy+Vt3sjW2KFoQGF5khqUR7daFFGymTNei7Y=; b=uBKWyW1PhV7108r6cEgLGyRysNPlkljQh8QdVa9Izj554/isDNuy+AmJ4M4/xQ2SRx 7t8pqjlXzFaMMYrS/lX4arDGkfKK++kn8a7JC8WQ9jN0XmVOkuxiEVZdeCssA9zwPcxq 9U0O5RXnxGG4BZOLyOxRDbUW7uvIxthNXEW9fZ92o1zaU+c/ZcCjFb6VUsefVGmqwEOz 465Lv4YLskR+JCnzauGFI1HIyGhSEgY+N1zJuz/rgIidBkAu8/AgswOyUgKHwb4H9foE s7FqRS8kDU3C4GTJohvwL6+bWrnqzCLN7R0cXGnk273hG1N4SHefuk4S4JDyyS9pZaee pw3Q== X-Gm-Message-State: APzg51ARsuGV2yzHNsbvJgO6lYS7Phu8josmcQeejS8cC0IeCm3EjVYU UouAFlR/r/yWCsQatv/wPMl6s20Ocm32ne8w08lcSw== X-Received: by 2002:a6b:c995:: with SMTP id z143-v6mr19082126iof.266.1535955262101; Sun, 02 Sep 2018 23:14:22 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:1bd8:0:0:0:0:0 with HTTP; Sun, 2 Sep 2018 23:14:21 -0700 (PDT) In-Reply-To: <1534757013-4524-3-git-send-email-avienamo@nvidia.com> References: <1534757013-4524-1-git-send-email-avienamo@nvidia.com> <1534757013-4524-3-git-send-email-avienamo@nvidia.com> From: Ulf Hansson Date: Mon, 3 Sep 2018 08:14:21 +0200 Message-ID: Subject: Re: [PATCH 2/2] mmc: tegra: Implement periodic pad calibration To: Aapo Vienamo Cc: Adrian Hunter , Thierry Reding , Jonathan Hunter , "linux-mmc@vger.kernel.org" , linux-tegra@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20 August 2018 at 11: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 Applied for next, thanks! Kind regards Uffe > --- > 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 > #include > #include > +#include > > #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; > > -- > 2.7.4 >