From: Sonic Zhang <[email protected]>

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 <[email protected]>
Signed-off-by: Sonic Zhang <[email protected]>
Signed-off-by: Mike Frysinger <[email protected]>
---
 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


------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today.
http://p.sf.net/sfu/quest-sfdev2dev
_______________________________________________
spi-devel-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

Reply via email to