Skip to contentSkip to conversation

spi: zynqmp_qspi: Workaround for small data cache issue

PATCH In review Venkatesh Yadav Abbarapu 2 participants 3 messages Sep 14, 2023 – Sep 15, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spi: zynqmp_qspi: Workaround for small data cache issue

Cache related issues are seen with small sized data reads.
Due to this, proper data is not read. Also some times sf probe fails randomly. To workaround this issue, invalidate dcache after read DMA is triggered.

---
 drivers/spi/zynqmp_gqspi.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/spi/zynqmp_gqspi.c +2 -0
index a506d15227..ec59ef5804 100644
@@ -707,6 +707,8 @@ static int zynqmp_qspi_start_dma(struct zynqmp_qspi_priv *priv,
 			return -ETIMEDOUT;
 		}
 
+		invalidate_dcache_range(addr, addr + size);
+
 		writel(GQSPI_DMA_DST_I_STS_DONE, &dma_regs->dmaisr);
 
 		debug("buf:0x%lx, rxbuf:0x%lx, *buf:0x%x len: 0x%x\n",
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 16 lines · Venkatesh Yadav Abbarapu

Cache related issues are seen with small sized data reads.
Due to this, proper data is not read. Also some times sf probe fails randomly. To workaround this issue, invalidate dcache after read DMA is triggered.

---
  drivers/spi/zynqmp_gqspi.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/spi/zynqmp_gqspi.c +0 -0
index a506d15227..ec59ef5804 100644

drivers/spi/zynqmp_gqspi.c static int zynqmp_qspi_start_dma(struct zynqmp_qspi_priv *priv, · line 714

Quoted 8 lines
drivers/spi/zynqmp_gqspi.c +2 -0
@@ -707,6 +707,8 @@ static int zynqmp_qspi_start_dma(struct zynqmp_qspi_priv *priv,
  			return -ETIMEDOUT;
  		}
 
+		invalidate_dcache_range(addr, addr + size);
+
  		writel(GQSPI_DMA_DST_I_STS_DONE, &dma_regs->dmaisr);
 
  		debug("buf:0x%lx, rxbuf:0x%lx, *buf:0x%x len: 0x%x\n",

I got two patches. Which one is correct?
Can you please send v2?

M

#2 lore raw

Hi Michal,

Quoted 34 lines

-----Original Message-----
From: Simek, Michal <[email protected]>
Sent: Thursday, September 14, 2023 7:34 PM
To: Abbarapu, Venkatesh <[email protected]>; u- [email protected]
Cc: [email protected]; [email protected]; Ashok Reddy Soma <[email protected]>
Subject: Re: [PATCH] spi: zynqmp_qspi: Workaround for small data cache issue

Quoted 7 lines · Venkatesh Yadav Abbarapu

Cache related issues are seen with small sized data reads. Due to this, proper data is not read. Also some times sf probe fails randomly. To workaround this issue, invalidate dcache after read DMA is triggered.

Signed-off-by Venkatesh Yadav Abbarapu

<[email protected]>

drivers/spi/zynqmp_gqspi.c static int zynqmp_qspi_start_dma(struct

Quoted 9 lines
---
  drivers/spi/zynqmp_gqspi.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/spi/zynqmp_gqspi.c +0 -0
index a506d15227..ec59ef5804 100644
@@ -707,6 +707,8 @@ static int zynqmp_qspi_start_dma(struct

zynqmp_qspi_priv *priv,

Quoted 3 lines
drivers/spi/zynqmp_gqspi.c +0 -0
  			return -ETIMEDOUT;
  		}
 
Quoted 8 lines

drivers/spi/zynqmp_gqspi.c static int zynqmp_qspi_start_dma(struct zynqmp_qspi_priv *priv, · line 714

Quoted 5 lines
drivers/spi/zynqmp_gqspi.c +2 -0
+		invalidate_dcache_range(addr, addr + size);
+
  		writel(GQSPI_DMA_DST_I_STS_DONE, &dma_regs->dmaisr);
 
  		debug("buf:0x%lx, rxbuf:0x%lx, *buf:0x%x len: 0x%x\n",

I got two patches. Which one is correct? Can you please send v2?

There are two patches. Will send v2 as series.

Thanks
Venkatesh

Quoted 2 lines

M