Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3824631imm; Mon, 2 Jul 2018 06:18:02 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf3qHZXWq1ese2rVL7xPueUrzDR5tMmpMYO90kwrNMzt8GWDvYtsAg20VuWBdEjxvZFuYuQ X-Received: by 2002:a65:618c:: with SMTP id c12-v6mr19632905pgv.411.1530537482270; Mon, 02 Jul 2018 06:18:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530537482; cv=none; d=google.com; s=arc-20160816; b=MiGktsiQ8ILklEd5p95W6MLCbyUdiZfmpHHwbwbHRLGINVrr3guEF/r4VfW5iA4Upb j7Wkdr8Bn/04WZitq9SSnf8sFwq84QkGLVMKVjC1HuKUFi6s53aCKGgxK3F/3da9BbeZ 7rbEM5IVPcEpJl1PGAAM7ePhKrBV94MpMZni68yA0hSqEFmWX82hbDCsE+NPxyMeRKG4 TAXc0UbiHCteYm0pZpw+SIf3XDOEIBi0ERMh7NGwB2QZBlzWMGizXolmxPn20aYmBUUA A24hEqdM3XDN2SVTVqK90gTzziPxhMmo5cNAopx46IYqXqb8RR/9NUxhKbjbekWvBSSf ZMNg== 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=i9zvTE/M67n0LKq3HRoArel2yfH6MG4OrLu8ZPNqwy8=; b=qGQqJ31r41Jfkh/lxkHalSGGSdWkiGXMEL0kbvPYXolI0ivZD7GXBeP0tyRdvXcn2n rphBuCgp5in76OpdryVEwdcrjSf5mDjwyEiBdxroBRQ6o2o99EHCLueqiC/b+7N7k/UG jxlc3L6Y5Yb5J3MN52mv/9TalDVL+R+C+jpLP7CYPz2VKYSknH7xSjw/abfInMwc/NNS OIsNy1jbDJIYronlGPyuMc5THl5KpPyomaEhbLZJ/sBwXCg+I2gOxOu7G+NNKWBGOy3F Pi1E9fxzKI6wHn/q0dxw2K8dyq8No4lf0YkXuapB+aAOpjPu/s170l+eNSdauPupFVq7 lBdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KFPGhTnt; 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 t17-v6si16500439pfa.170.2018.07.02.06.17.47; Mon, 02 Jul 2018 06:18:02 -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=KFPGhTnt; 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 S1752552AbeGBNRB (ORCPT + 99 others); Mon, 2 Jul 2018 09:17:01 -0400 Received: from mail-it0-f66.google.com ([209.85.214.66]:35140 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752396AbeGBNQy (ORCPT ); Mon, 2 Jul 2018 09:16:54 -0400 Received: by mail-it0-f66.google.com with SMTP id l16-v6so11958245ita.0 for ; Mon, 02 Jul 2018 06:16:54 -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=i9zvTE/M67n0LKq3HRoArel2yfH6MG4OrLu8ZPNqwy8=; b=KFPGhTntFWIP4Zf6BqmCidMMR9Jyz1Dm1/jbszsgOCq5c9844Mpk0i6RxP+PXKff96 DW8T2xzaEbDwuExyDa0XZjCROPVt4g8vrjdS+9OlbARgTZ/3OUhn7AqIbgCUoYDpi7XR Ztn4qlpQsTpxcgOoJSh+3t/D3gdxQM7RLjSwc= 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=i9zvTE/M67n0LKq3HRoArel2yfH6MG4OrLu8ZPNqwy8=; b=Gu48L3P7dgN+rry9SBEBYWkPIVoMWR/pcYcrNhddp+bILKQ6yhSjFSOOhsPDqlNMtf lWLYpU02z6EyIuLJ9Ryo0NeoSJlhIRfeOtnYH3cD7LaE6ALftdgx8jiZmk/cXEfvLWYl rGcl3ME0NAQiyAZKNvhNBGQNFgAaR2DWuJfbhvOYudDHuYBsY2hRmjgMJx5Xc8uEvcOr yHWGk/ddnNLQO+8N7Afw0jp0uvJ3Mj8MINOjtspk9tnIFymm5sLsyyHM4oXrZUFTWr8Q M5XIa2UHVfvfdN1o0BLF6KLpimNtUJWANmnJkbULrUrnp+Zq29l8vkFWmcrCL8UkTxhj 9kRg== X-Gm-Message-State: APt69E2YNKi+Q7EQvpP7jAHxJOFS46uberSl+5mz855gV1eggWQ5k9Pm zv73ZHslNORkT9aaKzR0hTwS2l/WuOTEHzuu1dbr3g== X-Received: by 2002:a24:d00b:: with SMTP id m11-v6mr6095818itg.97.1530537413609; Mon, 02 Jul 2018 06:16:53 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:818f:0:0:0:0:0 with HTTP; Mon, 2 Jul 2018 06:16:52 -0700 (PDT) In-Reply-To: <1528126540-27004-1-git-send-email-avienamo@nvidia.com> References: <1528126540-27004-1-git-send-email-avienamo@nvidia.com> From: Ulf Hansson Date: Mon, 2 Jul 2018 15:16:52 +0200 Message-ID: Subject: Re: [PATCH] mmc: tegra: Use sdhci_pltfm_clk_get_max_clock 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 4 June 2018 at 17:35, Aapo Vienamo wrote: > The sdhci get_max_clock callback is set to sdhci_pltfm_clk_get_max_clock > and tegra_sdhci_get_max_clock is removed. It appears that the > shdci-tegra specific callback was originally introduced due to the > requirement that the host clock has to be twice the bus clock on DDR50 > mode. As far as I can tell the only effect the removal has on DDR50 mode > is in cases where the parent clock is unable to supply the requested > clock rate, causing the DDR50 mode to run at a lower frequency. > Currently the DDR50 mode isn't enabled on any of the SoCs and would also > require configuring the SDHCI clock divider register to function > properly. > > The problem with tegra_sdhci_get_max_clock is that it divides the clock > rate by two and thus artificially limits the maximum frequency of faster > signaling modes which don't have the host-bus frequency ratio requirement > of DDR50 such as SDR104 and HS200. Furthermore, the call to > clk_round_rate() may return an error which isn't handled by > tegra_sdhci_get_max_clock. > > Signed-off-by: Aapo Vienamo Thanks, applied for next! Kind regards Uffe > --- > drivers/mmc/host/sdhci-tegra.c | 15 ++------------- > 1 file changed, 2 insertions(+), 13 deletions(-) > > diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c > index 970d38f6..c8745b5 100644 > --- a/drivers/mmc/host/sdhci-tegra.c > +++ b/drivers/mmc/host/sdhci-tegra.c > @@ -234,17 +234,6 @@ 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); > - > - /* > - * DDR modes require the host to run at double the card frequency, so > - * the maximum rate we can support is half of the module input clock. > - */ > - return clk_round_rate(pltfm_host->clk, UINT_MAX) / 2; > -} > - > static void tegra_sdhci_set_tap(struct sdhci_host *host, unsigned int tap) > { > u32 reg; > @@ -309,7 +298,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 = tegra_sdhci_get_max_clock, > + .get_max_clock = sdhci_pltfm_clk_get_max_clock, > }; > > static const struct sdhci_pltfm_data sdhci_tegra20_pdata = { > @@ -357,7 +346,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 = tegra_sdhci_get_max_clock, > + .get_max_clock = sdhci_pltfm_clk_get_max_clock, > }; > > static const struct sdhci_pltfm_data sdhci_tegra114_pdata = { > -- > 2.7.4 >