From: Tony Lindgren <tony@atomide.com>
To: Frantisek Dufka <dufkaf@seznam.cz>
Cc: linux-omap-open-source@linux.omap.com
Subject: Re: clock divisor in mmc_omap_set_ios in drivers/mmc/omap.c wrong
Date: Thu, 16 Nov 2006 03:05:27 +0200 [thread overview]
Message-ID: <20061116010527.GM21064@atomide.com> (raw)
In-Reply-To: <45544C51.1050106@seznam.cz>
* Frantisek Dufka <dufkaf@seznam.cz> [061110 11:55]:
> Hello,
>
> anyone knows real reason why the divisor is intentionally lowered in
> mmc_omap_set_ios so the result frequency is _not_ near the one requested?
>
> First there is a code which tries hard to select the divisor that
> produces highest possible frequency which is lower or equal to the
> requested one
>
> fclk_rate = clk_get_rate(host->fclk);
> dsor = fclk_rate / freq;
> if (dsor < 1)
> dsor = 1;
> if (fclk_rate / dsor > freq)
> dsor++;
>
> if (dsor > 250)
> dsor = 250;
>
> and then there is additional
>
> dsor++;
>
> which intentionally makes resulting frequency lower by unknown factor.
>
> If this is some workaround for specific cards maybe it should be solved
> in different place like blacklisting offending cards and actually
> requesting lower frequency for them. Or is there some real reason?
>
> For requested 20Mhz MMC bus speed and 48Mhz omap clock current code
> results in 12Mhz instead of 16Mhz.
This seems like a bug to me (or else the TRMs have a typo). Let's patch
it out and see if it still works.
Regards,
Tony
next prev parent reply other threads:[~2006-11-16 1:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-10 9:54 clock divisor in mmc_omap_set_ios in drivers/mmc/omap.c wrong Frantisek Dufka
2006-11-16 1:05 ` Tony Lindgren [this message]
2006-11-16 8:15 ` Frantisek Dufka
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=20061116010527.GM21064@atomide.com \
--to=tony@atomide.com \
--cc=dufkaf@seznam.cz \
--cc=linux-omap-open-source@linux.omap.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