From: Simon Horman <horms@verge.net.au>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Magnus Damm <magnus.damm@gmail.com>,
Yusuke Goda <yusuke.goda.sx@renesas.com>,
linux-mmc@vger.kernel.org, Chris Ball <cjb@laptop.org>,
Paul Mundt <lethal@linux-sh.org>,
Cao Minh Hiep <hiepcm@gmail.com>
Subject: Re: [PATCH 2/2] mmc: sh_mmcif: mmc->f_max should be half of the bus clock
Date: Tue, 27 Mar 2012 17:14:05 +0900 [thread overview]
Message-ID: <20120327081404.GC30752@verge.net.au> (raw)
In-Reply-To: <Pine.LNX.4.64.1203270948200.27382@axis700.grange>
On Tue, Mar 27, 2012 at 09:53:33AM +0200, Guennadi Liakhovetski wrote:
> On Mon, 26 Mar 2012, Guennadi Liakhovetski wrote:
>
> > On Mon, 26 Mar 2012, Magnus Damm wrote:
> >
> > > On Mon, Mar 26, 2012 at 2:52 PM, Simon Horman <horms@verge.net.au> wrote:
> > > > On Mon, Mar 26, 2012 at 02:45:30PM +0900, Yusuke Goda wrote:
> > > >> Hi Simon-san, Guennadi-san
> > > >>
> > > >> (2012/03/26 7:30), Simon Horman wrote:
> > > >> > On Sat, Mar 24, 2012 at 07:06:31PM +0100, Guennadi Liakhovetski wrote:
> > > >> >> On Wed, 21 Mar 2012, Simon Horman wrote:
> > > >> >>
> > > >> >>> mmc->f_max should be half of the bus clock.
> > > >> >>> And now that mmc->f_max is not equal to the bus clock the
> > > >> >>> latter should be used directly to calculate mmc->f_min.
> > > >> >>
> > > >> >> The patch seems correct as it stands, however, looking at it - does anyone
> > > >> >> understands why that "close to 400kHz" comment and such a complicated
> > > >> >> calculation? Shouldn't it be just host->clk / 512 always? Maybe this
> > > >> >> should be a separate patch, so, for this one
> > > >> >>
> > > >> >> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> > > >> >
> > > >> > Hi Guennadi,
> > > >> >
> > > >> > that code seems to date back to the original driver submission
> > > >> > made by Goda-san. I have CCed him as perhaps he recalls why
> > > >> > the code is like it is.
> > > >> I thought to get closer to 400kHz if possible.
> > > >> Probably even host->clk / 512 does not have any problem.
> > > >
> > > > Sorry for my ignorance, is ~400kHz desirable for some reason?
> > >
> > > The 400kHz frequency is used during initialization of the SD card.
> > > Simply put, the SD frequency starts low out low and is then changed to
> > > something higher depending on the capability of the memory card and
> > > the host controller. Please have a look at the simplified SD
> > > specification for more details.
> >
> > I see, so, we want something like
> >
> > shift = fls(host->clk / 400000 - 1);
> > mmc->f_min = host->clk >> shift;
> >
> > eventually with some rounding, depending on our preferences.
>
> As you see in the email header, that last email was sent about 24 hours
> ago, it just got stuck on my mail server due to some local problem...
> After the recent discussions on this topic, this mail is outdated and
> should be disregarded. I certainly agree to using clk / 512
> unconditionally for all host frequencies, which also was my original
> suggestion in
>
> http://article.gmane.org/gmane.linux.kernel.mmc/13556
Indeed it was your suggestion and a good one too.
next prev parent reply other threads:[~2012-03-27 8:14 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-21 9:02 [PATCH 0/2] MMCIF Clock Fixes Simon Horman
2012-03-21 9:02 ` [PATCH 1/2] mmc: sh_mmcif: double clock speed Simon Horman
2012-03-24 17:56 ` Guennadi Liakhovetski
2012-03-26 2:21 ` Simon Horman
2012-03-21 9:02 ` [PATCH 2/2] mmc: sh_mmcif: mmc->f_max should be half of the bus clock Simon Horman
2012-03-24 18:06 ` Guennadi Liakhovetski
[not found] ` <20120325223033.GA6860@verge.net.au>
2012-03-26 5:45 ` Yusuke Goda
2012-03-26 5:52 ` Simon Horman
2012-03-26 6:04 ` Yusuke Goda
2012-03-26 6:17 ` Magnus Damm
2012-03-26 7:04 ` Guennadi Liakhovetski
2012-03-27 7:53 ` Guennadi Liakhovetski
2012-03-27 8:14 ` Simon Horman [this message]
2012-03-27 1:43 ` Simon Horman
2012-03-27 2:46 ` Magnus Damm
2012-03-27 3:20 ` Chris Ball
2012-03-27 4:02 ` Magnus Damm
2012-03-27 6:01 ` Simon Horman
2012-03-27 6:37 ` Magnus Damm
2012-03-27 7:12 ` 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=20120327081404.GC30752@verge.net.au \
--to=horms@verge.net.au \
--cc=cjb@laptop.org \
--cc=g.liakhovetski@gmx.de \
--cc=hiepcm@gmail.com \
--cc=lethal@linux-sh.org \
--cc=linux-mmc@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=yusuke.goda.sx@renesas.com \
/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