public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Carlos Aguiar <carlos.aguiar@indt.org.br>
Cc: linux-kernel@vger.kernel.org, Tony Lindgren <tony@atomide.com>,
	Pierre Ossman <drzeus-list@drzeus.cx>
Subject: Re: [RFC] mmc: add OMAP driver
Date: Thu, 16 Feb 2006 16:59:58 +0000	[thread overview]
Message-ID: <20060216165957.GC29443@flint.arm.linux.org.uk> (raw)
In-Reply-To: <43F48BCA.8010608@indt.org.br>

One additional comment on the patch which I missed, and has shown to
be a related cause of problems on a different host controller...

On Thu, Feb 16, 2006 at 10:27:22AM -0400, Carlos Aguiar wrote:
> +static inline void set_data_timeout(struct mmc_omap_host *host, struct mmc_request *req)
> +{
> +	int timeout;
> +	u16 reg;
> +
> +	/* Convert ns to clock cycles by assuming 20MHz frequency
> +	 * 1 cycle at 20MHz = 500 ns
> +	 */
> +	timeout = req->data->timeout_clks + req->data->timeout_ns / 500;
> +
> +	/* Some cards require more time to do at least the first read operation */
> +	timeout = timeout << 4;

This is a hack because you got your calculation above wrong.  If you
assume a fast clock, the timeout will be too slow for a slower clock.
If you do the calculation correctly and you won't need such hacks.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core

  parent reply	other threads:[~2006-02-16 17:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-16 14:27 [RFC] mmc: add OMAP driver Carlos Aguiar
2006-02-16 15:15 ` Russell King
2006-02-16 16:59 ` Russell King [this message]
2006-02-24 16:38   ` Carlos Aguiar
2006-02-24 20:48     ` Russell King
     [not found]       ` <5b5833aa0603030926h5d2c357eoe203a40248796013@mail.gmail.com>
     [not found]         ` <48b7761d0603030942l53fcd2bbl249297461a54dd3c@mail.gmail.com>
2006-03-03 17:49           ` Carlos Eduardo
2006-03-07 20:53       ` Carlos Aguiar

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=20060216165957.GC29443@flint.arm.linux.org.uk \
    --to=rmk+lkml@arm.linux.org.uk \
    --cc=carlos.aguiar@indt.org.br \
    --cc=drzeus-list@drzeus.cx \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony@atomide.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