summaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorEugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>2018-04-19 17:47:41 +0300
committerJagan Teki <jagan@amarulasolutions.com>2018-04-23 11:16:41 +0530
commit9b14ac5cc2294ac3eaae92421abff27ed3e6caae (patch)
treed680cca99f37250de9ba19a33ecf2923e8bbce56 /drivers/spi
parent4d95ed39a19565a784419c8d9d67ad1b46ce3103 (diff)
downloadu-boot-9b14ac5cc2294ac3eaae92421abff27ed3e6caae.tar.gz
u-boot-9b14ac5cc2294ac3eaae92421abff27ed3e6caae.tar.xz
u-boot-9b14ac5cc2294ac3eaae92421abff27ed3e6caae.zip
spi: dw: invert wait condition in dw_spi_xfer
While switching to readl_poll_timeout macros from custom code the waiting condition was accidently inverted, so it was pure luck that this code works at least in some conditions. Fix that by inverting exit condition for readl_poll_timeout. Fixes: c6b4f031d9 ("DW SPI: fix tx data loss on FIFO flush") Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/designware_spi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/designware_spi.c b/drivers/spi/designware_spi.c
index 0e93b62eee..5e2d290ddc 100644
--- a/drivers/spi/designware_spi.c
+++ b/drivers/spi/designware_spi.c
@@ -425,7 +425,7 @@ static int dw_spi_xfer(struct udevice *dev, unsigned int bitlen,
* in the beginning of new transfer.
*/
if (readl_poll_timeout(priv->regs + DW_SPI_SR, val,
- !(val & SR_TF_EMPT) || (val & SR_BUSY),
+ (val & SR_TF_EMPT) && !(val & SR_BUSY),
RX_TIMEOUT * 1000)) {
ret = -ETIMEDOUT;
}