Skip to content
Snippets Groups Projects
Commit a5af879a authored by Clark Wang's avatar Clark Wang Committed by Leonard Crestez
Browse files

MLK-21153-1 spi: lpspi: fix the dataloss when slave is in PIO mode


Related issues have been fixed by (e0e542ae 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: default avatarClark Wang <xiaoning.wang@nxp.com>
(cherry picked from commit 1a260d13aa3724b9919a2d8e2f53b4ad26ccf372)
parent 185c1660
No related branches found
No related tags found
No related merge requests found
......@@ -77,6 +77,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)
......@@ -758,7 +759,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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment