diff options
author | Lad, Prabhakar <prabhakar.csengg@gmail.com> | 2016-07-30 22:28:24 +0100 |
---|---|---|
committer | Jagan Teki <jagannadh.teki@gmail.com> | 2016-09-22 00:58:26 +0530 |
commit | d2998286fc58e3ac6c75ed4d3a1e77b618bbf2ae (patch) | |
tree | 182a4b7b709ca147fb85d8dfa239171d66a47b51 /drivers | |
parent | 9b1b6d42256a4c2e59c803afdbf90d39371e61ba (diff) | |
download | u-boot-imx-d2998286fc58e3ac6c75ed4d3a1e77b618bbf2ae.zip u-boot-imx-d2998286fc58e3ac6c75ed4d3a1e77b618bbf2ae.tar.gz u-boot-imx-d2998286fc58e3ac6c75ed4d3a1e77b618bbf2ae.tar.bz2 |
spi: zynq_spi: Fix infinite looping while xfer
During spi transfer, for example:
sspi 1:1.0 8 ff
the rx_len values will be:
rx_len = 0
rx_len = 4294967295
This caused a busy looping during xfer, this patch fixes it
by adding a check while reading the rx fifo
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Reviewed-by: Jagan Teki <jteki@openedev.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/spi/zynq_spi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/zynq_spi.c b/drivers/spi/zynq_spi.c index 09ae1be..dd3de27 100644 --- a/drivers/spi/zynq_spi.c +++ b/drivers/spi/zynq_spi.c @@ -230,7 +230,7 @@ static int zynq_spi_xfer(struct udevice *dev, unsigned int bitlen, /* Read the data from RX FIFO */ status = readl(®s->isr); - while (status & ZYNQ_SPI_IXR_RXNEMPTY_MASK) { + while ((status & ZYNQ_SPI_IXR_RXNEMPTY_MASK) && rx_len) { buf = readl(®s->rxdr); if (rx_buf) *rx_buf++ = buf; |