diff options
author | Clark Wang <xiaoning.wang@nxp.com> | 2019-03-15 13:05:22 +0800 |
---|---|---|
committer | Clark Wang <xiaoning.wang@nxp.com> | 2019-03-15 15:47:38 +0800 |
commit | f8380799c6f3aff3e2776ec181501f46818eeb54 (patch) | |
tree | 08aa8062aa1f486620183e47303a830720de7f8a /drivers/spi | |
parent | 1b9cd4cf241c9fa619c6f76bc49f69af5980a0bf (diff) |
MLK-21153-1 spi: lpspi: fix the dataloss when slave is in PIO mode
Related issues have been fixed by (e0e542aeb46a MLK-20060-1 spi: lpspi:
fix wrong transmission when don't use CONT). However, the delay between
sending and receiving in slave mode. This causes the value of
FSR_RXCOUNT cannot reflect whether there is still data not sent timely.
So do this judgement by FSR_TXCOUNT.
Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi-fsl-lpspi.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c index 055d93f3eb08..1e2523c4b8cd 100644 --- a/drivers/spi/spi-fsl-lpspi.c +++ b/drivers/spi/spi-fsl-lpspi.c @@ -87,6 +87,7 @@ #define CFGR1_NOSTALL BIT(3) #define CFGR1_MASTER BIT(0) #define FSR_RXCOUNT (0xFF << 16) +#define FSR_TXCOUNT (0xFF) #define RSR_RXEMPTY BIT(1) #define TCR_CPOL BIT(31) #define TCR_CPHA BIT(30) @@ -768,7 +769,7 @@ static irqreturn_t fsl_lpspi_isr(int irq, void *dev_id) } if (temp_SR & SR_MBF || - readl(fsl_lpspi->base + IMX7ULP_FSR) & FSR_RXCOUNT) { + readl(fsl_lpspi->base + IMX7ULP_FSR) & FSR_TXCOUNT) { writel(SR_FCF, fsl_lpspi->base + IMX7ULP_SR); fsl_lpspi_intctrl(fsl_lpspi, IER_FCIE); return IRQ_HANDLED; |