From: David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
To: Bryan Wu <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: Thu, 31 Jan 2008 13:53:34 -0800 [thread overview]
Message-ID: <200801311353.34281.david-b@pacbell.net> (raw)
In-Reply-To: <20080131132631.91075a19.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
On Thursday 31 January 2008, Andrew Morton wrote:
> On Thu, 31 Jan 2008 12:19:11 -0800
> David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org> 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.
> That'll probably produce less code and you can also
> add a timeout+printk+BUG (or whatever) to that function, rather than just
> mysteriously locking up if something goes wrong.
-------------------------------------------------------------------------
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/
next prev parent reply other threads:[~2008-01-31 21:53 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 [this message]
[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
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=200801311353.34281.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.