Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp641925imm; Wed, 25 Jul 2018 03:44:17 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfYn3WbHf01G4VcfaEFWZ8qlE2FayzZAu6eMcYniQNjKoWj1xmPVaJTkl1D4NKIjDLBcqfF X-Received: by 2002:a62:b0c:: with SMTP id t12-v6mr21632220pfi.36.1532515457259; Wed, 25 Jul 2018 03:44:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532515457; cv=none; d=google.com; s=arc-20160816; b=DhhafOr6ZygF/X8nN5ahnGV26ZId6fYuzqCTc1KqiUTdSWv7xqp0ie4ndYb1Bdh5N8 chNbkQqWyLfD2KFX5OyjRW90I//WizV7SWl3qpUDguY7Gl4LyLxnUKtNCa7EhfznHNyj Lx4gp9NMbWQAlLpAvMNS9+MP9rrVT6qoJ+8/+fYj4OFaSOq6atoBLBiy0LDehTLaANju Bj0AUEfQPd1V2PG1hs6Xsokql8wuTcsSDvuPQTgkKxDfrOZqd+TyLtLqSeBcodFPRbXy LWG4VyNk0Y2B0YG7Q9b2K73BIovzIXElCwIcLOiFzNU7nU0/hdgm89y9cLWnq/q+nlWY COEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=yBby+ENsMnivk3pSmeDU4APziGOyuyA9AInYGuiOWvw=; b=PQ9xPEHUDQakEh6YSYbJAp6SzL8JLy6bB/FS1udumF0k3WCncP2HfaPPgLHLQL9Xpf JseeRexKpwthEENoDNxi5d3kARSheOLoVKJOmCoJCynay7Gyt+dx27UKsI0XgUbjlieH aFchTW0KJ2rEiPuHe5j0wrauLFkWCoKyZJVgYfy5x4X4oYwDPUDLFV+uvHpz4x/MMjbs pYWDTuro45V/WPIgrhgnwXzng9f/psh2Sh4zR24yyZsDa+WFv16qu27L/2kEJXN5qqQG GlWZ6inOzPyqekWDilKvBKBf8L6mvmJBxjhM3/atia03rOyPMwhsvSlU5uv8eG4QoUwD SeBA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k4-v6si14371181pfc.328.2018.07.25.03.44.02; Wed, 25 Jul 2018 03:44:17 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728849AbeGYLyP (ORCPT + 99 others); Wed, 25 Jul 2018 07:54:15 -0400 Received: from hqemgate14.nvidia.com ([216.228.121.143]:7857 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728759AbeGYLyP (ORCPT ); Wed, 25 Jul 2018 07:54:15 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com (using TLS: TLSv1, AES128-SHA) id ; Wed, 25 Jul 2018 03:43:00 -0700 Received: from HQMAIL101.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Wed, 25 Jul 2018 03:43:09 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Wed, 25 Jul 2018 03:43:09 -0700 Received: from dhcp-10-21-25-168 (10.21.25.201) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 25 Jul 2018 10:43:06 +0000 Date: Wed, 25 Jul 2018 13:43:00 +0300 From: Aapo Vienamo To: Mikko Perttunen CC: Ulf Hansson , Rob Herring , Mark Rutland , Thierry Reding , Jonathan Hunter , "Adrian Hunter" , Mikko Perttunen , , , , Subject: Re: [PATCH 09/10] mmc: tegra: Perform pad calibration after voltage switch Message-ID: <20180725134300.7e537ceb@dhcp-10-21-25-168> In-Reply-To: References: <1532442591-5640-1-git-send-email-avienamo@nvidia.com> <1532442865-6391-1-git-send-email-avienamo@nvidia.com> <1532442865-6391-8-git-send-email-avienamo@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.21.25.201] X-ClientProxiedBy: UKMAIL102.nvidia.com (10.26.138.15) To HQMAIL101.nvidia.com (172.20.187.10) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 25 Jul 2018 10:25:16 +0300 Mikko Perttunen wrote: > On 24.07.2018 17:34, Aapo Vienamo wrote: > > Run the automatic pad calibration after voltage switching if > > tegra_host->pad_calib_required is set. > > > > Signed-off-by: Aapo Vienamo > > --- > > drivers/mmc/host/sdhci-tegra.c | 5 +++++ > > 1 file changed, 5 insertions(+) > > > > diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c > > index 78781bd..529aa4e7 100644 > > --- a/drivers/mmc/host/sdhci-tegra.c > > +++ b/drivers/mmc/host/sdhci-tegra.c > > @@ -537,6 +537,8 @@ static int sdhci_tegra_start_signal_voltage_switch(struct mmc_host *mmc, > > struct mmc_ios *ios) > > { > > 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); > > int ret = 0; > > > > if (ios->signal_voltage == MMC_SIGNAL_VOLTAGE_330) { > > @@ -551,6 +553,9 @@ static int sdhci_tegra_start_signal_voltage_switch(struct mmc_host *mmc, > > ret = tegra_sdhci_set_padctrl(host, ios->signal_voltage); > > } > > > > + if (tegra_host->pad_calib_required) > > + tegra_sdhci_pad_autocalib(host); > > What if the autocalibration fails? Should we return an error? I would assume that aborting the signal voltage switch due to a calibration timeout would not be necessary as the TRM specifies drive strength values which are to be programmed in case a timeout occurs. However, I don't know what are the exact implications of running the bus with the timeout values instead of the calibrated ones. The TRM does not comment on that. I guess tuning would fail and catch the error that way in case the timeout default values aren't sufficient. -Aapo > > + > > return ret; > > } > > > >