[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180801164957.294239168@linuxfoundation.org>
Date: Wed, 1 Aug 2018 18:52:18 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Xiao Yao <xiaoyao@...k-chips.com>,
Ziyuan <xzy.xu@...k-chips.com>,
Shawn Lin <shawn.lin@...k-chips.com>,
Ulf Hansson <ulf.hansson@...aro.org>,
Sasha Levin <alexander.levin@...rosoft.com>
Subject: [PATCH 4.9 111/144] mmc: dw_mmc: update actual clock for mmc debugfs
4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shawn Lin <shawn.lin@...k-chips.com>
[ Upstream commit ff178981bd5fd1667f373098740cb1c6d6efa1ba ]
Respect the actual clock for mmc debugfs to help better debug
the hardware.
mmc_host mmc0: Bus speed (slot 0) = 135475200Hz (slot req 150000000Hz,
actual 135475200HZ div = 0)
cat /sys/kernel/debug/mmc0/ios
clock: 150000000 Hz
actual clock: 135475200 Hz
vdd: 21 (3.3 ~ 3.4 V)
bus mode: 2 (push-pull)
chip select: 0 (don't care)
power mode: 2 (on)
bus width: 3 (8 bits)
timing spec: 9 (mmc HS200)
signal voltage: 0 (1.80 V)
driver type: 0 (driver type B)
Cc: Xiao Yao <xiaoyao@...k-chips.com>
Cc: Ziyuan <xzy.xu@...k-chips.com>
Signed-off-by: Shawn Lin <shawn.lin@...k-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@...aro.org>
Signed-off-by: Sasha Levin <alexander.levin@...rosoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/mmc/host/dw_mmc.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -1164,6 +1164,8 @@ static void dw_mci_setup_bus(struct dw_m
if (host->state == STATE_WAITING_CMD11_DONE)
sdmmc_cmd_bits |= SDMMC_CMD_VOLT_SWITCH;
+ slot->mmc->actual_clock = 0;
+
if (!clock) {
mci_writel(host, CLKENA, 0);
mci_send_cmd(slot, sdmmc_cmd_bits, 0);
@@ -1209,6 +1211,8 @@ static void dw_mci_setup_bus(struct dw_m
/* keep the last clock value that was requested from core */
slot->__clk_old = clock;
+ slot->mmc->actual_clock = div ? ((host->bus_hz / div) >> 1) :
+ host->bus_hz;
}
host->current_speed = clock;
Powered by blists - more mailing lists