Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2152588imm; Mon, 16 Jul 2018 03:13:01 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdk/mOqH5/Uj15JwTe0Wced5QUA/Wwl2kvfhcmHwlm6Njzgy9BkXEv5lj/Kyp/U/kD1tQeD X-Received: by 2002:a63:4d47:: with SMTP id n7-v6mr15001309pgl.270.1531735981328; Mon, 16 Jul 2018 03:13:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531735981; cv=none; d=google.com; s=arc-20160816; b=NbOIsOpxUclRNu8rS6IlTckbUVEV0fng7WvsUgjIY1eRwqS7DxsT+ycJwZ4mcVHBGx PgI8A3QwbT5eLLvY2GHjS8GnJcD7PyFj/z5j9Uh3pNB+c0iZjlVYjGNRILaYkR6gJ7bn ZW7WnlEMKR9YEIDxdcSET5rR8o8IQVJ4deoxOj/qWsIDfHbSg4Eg232QZw2BLGTPbUeV vJnKkNP0L3ZoJ6a09+nLmvlp0RtFbidZhk+tUqId53yDijUEZCyhLInIg/cBObzUqmBV KaF+ve+xJSDVuUw0fm2yWqdZTL4L4wCqMAbSU6vtmKmQC+K75DjDmkyfqkFbExE4LVIj 1gqw== 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=3E4IEqiA8AC59YBk2YxsVK6XczwOI0hkUk4+3CDUEa0=; b=b6Qujs45zo/hfGTysQv9Zu4WTtQbJUAfo0Ki6fcPmtJFSF3P/aWrMvLNYRhWq/nEMT 5g0MQvxlL1Q6MnFyuEljONq3xGG89KGrkF7uAsYKrsCHs4S1wFfjSYz11ZLrpx5MrkX4 nYa025cgd5cl3IqgDyOkoUTRPUqv8yBJon84eJm31B7NdGAmaV/AHsJuk/2YcanDUzNX XGp8SoHZnw78kvyQd9/CV0Jyo3uE1T/xA+3/Wrp0N9HAMwGQpT0bTDyyuaYvOhQp7aAE jI3mX/U/V9Nw43vNuABDKEH6hErpHZVII5IfPa9xtCiEIVBxP0o0DdMgW7IiAwzoTzMC xnJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZDxQNZJn; 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 x2-v6si27867191pgr.33.2018.07.16.03.12.46; Mon, 16 Jul 2018 03:13:01 -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=ZDxQNZJn; 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 S1731327AbeGPKiZ (ORCPT + 99 others); Mon, 16 Jul 2018 06:38:25 -0400 Received: from mail-io0-f193.google.com ([209.85.223.193]:34239 "EHLO mail-io0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731292AbeGPKiZ (ORCPT ); Mon, 16 Jul 2018 06:38:25 -0400 Received: by mail-io0-f193.google.com with SMTP id l7-v6so37282207ioj.1 for ; Mon, 16 Jul 2018 03:11:44 -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=3E4IEqiA8AC59YBk2YxsVK6XczwOI0hkUk4+3CDUEa0=; b=ZDxQNZJn8cvaa0ss0KxhBBMMfZGWIfzDxq+mzPj0Y5Z23MLDEl7nkGCO7Vx0CGn07c p5yASIe6jjweexcrhPMPZOU+t+a19JTbVRvHTzha5bvQtj59Q9o1lQOsRoKMom1a9uT4 M4dAxIt7aa7c9nvHJQEvialrey6gUzu9sLkFY= 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=3E4IEqiA8AC59YBk2YxsVK6XczwOI0hkUk4+3CDUEa0=; b=NlpjgmicyKc+iUDDWM19LwMYGdjDwZzizwZP8yFwz27zGwgYRYK/QN0AOw3mVtFjpA LG7+5RmR1qk5kUaVh1njsGsZ9nNSCjQGZXZ6zPeEOmByd+YHuen3N+i3G4LoyRi1B0OH 3KWzsOrlsvFDk8O+p2iJMckRhwP1RqN22D19HQqIuloGanzUCdkZYWT7NcjmrxdSuoIn 5gKlFcCsm2/bQBY7uvoxEcOEuYZFOxF6PB+5YT0uh37CxwsVs5vMIhCfcBdxyjunBSjn 1QX51u/J3DWPnDtmLSGyxOFPL4EDjaQ8SZj08s7AfPOiPGShzk9nztOKu2JKWcIJFiMj sMAQ== X-Gm-Message-State: APt69E1sgOCV65uag7XhsujGsGVW+vdplU9m1cyVn8XlqoYGQNZ+EqMO IlAOyGnBByZokK6IWa1oBDAMxbRhwm+RAemAWhg/dg== X-Received: by 2002:a6b:e403:: with SMTP id u3-v6mr37731083iog.131.1531735904331; Mon, 16 Jul 2018 03:11:44 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:2b03:0:0:0:0:0 with HTTP; Mon, 16 Jul 2018 03:11:43 -0700 (PDT) In-Reply-To: <1531487865-17427-1-git-send-email-avienamo@nvidia.com> References: <1531487865-17427-1-git-send-email-avienamo@nvidia.com> From: Ulf Hansson Date: Mon, 16 Jul 2018 12:11:43 +0200 Message-ID: Subject: Re: [PATCH] mmc: tegra: Add and use tegra_sdhci_get_max_clock() To: Aapo Vienamo Cc: Adrian Hunter , Thierry Reding , Jonathan Hunter , Marcel Ziswiler , "linux-mmc@vger.kernel.org" , linux-tegra@vger.kernel.org, Linux Kernel Mailing List , Stefan Agner 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 +Stefan On 13 July 2018 at 15:17, Aapo Vienamo wrote: > Implement and use tegra_sdhci_get_max_clock() which returns the true > maximum host clock rate. The issue with tegra_sdhci_get_max_clock() is > that it returns the current clock rate of the host instead of the > maximum one, which can lead to unnecessarily small clock rates. > > This differs from the previous implementation of > tegra_sdhci_get_max_clock() in that it doesn't divide the result by two. > > Signed-off-by: Aapo Vienamo Thanks, applied for next! I realize there are some discussions and tests going on in regards to the changes for tegra driver. However, I decided to apply all pending patches from Stefan and you, to get them tested in next for a while to see how it plays. Please tell if you want me to drop some changes - or if you prefer to send patches on top to fix further related issues. Kind regards Uffe > --- > drivers/mmc/host/sdhci-tegra.c | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > > diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c > index 28b98e2..ddf00166 100644 > --- a/drivers/mmc/host/sdhci-tegra.c > +++ b/drivers/mmc/host/sdhci-tegra.c > @@ -235,6 +235,13 @@ static void tegra_sdhci_set_uhs_signaling(struct sdhci_host *host, > sdhci_set_uhs_signaling(host, timing); > } > > +static unsigned int tegra_sdhci_get_max_clock(struct sdhci_host *host) > +{ > + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); > + > + return clk_round_rate(pltfm_host->clk, UINT_MAX); > +} > + > static void tegra_sdhci_set_tap(struct sdhci_host *host, unsigned int tap) > { > u32 reg; > @@ -299,7 +306,7 @@ static const struct sdhci_ops tegra_sdhci_ops = { > .platform_execute_tuning = tegra_sdhci_execute_tuning, > .set_uhs_signaling = tegra_sdhci_set_uhs_signaling, > .voltage_switch = tegra_sdhci_voltage_switch, > - .get_max_clock = sdhci_pltfm_clk_get_max_clock, > + .get_max_clock = tegra_sdhci_get_max_clock, > }; > > static const struct sdhci_pltfm_data sdhci_tegra20_pdata = { > @@ -356,7 +363,7 @@ static const struct sdhci_ops tegra114_sdhci_ops = { > .platform_execute_tuning = tegra_sdhci_execute_tuning, > .set_uhs_signaling = tegra_sdhci_set_uhs_signaling, > .voltage_switch = tegra_sdhci_voltage_switch, > - .get_max_clock = sdhci_pltfm_clk_get_max_clock, > + .get_max_clock = tegra_sdhci_get_max_clock, > }; > > static const struct sdhci_pltfm_data sdhci_tegra114_pdata = { > -- > 2.7.4 >