From: Andrew Morton <akpm@linux-foundation.org>
To: Paul Mundt <lethal@linux-sh.org>
Cc: Magnus Damm <magnus.damm@gmail.com>,
spi-devel-general@lists.sourceforge.net,
dbrownell@users.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] spi: SuperH MSIOF SPI Master driver
Date: Wed, 25 Nov 2009 23:07:48 -0800 [thread overview]
Message-ID: <20091125230748.dbb7cf09.akpm@linux-foundation.org> (raw)
In-Reply-To: <20091126064315.GA6580@linux-sh.org>
On Thu, 26 Nov 2009 15:43:16 +0900 Paul Mundt <lethal@linux-sh.org> wrote:
> > > +static void sh_msiof_modify_ctr_wait(struct sh_msiof_spi_priv *p,
> > > + unsigned long clr, unsigned long set)
> > > +{
> > > + unsigned long mask = clr | set;
> > > + unsigned long data;
> > > +
> > > + data = sh_msiof_read(p, CTR);
> > > + data &= ~clr;
> > > + data |= set;
> > > + sh_msiof_write(p, CTR, data);
> > > +
> > > + while ((sh_msiof_read(p, CTR) & mask) != set)
> > > + ;
> >
> > hm, confidence. No timeout needed here?
> >
> This definitely needs a timeout, nothing involving SPI inspires
> confidence. A cpu_relax() to prevent the compiler from optimizing the
> loop out would help, too.
We generally don't bother with the relax in an IO polling loop
like this. It involves an IO read/write which the compiler cannot fiddle
with and I believe that CPUs will generally take the opportunity to have
a little snooze while the slow IO operation is happening.
Can't hurt though ;)
prev parent reply other threads:[~2009-11-26 7:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-24 12:55 [PATCH] spi: SuperH MSIOF SPI Master driver Magnus Damm
2009-11-25 20:11 ` Andrew Morton
2009-11-26 6:37 ` Magnus Damm
2009-11-26 6:43 ` Paul Mundt
2009-11-26 7:07 ` Andrew Morton [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=20091125230748.dbb7cf09.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=dbrownell@users.sourceforge.net \
--cc=lethal@linux-sh.org \
--cc=linux-kernel@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=spi-devel-general@lists.sourceforge.net \
/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