Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6022720ybc; Wed, 27 Nov 2019 13:34:02 -0800 (PST) X-Google-Smtp-Source: APXvYqweNHLYhAlhy8ZNhIUjFRybRNfTuhjISGWcrHt/+CPziQvVcBNX2V3wSONEZgYs+aPECFkG X-Received: by 2002:a17:906:2296:: with SMTP id p22mr10666545eja.269.1574890442570; Wed, 27 Nov 2019 13:34:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574890442; cv=none; d=google.com; s=arc-20160816; b=lUbiQDQ00zkAqFGBmczX3y4kW5S+TksAB0g4G+F7LriT1tYPgZnf/hYNO/L1xL0go5 hqeTr6jgEBNls5PJ798Xr/WXj2el+6nps1j+hmvmK/bQK3uWy1bc0lp+mhtW1kuRKq17 K/hEmrnsttzFEn8/j6tYgAZYHKQgTNAVK3XX3Mz/z7Q4O49xPnS0kMl/ws0FLpLoVVAL OdCCq84LFGzcz9hhgLK/lP4vNCvp5Zbb9qMVYG+ScETr6GpJYEqEsuRkSY7MtgXq7DTi 03LypeT2Ss7/Zrqs1vfVI0CAXicDF1zsaeuSxEFNLavuaCc55MBc1eMyEFKCSCyO59hB tK2g== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=cTr3D5mNReBsTQkyyQaFjr/LBmZDOJuToRVo5WcvCzA=; b=W/Pj0xfsOHvXV6iEFAT8Zsz1lpa/dfS+KfIhEYXIyVPvjlBRbnVBRtKfAKOsAggs2/ 01vdf5N5MVKYjQwLnEDGmVpKeR+Q0p1X+U2f2H5FiB50aSBAYn23BA9f1TpLMTQ+KTg4 eMgRxIaMDsqKbAiWh6s7wgNRK2fAWTtyqaRFPy6G2/fnIR0ZoV2DnDKE1EzRtzijhE6V F5BhRA57dvHdMVsUtywp8psDopn/Cop3VFqdAcrZSa6YQtxzdmQ90TpLy2wMep8IIqNG ZuGwPSOIznpIgcbsyAH8Ly/0sfATRn6PLFjpPb5o8JAAKDrH/Uu6fqqbUKxzeeSxGe8j VQ0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zVTQk8Td; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h1si10827912edn.404.2019.11.27.13.33.39; Wed, 27 Nov 2019 13:34:02 -0800 (PST) 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=@kernel.org header.s=default header.b=zVTQk8Td; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731115AbfK0U4y (ORCPT + 99 others); Wed, 27 Nov 2019 15:56:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:47738 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730167AbfK0U4w (ORCPT ); Wed, 27 Nov 2019 15:56:52 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 77EA02154A; Wed, 27 Nov 2019 20:56:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888211; bh=STG2Hmg0LoPyc4kntgruZckgQ/wfT/uWDxEsXM8w6mI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zVTQk8TdnZXI0gvOCbPQChzW8tLrPbT2xHQfMrc2A5BLMIvwKS2o+xkzgihLRITLJ G/dIbKj6k5tULBhAOYTc51Ef7pkcZ9+1HG82M4uF42qe+DVmj3eroQCFJFeTBoymA/ rgIliEDsfo1BGSj1EnHt9FOsD9n8wzu2yZUCPRdY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chaotian Jing , Ulf Hansson , Sasha Levin Subject: [PATCH 4.19 045/306] mmc: mediatek: fill the actual clock for mmc debugfs Date: Wed, 27 Nov 2019 21:28:15 +0100 Message-Id: <20191127203118.112603618@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chaotian Jing [ Upstream commit 56f6cbbed0463f1c78d602b17c315916cc1cd238 ] as the mmc core layer has the mmc->actual_clock, so fill it and drop msdc_host->sclk. Signed-off-by: Chaotian Jing Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- drivers/mmc/host/mtk-sd.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c index f171cce5197de..621c914dc5c01 100644 --- a/drivers/mmc/host/mtk-sd.c +++ b/drivers/mmc/host/mtk-sd.c @@ -390,7 +390,6 @@ struct msdc_host { struct clk *src_clk_cg; /* msdc source clock control gate */ u32 mclk; /* mmc subsystem clock frequency */ u32 src_clk_freq; /* source clock frequency */ - u32 sclk; /* SD/MS bus clock frequency */ unsigned char timing; bool vqmmc_enabled; u32 latch_ck; @@ -635,10 +634,10 @@ static void msdc_set_timeout(struct msdc_host *host, u32 ns, u32 clks) host->timeout_ns = ns; host->timeout_clks = clks; - if (host->sclk == 0) { + if (host->mmc->actual_clock == 0) { timeout = 0; } else { - clk_ns = 1000000000UL / host->sclk; + clk_ns = 1000000000UL / host->mmc->actual_clock; timeout = (ns + clk_ns - 1) / clk_ns + clks; /* in 1048576 sclk cycle unit */ timeout = (timeout + (0x1 << 20) - 1) >> 20; @@ -683,6 +682,7 @@ static void msdc_set_mclk(struct msdc_host *host, unsigned char timing, u32 hz) if (!hz) { dev_dbg(host->dev, "set mclk to 0\n"); host->mclk = 0; + host->mmc->actual_clock = 0; sdr_clr_bits(host->base + MSDC_CFG, MSDC_CFG_CKPDN); return; } @@ -761,7 +761,7 @@ static void msdc_set_mclk(struct msdc_host *host, unsigned char timing, u32 hz) while (!(readl(host->base + MSDC_CFG) & MSDC_CFG_CKSTB)) cpu_relax(); sdr_set_bits(host->base + MSDC_CFG, MSDC_CFG_CKPDN); - host->sclk = sclk; + host->mmc->actual_clock = sclk; host->mclk = hz; host->timing = timing; /* need because clk changed. */ @@ -772,7 +772,7 @@ static void msdc_set_mclk(struct msdc_host *host, unsigned char timing, u32 hz) * mmc_select_hs400() will drop to 50Mhz and High speed mode, * tune result of hs200/200Mhz is not suitable for 50Mhz */ - if (host->sclk <= 52000000) { + if (host->mmc->actual_clock <= 52000000) { writel(host->def_tune_para.iocon, host->base + MSDC_IOCON); writel(host->def_tune_para.pad_tune, host->base + tune_reg); } else { @@ -787,7 +787,8 @@ static void msdc_set_mclk(struct msdc_host *host, unsigned char timing, u32 hz) sdr_set_field(host->base + tune_reg, MSDC_PAD_TUNE_CMDRRDLY, host->hs400_cmd_int_delay); - dev_dbg(host->dev, "sclk: %d, timing: %d\n", host->sclk, timing); + dev_dbg(host->dev, "sclk: %d, timing: %d\n", host->mmc->actual_clock, + timing); } static inline u32 msdc_cmd_find_resp(struct msdc_host *host, -- 2.20.1