From: David Brownell <david-b@pacbell.net>
To: "Andrea Paterniani" <a.paterniani@swapp-eng.it>
Cc: "Andrew Morton" <akpm@osdl.org>,
"Linux Kernel list" <linux-kernel@vger.kernel.org>
Subject: Re: [patch 2.6.18-git] SPI -- Freescale iMX SPI controller driver
Date: Sat, 7 Oct 2006 16:50:04 -0700 [thread overview]
Message-ID: <200610071650.04887.david-b@pacbell.net> (raw)
In-Reply-To: <FLEPLOLKEPNLMHOILNHPAEODCMAA.a.paterniani@swapp-eng.it>
On Saturday 07 October 2006 4:01 am, you wrote:
> > > > ...
> > > > ug. Why not simply open-code
> > > >
> > > > readl(addr + DATA);
> > ...
>
> What you're saying is clear.
> But I'm a little bit confused...what about the lot of definitions
> that use __REG or __REG2 macros to define registers address
> (inside imx-regs.h, pxa-regs.h and so on) ?
There are two conventions; accessing chip registers like globals
(matching chip documentation) is a second convention. The __REG32
style accessors can generate better code in many cases, too.
Thing is, you shouldn't create a third convention.
> > > > The use of loops_per_jiffy seems inappropriate. That's an IO-space read in
> > > > there, which is slow. This timeout will be very long indeed.
> > >
> > > Please suggest me what it's more appropriate.
> >
> > Pick a constant, use it.
>
> How should I choose the value of that costant ?
You could pick the value of loops_per_jiffy at HZ=1000,
for one example. You're using that limit to avoid
spinning too long with IRQs blocked, so you basically
just need a loop count which, if it's exceeded, will
pretty clearly indicate a hardware bug.
- Dave
next prev parent reply other threads:[~2006-10-08 0:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-02 15:16 [patch 2.6.18-git] SPI -- Freescale iMX SPI controller driver David Brownell
2006-10-02 17:59 ` Andrew Morton
2006-10-02 20:16 ` David Brownell
2006-10-03 16:08 ` Andrea Paterniani
2006-10-06 23:35 ` David Brownell
2006-10-07 11:01 ` Andrea Paterniani
2006-10-07 23:50 ` David Brownell [this message]
2006-10-02 18:37 ` Thiago Galesi
2006-10-02 20:10 ` David Brownell
2006-10-02 20:38 ` Andrew Morton
2006-10-02 21:09 ` David Brownell
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=200610071650.04887.david-b@pacbell.net \
--to=david-b@pacbell.net \
--cc=a.paterniani@swapp-eng.it \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.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