diff mbox

dw_spi: Fix missing final read in some polling situations

Message ID 20101210101241.12295.35368.stgit@bob.linux.org.uk (mailing list archive)
State Superseded, archived
Headers show

Commit Message

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

Patch

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);
 }