Skip to content

Commit

Permalink
dw_spi: Fix missing final read in some polling situations
Browse files Browse the repository at this point in the history
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.

Verified on SPI touch screen device.

Signed-off-by: Major Lee <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Major Lee authored and torvalds committed Dec 15, 2010
1 parent 54efdfe commit 3d0b608
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/spi/dw_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,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);

transfer_complete(dws);
}
Expand Down

0 comments on commit 3d0b608

Please sign in to comment.