From: Arnd Bergmann <arnd@arndb.de>
To: liqin.chen@sunplusct.com
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
torvalds@linux-foundation.org
Subject: Re: [PATCH 06/27] score: create head files delay.h device.h div64.h dma-mapping.h dma.h
Date: Sun, 14 Jun 2009 00:31:54 +0200 [thread overview]
Message-ID: <200906140031.55091.arnd@arndb.de> (raw)
In-Reply-To: <OF676F75F6.AE51CF2E-ON482575D4.00241202-482575D4.0024AEE4@sunplusct.com>
On Saturday 13 June 2009, liqin.chen@sunplusct.com wrote:
> Arnd Bergmann <arnd@arndb.de> 写于 2009-06-10 01:18:20:
>
> > On Tuesday 09 June 2009, liqin.chen@sunplusct.com wrote:
> >
> > Having a working udelay() function is required for many
> > drivers that are sensitive to timing, you should probably
> > implement that at some point in the future.
>
> Add udelay() implement in code.
so you use
static inline void __delay(unsigned long loops)
{
__asm__ __volatile__ (
"1:\tsubi\t%0,1\n\t"
"cmpz.c\t%0\n\t"
"bne\t1b\n\t"
: "=r" (loops)
: "0" (loops));
}
static inline void __udelay(unsigned long usecs)
{
__delay(usecs);
}
This is much better than before, but is far from exact in the __udelay()
case. Please take a look at init/calibrate.c and how other architectures
use loops_per_jiffy if you don't have an exact time source you can use.
If you have a time source with microsecond resolution or better, just loop
until the amount of microseconds has expired.
Arnd <><
prev parent reply other threads:[~2009-06-13 22:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-09 6:26 [PATCH 06/27] score: create head files delay.h device.h div64.h dma-mapping.h dma.h liqin.chen
2009-06-09 17:18 ` Arnd Bergmann
2009-06-13 6:36 ` liqin.chen
2009-06-13 22:31 ` Arnd Bergmann [this message]
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=200906140031.55091.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=akpm@linux-foundation.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liqin.chen@sunplusct.com \
--cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox