linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] spi: img-spfi: check for timeout error before proceeding
@ 2015-07-27 12:11 Sifan Naeem
  2015-07-27 12:11 ` [PATCH 2/2] spi: img-spfi: fix spfi_setup by removing gpio_request_one Sifan Naeem
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Sifan Naeem @ 2015-07-27 12:11 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA, abrestic-F7+t8E8rja9g9hUCZPvPmw,
	Sifan Naeem, Stable kernel (v4.1)

Calling spfi_wait_all_done is not required if the transfer has timed
out before all data is transferred.

spfi_wait_all_done polls for Alldone interrupt which is triggered to
mark the transfer as complete and to indicate it is now safe to issue
a new transfer.

Fixes: 8c2c8c0 ("spi: img-spfi: Control CS lines with GPIO")
Signed-off-by: Sifan Naeem <sifan.naeem-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
Cc: Stable kernel (v4.1) <stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
---
 drivers/spi/spi-img-spfi.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-img-spfi.c b/drivers/spi/spi-img-spfi.c
index 00f1ac3..f27d9d5 100644
--- a/drivers/spi/spi-img-spfi.c
+++ b/drivers/spi/spi-img-spfi.c
@@ -267,15 +267,15 @@ static int img_spfi_start_pio(struct spi_master *master,
 		cpu_relax();
 	}
 
-	ret = spfi_wait_all_done(spfi);
-	if (ret < 0)
-		return ret;
-
 	if (rx_bytes > 0 || tx_bytes > 0) {
 		dev_err(spfi->dev, "PIO transfer timed out\n");
 		return -ETIMEDOUT;
 	}
 
+	ret = spfi_wait_all_done(spfi);
+	if (ret < 0)
+		return ret;
+
 	return 0;
 }
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-07-29 14:14 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-27 12:11 [PATCH 1/2] spi: img-spfi: check for timeout error before proceeding Sifan Naeem
2015-07-27 12:11 ` [PATCH 2/2] spi: img-spfi: fix spfi_setup by removing gpio_request_one Sifan Naeem
2015-07-27 16:34   ` Andrew Bresticker
     [not found]     ` <CAL1qeaHLn6-2QJkPjNCm3V-pVqBk09P2BP-Sp+gn1G4ZWpvkEw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-07-27 16:40       ` Mark Brown
2015-07-27 16:53         ` Sifan Naeem
2015-07-29 11:05         ` Sifan Naeem
     [not found]           ` <A0E307549471DA4DBAF2DE2DE6CBFB7E4966D9FF-brIQrgj5TFtJFJhlrACyRFBRoQTxkR7k@public.gmane.org>
2015-07-29 12:26             ` Mark Brown
     [not found]               ` <20150729122600.GB20130-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-07-29 12:43                 ` Sifan Naeem
     [not found] ` <1437999076-693-1-git-send-email-sifan.naeem-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2015-07-27 16:30   ` [PATCH 1/2] spi: img-spfi: check for timeout error before proceeding Andrew Bresticker
2015-07-29 13:53 ` Mark Brown
2015-07-29 14:07   ` Sifan Naeem
2015-07-29 14:14 ` Applied "spi: img-spfi: check for timeout error before proceeding" to the spi tree Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).