All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bryan Wu <bryan.wu-OyLXuOCK7orQT0dZR+AlfA@public.gmane.org>
To: David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
Cc: Bryan Wu <bryan.wu-OyLXuOCK7orQT0dZR+AlfA@public.gmane.org>,
	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: Sat, 02 Feb 2008 14:20:45 +0800	[thread overview]
Message-ID: <1201933245.6978.5.camel@roc-laptop> (raw)
In-Reply-To: <200801311353.34281.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>


On Thu, 2008-01-31 at 13:53 -0800, David Brownell wrote:
> 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.
> 

Before SPIF getting set, we do wait for RXS or TXS clears in the code,
right?

> 
> > 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.

I will pull out these things to a generic standalone function later.

Thanks a lot
-Bryan


-------------------------------------------------------------------------
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/

  parent reply	other threads:[~2008-02-02  6:20 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 [this message]
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=1201933245.6978.5.camel@roc-laptop \
    --to=bryan.wu-oylxuock7orqt0dzr+alfa@public.gmane.org \
    --cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
    --cc=david-b-yBeKhBN/0LDR7s880joybQ@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.