From: sxauwsk <sxauwsk@163.com>
To: Mark Brown <broonie@kernel.org>
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
sxauwsk@163.com, guojian <guojian@innoinstrument.net>,
wangshikai <wangshikai@inno-instrument.cn>
Subject: [PATCH] spi: cadence: Add usleep_range() for cdns_spi_fill_tx_fifo()
Date: Mon, 9 Apr 2018 19:16:50 +0800 [thread overview]
Message-ID: <1523272610-49116-1-git-send-email-sxauwsk@163.com> (raw)
In case of xspi work in busy condition, may send bytes failed.
Add one bytes delay
Signed-off-by: sxauwsk <sxauwsk@163.com>
Signed-off-by: guojian <guojian@innoinstrument.net>
Signed-off-by: wangshikai <wangshikai@inno-instrument.cn>
---
drivers/spi/spi-cadence.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/spi/spi-cadence.c b/drivers/spi/spi-cadence.c
index 5c9516a..66ae055 100644
--- a/drivers/spi/spi-cadence.c
+++ b/drivers/spi/spi-cadence.c
@@ -313,6 +313,12 @@ static void cdns_spi_fill_tx_fifo(struct cdns_spi *xspi)
while ((trans_cnt < CDNS_SPI_FIFO_DEPTH) &&
(xspi->tx_bytes > 0)) {
+
+ /* When xspi in busy condition, bytes may send failed,
+ * caused communication failure so add one byte delay
+ */
+ usleep_range(10, 20);
+
if (xspi->txbuf)
cdns_spi_write(xspi, CDNS_SPI_TXD, *xspi->txbuf++);
else
--
1.7.9.5
next reply other threads:[~2018-04-11 3:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-09 11:16 sxauwsk [this message]
2018-04-13 18:03 ` [PATCH] spi: cadence: Add usleep_range() for cdns_spi_fill_tx_fifo() Mark Brown
[not found] <201804102112307962582@163.com>
2018-04-10 13:49 ` Mark Brown
2018-04-16 12:07 sxauwsk
2018-04-16 20:01 sxauwsk
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=1523272610-49116-1-git-send-email-sxauwsk@163.com \
--to=sxauwsk@163.com \
--cc=broonie@kernel.org \
--cc=guojian@innoinstrument.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=wangshikai@inno-instrument.cn \
/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 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.