All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spi/bfin_spi: respect cs_change even in last transfer
@ 2011-06-23 21:06 Mike Frysinger
  0 siblings, 0 replies; only message in thread
From: Mike Frysinger @ 2011-06-23 21:06 UTC (permalink / raw)
  To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	David Brownell, Grant Likely
  Cc: uclinux-dist-devel-ZG0+EudsQA8dtHy/vicBwGD2FQJk+8+b

From: Sonic Zhang <sonic.zhang-OyLXuOCK7orQT0dZR+AlfA@public.gmane.org>

According to the definition of flag cs_change in spi.h, CS should stay
active in the last transfer of a message until the first transfer of
the next message if it's set.  The Blackfin SPI driver was not checking
this before deactivating the CS.

Reported-by: Michael Hennerich <michael.hennerich-OyLXuOCK7orQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Sonic Zhang <sonic.zhang-OyLXuOCK7orQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Mike Frysinger <vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
---
 drivers/spi/spi_bfin5xx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/spi/spi_bfin5xx.c b/drivers/spi/spi_bfin5xx.c
index cc880c9..50f6f48 100644
--- a/drivers/spi/spi_bfin5xx.c
+++ b/drivers/spi/spi_bfin5xx.c
@@ -910,7 +910,7 @@ static void bfin_spi_pump_transfers(unsigned long data)
 		message->actual_length += drv_data->len_in_bytes;
 		/* Move to next transfer of this msg */
 		message->state = bfin_spi_next_transfer(drv_data);
-		if (drv_data->cs_change)
+		if (drv_data->cs_change && message->state != DONE_STATE)
 			bfin_spi_cs_deactive(drv_data, chip);
 	}
 
-- 
1.7.5.3

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

only message in thread, other threads:[~2011-06-23 21:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-23 21:06 [PATCH] spi/bfin_spi: respect cs_change even in last transfer Mike Frysinger

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.