linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] SPI: fix in PL022 stop queue procedure
@ 2010-05-20 22:28 Linus Walleij
  0 siblings, 0 replies; only message in thread
From: Linus Walleij @ 2010-05-20 22:28 UTC (permalink / raw)
  To: Grant Likely, spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: Linus Walleij, Grzegorz Sygieda, Lukasz Baj

From: Grzegorz Sygieda <grzegorz.sygieda-++hxYGjEMp0AvxtiuMwx3w@public.gmane.org>

This fix prevents queue being marked as "stopped", if data exists
in the queue list.

Signed-off-by: Grzegorz Sygieda <grzegorz.sygieda-++hxYGjEMp0AvxtiuMwx3w@public.gmane.org>
Signed-off-by: Lukasz Baj <lukasz.baj-++hxYGjEMp0AvxtiuMwx3w@public.gmane.org>
Signed-off-by: Linus Walleij <linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>
---
 drivers/spi/amba-pl022.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/spi/amba-pl022.c b/drivers/spi/amba-pl022.c
index e9aeee1..ba9663f 100644
--- a/drivers/spi/amba-pl022.c
+++ b/drivers/spi/amba-pl022.c
@@ -1148,7 +1148,6 @@ static int stop_queue(struct pl022 *pl022)
 	 * A wait_queue on the pl022->busy could be used, but then the common
 	 * execution path (pump_messages) would be required to call wake_up or
 	 * friends on every SPI message. Do this instead */
-	pl022->run = QUEUE_STOPPED;
 	while (!list_empty(&pl022->queue) && pl022->busy && limit--) {
 		spin_unlock_irqrestore(&pl022->queue_lock, flags);
 		msleep(10);
@@ -1157,6 +1156,7 @@ static int stop_queue(struct pl022 *pl022)
 
 	if (!list_empty(&pl022->queue) || pl022->busy)
 		status = -EBUSY;
+	else pl022->run = QUEUE_STOPPED;
 
 	spin_unlock_irqrestore(&pl022->queue_lock, flags);
 
-- 
1.6.3.3


------------------------------------------------------------------------------

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

only message in thread, other threads:[~2010-05-20 22:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-20 22:28 [PATCH] SPI: fix in PL022 stop queue procedure Linus Walleij

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