All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dw_spi: Fix missing final read in some polling situations
@ 2010-12-10 10:13 Alan Cox
  0 siblings, 0 replies; only message in thread
From: Alan Cox @ 2010-12-10 10:13 UTC (permalink / raw)
  To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b

From: Major Lee <major_lee-8+ZHUTgF1KZBDgjK7y7TUQ@public.gmane.org>

There is a possibility that the last word of a transaction will be lost if
data is not ready.  Re-read in poll_transfer() to solve this issue when
poll_mode is enabled.

Patch is against mainline (2.6.37-rc5).
Verified on SPI touch screen device.

Signed-off-by: Major Lee <major_lee-8+ZHUTgF1KZBDgjK7y7TUQ@public.gmane.org>
Signed-off-by: Alan Cox <alan-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
---

 drivers/spi/dw_spi.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)


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


------------------------------------------------------------------------------

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

only message in thread, other threads:[~2010-12-10 10:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-10 10:13 [PATCH] dw_spi: Fix missing final read in some polling situations Alan Cox

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.