From: David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
To: bryan.wu-OyLXuOCK7orQT0dZR+AlfA@public.gmane.org
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
Andrew Morton
<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
Subject: Re: [patch 2.6.24 3/6] spi_bfin: wait for tx to complete on some cs_chg paths
Date: Fri, 1 Feb 2008 22:59:35 -0800 [thread overview]
Message-ID: <200802012259.35878.david-b@pacbell.net> (raw)
In-Reply-To: <1201933245.6978.5.camel@roc-laptop>
On Friday 01 February 2008, Bryan Wu wrote:
>
> > > > + while (!(read_STAT(drv_data) & BIT_STAT_SPIF))
> > > > + cpu_relax();
> > >
> > > I'd suggest that this commonly-occurring code sequence be implemented in a
> > > standalone function.
> >
> > The bitmask to check can be a parameter too, as well as the
> > termination result after the mask. That will allow other loops
> > to get properly limited too -- e.g. wait till RXS or TXS clears,
> > not just SPIF getting set.
> >
>
> Before SPIF getting set, we do wait for RXS or TXS clears in the code,
> right?
Sure, but it's the same kind of loop-forever thing.
All "loop-forever" primitives should be replaced by
ones that have some kind of ceiling, since it's far
from unheard-of that hardware glitch.
My observation was that the standalone function
can trivially handle "loop-till-set" as well as
"loop-till-clear".
- Dave
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
prev parent reply other threads:[~2008-02-02 6:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-31 20:19 [patch 2.6.24 3/6] spi_bfin: wait for tx to complete on some cs_chg paths David Brownell
[not found] ` <200801311219.11238.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-01-31 21:26 ` Andrew Morton
[not found] ` <20080131132631.91075a19.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2008-01-31 21:53 ` David Brownell
[not found] ` <200801311353.34281.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-02-02 6:20 ` Bryan Wu
2008-02-02 6:59 ` David Brownell [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=200802012259.35878.david-b@pacbell.net \
--to=david-b-ybekhbn/0ldr7s880joybq@public.gmane.org \
--cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
--cc=bryan.wu-OyLXuOCK7orQT0dZR+AlfA@public.gmane.org \
--cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.