Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2115694ybe; Tue, 3 Sep 2019 08:12:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqwQMcYB+Tl08DMTWHwP24xjUjjN3P2TYu92IkD12xsMChvj9Z+eNfF7ngjSIW0+6W2EpUle X-Received: by 2002:a17:902:bf47:: with SMTP id u7mr16994349pls.77.1567523542381; Tue, 03 Sep 2019 08:12:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567523542; cv=none; d=google.com; s=arc-20160816; b=gTv/zkJ210b1siom17cYwZNVjDQvwrw5TnNhFTHembuVE1IlhSgdqu8swwu0P89uwO bVFXmOWUAhwVZH1G7H1z+09RAMQvKy3hDcsxJV10Ecv/QQhCL5nEwK7QT426iVuegnrh WY06ktli0woGWvRKABaTBPqlVFQxm2Iewwg0XHkKzS9XyQDEAwGs4OCxz2Rp+q22KQUj dbo4iG39GlBKVGQUxknWPY6q+Oz1s/d9Sw/JBdNKzmLR/c7Ha4esah26J3AbiOItOaP/ HTJvg6caj+m0nCXadKC6EWnsF2nMrTvWTNGXy13rqgm/9quNCLk9f+Kjo4rkVCj7bBN6 Is9g== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=D3e9W2yeYksy0f4fuNlRYAPcfLR8aSNbO/EU86R0hP4=; b=aqrj2GlHOPfK/WNjb+FSKUn9H+VG3BV1vNrK5huJvWr5ETZ63FJnsgfYybo7IoxAtJ 5woN0szsPZPeBtv/76EBtFAx4fjhC/9dRDNaCBRc43Yyk6+BKMQjYk3oUck/z4hdStn4 ETnTatoQ9Sbe64ktAUtohOT7eyCemUBZw6XV6y9i+WPlwv+LBiOi+HJK+yh9Q96WqCxe BA5PPlY8jPeLTMENeXRF+BsHhA3ZB+MRwGZNBHJbU7ZIppKJrc+DcQzbVHOMup7RERPX gl+5qMnXNYTv7ULCzHKjbrNaSRw1hrmr6ezAWttl2Y0S7VfBzXWQb1prAIuW/f5oMufm Rung== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WO3yaL50; 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 r33si15047062plb.421.2019.09.03.08.12.04; Tue, 03 Sep 2019 08:12:22 -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=WO3yaL50; 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 S1729577AbfICPLN (ORCPT + 99 others); Tue, 3 Sep 2019 11:11:13 -0400 Received: from mail-ua1-f65.google.com ([209.85.222.65]:36129 "EHLO mail-ua1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729079AbfICPLM (ORCPT ); Tue, 3 Sep 2019 11:11:12 -0400 Received: by mail-ua1-f65.google.com with SMTP id n6so2201100uaq.3 for ; Tue, 03 Sep 2019 08:11:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=D3e9W2yeYksy0f4fuNlRYAPcfLR8aSNbO/EU86R0hP4=; b=WO3yaL50caVRPNVVzECDC1KIYPSQoV/F/kmIrCspE7EpXM29WGxFHYDjMLBRTOcwWR /HDfH528vagRQJqA41CrJe3/GSu3MzBR4zrmCXJuNTzcH2jeXniIEpG7NXknajc8mHUt ak1CtU1+Fqfjmjp62RHNsgmkgWDWurtv+l/UlKP4e0RJEMtJQ9fs6DK1uPhx/D7ckQlD X15jTqnfvUwMdE6veV6PXWW+SujPbHo+BXVLG2O7bauSrqc2eEHpFDDATBRRkRWYUcha 0w5iGr3k/BvfuScoE2q1GJaNcz97lo3GkFZZZHAams/1Nwwh7UWCl1t+XttNuoE09jJW Ea+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=D3e9W2yeYksy0f4fuNlRYAPcfLR8aSNbO/EU86R0hP4=; b=gT5jpQYdnqaRpd+VUudCFgqZIYg3PHjyHWVoadUv68HXpsr9gvmzrKOWaxzLKRb1t9 PFui/Y8sMKb8hLu686wipy7t4X9t8AkciWZkic71WUN5WMUNTXIzLuet7Lrie76MTagu 70pVtsLV8KYGENNk2uVx5QdTIptB3OS1bqzRswU7YTFk2YKvvY95ZdBwSW8CuHwEg1UB CcAih+q9T2Xxqxk3Wk9HyM6a4RSHJOxzmD5uErGXr8r+pNfG5o0IHVW3S4lzFc+nyKUc r9PVwXJFvS2uC79c/CRUT91YvqZg+rfN2orgC1qeLcwmMEq4trrLBU8rHkv3tMDy//lP BfBA== X-Gm-Message-State: APjAAAVyVTvJhfht0pfYdxeKuHZAVgTaGqZczWUchucBw1vFKbdaGapE bbuQ5TwCrdawYRetYxXQJisf5WdyE9BOdpSj8d+5sMmY X-Received: by 2002:ab0:6883:: with SMTP id t3mr17513945uar.104.1567523471452; Tue, 03 Sep 2019 08:11:11 -0700 (PDT) MIME-Version: 1.0 References: <20190829183634.3376-1-tszucs@protonmail.ch> In-Reply-To: <20190829183634.3376-1-tszucs@protonmail.ch> From: Ulf Hansson Date: Tue, 3 Sep 2019 17:10:35 +0200 Message-ID: Subject: Re: [PATCH v2] mmc: sdhi: fill in actual_clock To: =?UTF-8?B?VGFtw6FzIFN6xbFjcw==?= Cc: Wolfram Sang , "linux-mmc@vger.kernel.org" , Linux Kernel Mailing List , Linux-Renesas Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 29 Aug 2019 at 20:36, Tam=C3=A1s Sz=C5=B1cs = wrote: > > Save set clock in mmc_host actual_clock enabling exporting it via debugfs= . > This will indicate the precise SD clock in I/O settings rather than only = the > sometimes misleading requested clock. > > Signed-off-by: Tam=C3=A1s Sz=C5=B1cs Applied for next, thanks! Kind regards Uffe > --- > drivers/mmc/host/renesas_sdhi_core.c | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) > > diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/rene= sas_sdhi_core.c > index 64d3b5fb7fe5..4c9774dbcfc1 100644 > --- a/drivers/mmc/host/renesas_sdhi_core.c > +++ b/drivers/mmc/host/renesas_sdhi_core.c > @@ -124,7 +124,7 @@ static unsigned int renesas_sdhi_clk_update(struct tm= io_mmc_host *host, > { > struct renesas_sdhi *priv =3D host_to_priv(host); > unsigned int freq, diff, best_freq =3D 0, diff_min =3D ~0; > - int i, ret; > + int i; > > /* tested only on R-Car Gen2+ currently; may work for others */ > if (!(host->pdata->flags & TMIO_MMC_MIN_RCAR2)) > @@ -153,9 +153,9 @@ static unsigned int renesas_sdhi_clk_update(struct tm= io_mmc_host *host, > } > } > > - ret =3D clk_set_rate(priv->clk, best_freq); > + clk_set_rate(priv->clk, best_freq); > > - return ret =3D=3D 0 ? best_freq : clk_get_rate(priv->clk); > + return clk_get_rate(priv->clk); > } > > static void renesas_sdhi_set_clock(struct tmio_mmc_host *host, > @@ -166,10 +166,13 @@ static void renesas_sdhi_set_clock(struct tmio_mmc_= host *host, > sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, ~CLK_CTL_SCLKEN & > sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL)); > > - if (new_clock =3D=3D 0) > + if (new_clock =3D=3D 0) { > + host->mmc->actual_clock =3D 0; > goto out; > + } > > - clock =3D renesas_sdhi_clk_update(host, new_clock) / 512; > + host->mmc->actual_clock =3D renesas_sdhi_clk_update(host, new_clo= ck); > + clock =3D host->mmc->actual_clock / 512; > > for (clk =3D 0x80000080; new_clock >=3D (clock << 1); clk >>=3D 1= ) > clock <<=3D 1; > -- > 2.11.0 >