Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1112035imm; Wed, 1 Aug 2018 10:22:29 -0700 (PDT) X-Google-Smtp-Source: AAOMgpciWgGh48+JiNf5TMnjtlagP4Z3aCylp1GGnF37SZxDwfQPnWa7OIr3UuoPcoDf41rWysQ/ X-Received: by 2002:a63:27c1:: with SMTP id n184-v6mr24633158pgn.29.1533144148978; Wed, 01 Aug 2018 10:22:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533144148; cv=none; d=google.com; s=arc-20160816; b=veM6dMnrtgIGUMtZMioqvKC4QBmbyaFb1wl+TN0xMoJB+Wav/ex2Xq5kF2sxnhgG4c mFifUGNUf/O01RERjRVId1zQ+R5labc/z/UF9bAzjDFI17uFxyW3CF+YXQoU1DP7g8wK dPzpt9T7lH65w0u4dv8hJrEf5HF1R7kFXPN7yVEFj7x+SV1E3n8O20Ckpx3ARPDKOTbu mBlAfLJEUMHRezvwVLz9r+ITDw0wqcwEUNjQFLBfwH0F0zmInu5d9NWY03C38MHxDDCU M84/6IXQFMhWB8/SBgCkVCUfY0FL0Oxg6NHSN5HfjBMqG/4PHRZqeBH/hUCCRgh0gqAc qJ2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Ll0JSSbBBgmgTuHjQNC/h5w5plkfZKpwbITda/Xv78E=; b=W99D97Sv2JgxCcG9ClwAxDuAONBLuqwJD8CEwraD5UPJFvDomuSevQjO2LHqvELmNx RfBRqXYuOhoPFl+pdLcv7qZmPvJRb9xtGHmz7AgJO7OhpPtqYsTlUIMpMfAhd5ZzN4Gv AUmcY+omhjYrLKlqLmu5dHBCxKcIR8HWirwWSh2VXYuw1gbTb6zMgcyRMXmDFLbExr7a 8Y/1lEpzLclTWBl/s0QBZhCeixpOQcwuB7MDmWAvAGYEFO2r2LJr1nkyUWBdNMIPrGGK 16MCuajaMPAf0CKYH1ukuZHGFDu8m4MXM9vmrOfqcE1Yvk7NTxM09b/PC035HaZLbaur dTaw== ARC-Authentication-Results: i=1; mx.google.com; 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 s64-v6si17686288pfg.175.2018.08.01.10.22.14; Wed, 01 Aug 2018 10:22:28 -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; 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 S2405405AbeHATHI (ORCPT + 99 others); Wed, 1 Aug 2018 15:07:08 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:49124 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405393AbeHATHI (ORCPT ); Wed, 1 Aug 2018 15:07:08 -0400 Received: from localhost (D57E6652.static.ziggozakelijk.nl [213.126.102.82]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 8B55DD1F; Wed, 1 Aug 2018 17:20:26 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xiao Yao , Ziyuan , Shawn Lin , Ulf Hansson , Sasha Levin Subject: [PATCH 4.14 173/246] mmc: dw_mmc: update actual clock for mmc debugfs Date: Wed, 1 Aug 2018 18:51:23 +0200 Message-Id: <20180801165020.005181640@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180801165011.700991984@linuxfoundation.org> References: <20180801165011.700991984@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 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 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Shawn Lin [ 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 Cc: Ziyuan Signed-off-by: Shawn Lin Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- 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 @@ -1255,6 +1255,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); @@ -1313,6 +1315,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;