linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Hutchings <ben.hutchings@codethink.co.uk>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Wolfram Sang <wsa@the-dreams.de>,
	Linux MMC List <linux-mmc@vger.kernel.org>,
	linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH v2 2/9] mmc: tmio, sh_mobile_sdhi: Add support for variable input clock frequency
Date: Tue, 12 Apr 2016 17:19:38 +0100	[thread overview]
Message-ID: <1460477978.32355.14.camel@codethink.co.uk> (raw)
In-Reply-To: <CAMuHMdWdJ2AoCrwC5K2QEfuf=w=q8=XnJRzoyg99EurJBDwbTg@mail.gmail.com>

On Tue, 2016-04-12 at 14:55 +0200, Geert Uytterhoeven wrote:
> On Fri, Apr 1, 2016 at 5:44 PM, Wolfram Sang <wsa@the-dreams.de> wrote:
> > From: Ben Hutchings <ben.hutchings@codethink.co.uk>
> >
> > Currently tmio_mmc assumes that the input clock frequency is fixed and
> > only its own clock divider can be changed.  This is not true in the
> > case of sh_mobile_sdhi; we can use the clock API to change it.
> >
> > In tmio_mmc:
> > - Delegate setting of f_min from tmio to the clk_enable operation (if
> >   implemented), as it can be smaller than f_max / 512
> > - Add an optional clk_update operation called from tmio_mmc_set_clock()
> >   that updates the input clock frequency
> > - Rename tmio_mmc_clk_update() to tmio_mmc_clk_enable(), to avoid
> >   confusion with the clk_update operation
> >
> > In sh_mobile_sdhi:
> > - Make the setting of f_max conditional; it should be set through the
> >   max-frequency property in the device tree in future
> > - Set f_min based on the input clock's minimum frequency
> > - Implement the clk_update operation, selecting the best input clock
> >   frequency for the bus frequency that's wanted
> >
> > sh_mobile_sdhi_clk_update() is loosely based on Kuninori Morimoto's work
> > in sh_mmcif.
> >
> > Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
> > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> 
> This is now commit 2e21101df4fe8bdc ("mmc: tmio, sh_mobile_sdhi: Add support
> for variable input clock frequency") in the next branch of Ulf's mmc.git.
> 
>   1. The SDHI/MMC clocks now run much slower than before. Perhaps this is
>      intentional, and a consequence of finding the best way to drive the SD
>      card at the target frequency?

I don't think is generally a problem.  Probably even saves a little
power.

>   2. On r8a7740, the situation is worse: the HP ("High-speed Peripheral")
>      clock is also scaled down from 99 MHz to 12.375 MHz.
>      As the HP clock is the parent of lots of on-chip devices, this may affect
>      performance for all of them.
>
> On r8a73a4, r8a7791, and sh73a0, the SDHI clocks are children of the pll1_div2
> clocks, which are fixed.
> On r8a7740, the SDHI and MMC clocks are children of the HP clock,
> which is also scaled down, affecting all other siblings.
[...]

That seems like a bug in the clock driver.  If it doesn't have
independent dividers for each clock client then it shouldn't allow any
client to change the frequency.

Ben.

-- 
Ben Hutchings
Software Developer, Codethink Ltd.

  reply	other threads:[~2016-04-12 16:19 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-01 15:44 [PATCH v2 0/9] r8a7790: add UHS-I (SDR50) support to Lager Wolfram Sang
2016-04-01 15:44 ` [PATCH v2 1/9] mmc: tmio, sh_mobile_sdhi: Pass tmio_mmc_host ptr to clk_{enable,disable} ops Wolfram Sang
2016-04-01 15:44 ` [PATCH v2 2/9] mmc: tmio, sh_mobile_sdhi: Add support for variable input clock frequency Wolfram Sang
2016-04-12 12:55   ` Geert Uytterhoeven
2016-04-12 16:19     ` Ben Hutchings [this message]
2016-04-15 20:28       ` Wolfram Sang
2016-04-15 20:41         ` Wolfram Sang
2016-04-17 12:49           ` Wolfram Sang
2016-04-18  7:33             ` Geert Uytterhoeven
2016-04-26 10:18           ` Geert Uytterhoeven
2016-04-26 17:00             ` Wolfram Sang
2016-04-01 15:44 ` [PATCH v2 3/9] mmc: tmio: Add UHS-I mode support Wolfram Sang
2016-08-16 18:05   ` Geert Uytterhoeven
2016-08-16 19:55     ` Wolfram Sang
2016-08-16 20:21       ` Geert Uytterhoeven
2016-08-17 19:08     ` Wolfram Sang
2016-08-17 20:17       ` Geert Uytterhoeven
2016-08-18 18:41         ` Wolfram Sang
2016-08-23 12:34       ` Geert Uytterhoeven
2016-04-01 15:44 ` [PATCH v2 4/9] mmc: tmio: always start clock after frequency calculation Wolfram Sang
2016-04-01 15:44 ` [PATCH v2 5/9] mmc: tmio: stop clock when 0Hz is requested Wolfram Sang
2016-04-01 15:44 ` [PATCH v2 6/9] mmc: host: add note that set_ios needs to handle 0Hz properly Wolfram Sang
2016-04-01 15:44 ` [PATCH v2 7/9] mmc: sh_mobile_sdhi: Add UHS-I mode support Wolfram Sang
2016-04-04 15:04   ` Ulf Hansson
2016-04-04 15:17     ` Wolfram Sang
2016-04-04 15:52       ` Ulf Hansson
2016-04-04 15:56         ` Wolfram Sang
2016-04-01 15:44 ` [PATCH v2 8/9] ARM: shmobile: r8a7790: Set maximum frequencies for SDHI clocks Wolfram Sang
2016-04-01 15:44 ` [PATCH v2 9/9] ARM: shmobile: r8a7790: lager: Enable UHS-I SDR-50 Wolfram Sang
2016-04-06  0:56   ` [v2,9/9] " Simon Horman
2016-04-06  6:38     ` Geert Uytterhoeven
2016-04-06  7:13       ` Simon Horman
2016-04-04 15:08 ` [PATCH v2 0/9] r8a7790: add UHS-I (SDR50) support to Lager Ulf Hansson
2016-04-04 15:21   ` Wolfram Sang
2016-04-05 11:12     ` Ulf Hansson
2016-04-05 11:19       ` Wolfram Sang
2016-04-06  0:56         ` Simon Horman

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=1460477978.32355.14.camel@codethink.co.uk \
    --to=ben.hutchings@codethink.co.uk \
    --cc=geert@linux-m68k.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=wsa@the-dreams.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).