linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 2.6.25-rc9 3/3] spi_s3c24xx driver must init completion
@ 2008-04-15 17:58 David Brownell
  0 siblings, 0 replies; only message in thread
From: David Brownell @ 2008-04-15 17:58 UTC (permalink / raw)
  To: Andrew Morton
  Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Ben Dooks

From: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>

The s3c24xx_spi_txrx() function should initialise the completion
each time before using it, otherwise we end up with the possibility
of returning success before the interrupt handler has processed
all the data.

Signed-off-by: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
---
 drivers/spi/spi_s3c24xx.c |    3 +++
 1 file changed, 3 insertions(+)

--- at91.orig/drivers/spi/spi_s3c24xx.c	2008-04-15 10:30:32.000000000 -0700
+++ at91/drivers/spi/spi_s3c24xx.c	2008-04-15 10:30:35.000000000 -0700
@@ -192,8 +192,11 @@ static int s3c24xx_spi_txrx(struct spi_d
 	hw->len = t->len;
 	hw->count = 0;
 
+	init_completion(&hw->done);
+
 	/* send the first byte */
 	writeb(hw_txbyte(hw, 0), hw->regs + S3C2410_SPTDAT);
+
 	wait_for_completion(&hw->done);
 
 	return hw->count;

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-04-15 17:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-15 17:58 [patch 2.6.25-rc9 3/3] spi_s3c24xx driver must init completion David Brownell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).