dw_spi: Fix missing final read in some polling situations
diff mbox

Message ID 20101210101241.12295.35368.stgit@bob.linux.org.uk
State Superseded, archived
Headers show

Commit Message

Alan Cox Dec. 10, 2010, 10:13 a.m. UTC
None

Patch
diff mbox

diff --git a/drivers/spi/dw_spi.c b/drivers/spi/dw_spi.c
index 9c1d07b..497ecb3 100644
--- a/drivers/spi/dw_spi.c
+++ b/drivers/spi/dw_spi.c
@@ -419,6 +419,11 @@  static void poll_transfer(struct dw_spi *dws)
 {
 	while (dws->write(dws))
 		dws->read(dws);
+	/*
+	 * There is a possibility that the last word of a transaction
+	 * will be lost if data is not ready. Re-read to solve this issue.
+	 */
+	dws->read(dws);
 
 	dw_spi_xfer_done(dws);
 }