atmel_spi: reload RCR before TCR

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <git-commits-head@...>
Date: Tuesday, December 11, 2007 - 1:59 am

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d84248...
Commit:     d84248bf46582a406116c55b94405c05193773b1
Parent:     6650e0a517bbfa1c47aa3da6b3562fcb1a066c63
Author:     Rini van Zetten <rini@arvoo.nl>
AuthorDate: Mon Dec 10 15:49:34 2007 -0800
Committer:  Linus Torvalds <torvalds@woody.linux-foundation.org>
CommitDate: Mon Dec 10 19:43:55 2007 -0800

    atmel_spi: reload RCR before TCR
    
    We have a wifi module connected to the spi bus and got sometimes FIFO
    overrun errors on the spi bus.
    
    After some investigation i found that the driver loads the TCR (transmit
    count) register before the RCR (receive count).  When the transfer list is
    not empty the atmel_spi_next_message is called while tx and rx are enabled.
     As soon as the TCR is loaded, hardware starts transfer and causes a rx
    fifo overrun because the RCR is not loaded yet.
    
    Load the RCR before the TCR.  After this patch the fifo overrun disapears
    at out setup.
    
    Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
    Signed-off-by: Rini van Zetten <rini@arvoo.nl>
    Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---
 drivers/spi/atmel_spi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c
index ff6a14b..ff10808 100644
--- a/drivers/spi/atmel_spi.c
+++ b/drivers/spi/atmel_spi.c
@@ -195,8 +195,8 @@ static void atmel_spi_next_xfer(struct spi_master *master,
 		xfer, xfer->len, xfer->tx_buf, xfer->tx_dma,
 		xfer->rx_buf, xfer->rx_dma, spi_readl(as, IMR));
 
-	spi_writel(as, TCR, len);
 	spi_writel(as, RCR, len);
+	spi_writel(as, TCR, len);
 	spi_writel(as, PTCR, SPI_BIT(TXTEN) | SPI_BIT(RXTEN));
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
atmel_spi: reload RCR before TCR, Linux Kernel Mailing List..., (Tue Dec 11, 1:59 am)