From: Sifan Naeem <sifan.naeem-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
To: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: <linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
<abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
Sifan Naeem <sifan.naeem-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>,
"Stable kernel (v4.1)"
<stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: [PATCH 1/2] spi: img-spfi: check for timeout error before proceeding
Date: Mon, 27 Jul 2015 13:11:15 +0100 [thread overview]
Message-ID: <1437999076-693-1-git-send-email-sifan.naeem@imgtec.com> (raw)
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
next reply other threads:[~2015-07-27 12:11 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-27 12:11 Sifan Naeem [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1437999076-693-1-git-send-email-sifan.naeem@imgtec.com \
--to=sifan.naeem-1axoqhu6uovqt0dzr+alfa@public.gmane.org \
--cc=abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).