From: Marcel Ziswiler <marcel.ziswiler@toradex.com>
To: "ulf.hansson@linaro.org" <ulf.hansson@linaro.org>,
"avienamo@nvidia.com" <avienamo@nvidia.com>,
"jonathanh@nvidia.com" <jonathanh@nvidia.com>,
"thierry.reding@gmail.com" <thierry.reding@gmail.com>,
"adrian.hunter@intel.com" <adrian.hunter@intel.com>
Cc: "linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
Stefan Agner <stefan.agner@toradex.com>
Subject: Re: [PATCH] mmc: tegra: Add and use tegra_sdhci_get_max_clock()
Date: Fri, 13 Jul 2018 15:42:36 +0000 [thread overview]
Message-ID: <1531496554.5479.37.camel@toradex.com> (raw)
In-Reply-To: <1531487865-17427-1-git-send-email-avienamo@nvidia.com>
On Fri, 2018-07-13 at 16:17 +0300, Aapo Vienamo wrote:
> Implement and use tegra_sdhci_get_max_clock() which returns the true
> maximum host clock rate. The issue with tegra_sdhci_get_max_clock()
> is
> that it returns the current clock rate of the host instead of the
> maximum one, which can lead to unnecessarily small clock rates.
>
> This differs from the previous implementation of
> tegra_sdhci_get_max_clock() in that it doesn't divide the result by
> two.
>
> Signed-off-by: Aapo Vienamo <avienamo@nvidia.com>
The whole series stress-tested on various Apalis T30 as well as Colibri
T30 modules:
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
> ---
> drivers/mmc/host/sdhci-tegra.c | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-
> tegra.c
> index 28b98e2..ddf00166 100644
> --- a/drivers/mmc/host/sdhci-tegra.c
> +++ b/drivers/mmc/host/sdhci-tegra.c
> @@ -235,6 +235,13 @@ static void tegra_sdhci_set_uhs_signaling(struct
> sdhci_host *host,
> sdhci_set_uhs_signaling(host, timing);
> }
>
> +static unsigned int tegra_sdhci_get_max_clock(struct sdhci_host
> *host)
> +{
> + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
> +
> + return clk_round_rate(pltfm_host->clk, UINT_MAX);
> +}
> +
> static void tegra_sdhci_set_tap(struct sdhci_host *host, unsigned
> int tap)
> {
> u32 reg;
> @@ -299,7 +306,7 @@ static const struct sdhci_ops tegra_sdhci_ops = {
> .platform_execute_tuning = tegra_sdhci_execute_tuning,
> .set_uhs_signaling = tegra_sdhci_set_uhs_signaling,
> .voltage_switch = tegra_sdhci_voltage_switch,
> - .get_max_clock = sdhci_pltfm_clk_get_max_clock,
> + .get_max_clock = tegra_sdhci_get_max_clock,
> };
>
> static const struct sdhci_pltfm_data sdhci_tegra20_pdata = {
> @@ -356,7 +363,7 @@ static const struct sdhci_ops tegra114_sdhci_ops
> = {
> .platform_execute_tuning = tegra_sdhci_execute_tuning,
> .set_uhs_signaling = tegra_sdhci_set_uhs_signaling,
> .voltage_switch = tegra_sdhci_voltage_switch,
> - .get_max_clock = sdhci_pltfm_clk_get_max_clock,
> + .get_max_clock = tegra_sdhci_get_max_clock,
> };
>
> static const struct sdhci_pltfm_data sdhci_tegra114_pdata = {
Works quite nicely on today's next together with Stefan's patch set [1]:
root@apalis-t30:~# cat /sys/kernel/debug/mmc1/ios
clock: 52000000 Hz
actual clock: 51000000 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: 8 (mmc DDR52)
signal voltage: 1 (1.80 V)
driver type: 0 (driver type B)
root@apalis-t30:~# hdparm -t /dev/mmcblk1
/dev/mmcblk1:
Timing buffered disk reads: 236 MB in 3.01 seconds = 78.42 MB/sec
root@colibri-t30:~# cat /sys/kernel/debug/mmc0/ios
clock: 52000000 Hz
actual clock: 51000000 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: 8 (mmc DDR52)
signal voltage: 1 (1.80 V)
driver type: 0 (driver type B)
root@colibri-t30:~# hdparm -t /dev/mmcblk0
/dev/mmcblk0:
Timing buffered disk reads: 168 MB in 3.00 seconds = 55.99 MB/sec
[1] https://lore.kernel.org/lkml/20180712073904.4705-1-stefan@agner.ch
next prev parent reply other threads:[~2018-07-13 15:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-13 13:17 [PATCH] mmc: tegra: Add and use tegra_sdhci_get_max_clock() Aapo Vienamo
2018-07-13 13:17 ` Aapo Vienamo
2018-07-13 14:01 ` Jon Hunter
2018-07-13 14:01 ` Jon Hunter
2018-07-13 15:39 ` Aapo Vienamo
2018-07-13 15:39 ` Aapo Vienamo
2018-07-16 19:47 ` Jon Hunter
2018-07-16 19:47 ` Jon Hunter
2018-07-13 15:42 ` Marcel Ziswiler [this message]
2018-07-16 10:11 ` Ulf Hansson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1531496554.5479.37.camel@toradex.com \
--to=marcel.ziswiler@toradex.com \
--cc=adrian.hunter@intel.com \
--cc=avienamo@nvidia.com \
--cc=jonathanh@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=stefan.agner@toradex.com \
--cc=thierry.reding@gmail.com \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.