From patchwork Mon Feb 27 08:29:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Lin X-Patchwork-Id: 9592831 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F16E260574 for ; Mon, 27 Feb 2017 08:34:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E561728433 for ; Mon, 27 Feb 2017 08:34:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DA1E82843E; Mon, 27 Feb 2017 08:34:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 649032843F for ; Mon, 27 Feb 2017 08:34:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751813AbdB0IeO (ORCPT ); Mon, 27 Feb 2017 03:34:14 -0500 Received: from lucky1.263xmail.com ([211.157.147.132]:52151 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751807AbdB0IeM (ORCPT ); Mon, 27 Feb 2017 03:34:12 -0500 Received: from shawn.lin?rock-chips.com (unknown [192.168.167.129]) by lucky1.263xmail.com (Postfix) with ESMTP id 5FFC864356; Mon, 27 Feb 2017 16:34:07 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 1 X-MAIL-DELIVERY: 0 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTP id 7B4AA3AF; Mon, 27 Feb 2017 16:34:07 +0800 (CST) X-RL-SENDER: shawn.lin@rock-chips.com X-FST-TO: ulf.hansson@linaro.org X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: shawn.lin@rock-chips.com X-UNIQUE-TAG: <233ad5ff60284d0460e86efc6e138fd0> X-ATTACHMENT-NUM: 0 X-SENDER: lintao@rock-chips.com X-DNS-TYPE: 0 Received: from unknown (unknown [58.22.7.114]) by smtp.263.net (Postfix) whith SMTP id 30859PFJEHE; Mon, 27 Feb 2017 16:34:08 +0800 (CST) From: Shawn Lin To: Ulf Hansson , Adrian Hunter Cc: linux-mmc@vger.kernel.org, Anssi Hannula , Masahiro Yamada , Shawn Lin Subject: [RFC PATCH v2 4/4] mmc: sdhci-cadence: fix the return value of sdhci_cdns_get_timeout_clock Date: Mon, 27 Feb 2017 16:29:04 +0800 Message-Id: <1488184144-122285-5-git-send-email-shawn.lin@rock-chips.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1488184144-122285-1-git-send-email-shawn.lin@rock-chips.com> References: <1488184144-122285-1-git-send-email-shawn.lin@rock-chips.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Return the timeout clock rate in Hz for sdhci core. Signed-off-by: Shawn Lin --- Changes in v2: None drivers/mmc/host/sdhci-cadence.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/sdhci-cadence.c b/drivers/mmc/host/sdhci-cadence.c index 316cfec..bb3951a 100644 --- a/drivers/mmc/host/sdhci-cadence.c +++ b/drivers/mmc/host/sdhci-cadence.c @@ -103,9 +103,10 @@ static unsigned int sdhci_cdns_get_timeout_clock(struct sdhci_host *host) { /* * Cadence's spec says the Timeout Clock Frequency is the same as the - * Base Clock Frequency. Divide it by 1000 to return a value in kHz. + * Base Clock Frequency. Return a value in Hz per the requirement of + * .get_timeout_clock callback. */ - return host->max_clk / 1000; + return DIV_ROUND_UP(DIV_ROUND_UP(host->max_clk, 1000), 1000); } static void sdhci_cdns_set_uhs_signaling(struct sdhci_host *host,