From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton 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:26:31 -0800 Message-ID: <20080131132631.91075a19.akpm@linux-foundation.org> References: <200801311219.11238.david-b@pacbell.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Bryan Wu , spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: David Brownell Return-path: In-Reply-To: <200801311219.11238.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: spi-devel-general-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: spi-devel-general-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: linux-spi.vger.kernel.org On Thu, 31 Jan 2008 12:19:11 -0800 David Brownell 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. 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/