Re: [PATCH v5 3/9] spi: Add a driver for the Freescale/NXP QuadSPI controller

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Yogesh,

On 16.11.18 11:12, Yogesh Narayan Gaur wrote:
> Hi Frieder,
> 
> I have one more comment, you might add that also in your next version:
> 
> Func fsl_qspi_invalidate() needs to be called for case when we are performing Erase/Write of data from IP bus
> 
> So instead of calling this for call case
>                  qspi_writel(q, QUADSPI_RBCT_WMRK_MASK |
>                              QUADSPI_RBCT_RXBRD_USEIPS, base + QUADSPI_RBCT);
> 
>                  if (op->data.nbytes && op->data.dir == SPI_MEM_DATA_OUT)
>                          fsl_qspi_fill_txfifo(q, op);
> 
>                  err = fsl_qspi_do_op(q, op);
>          }
> 
>          /* Invalidate the data in the AHB buffer. */
>          fsl_qspi_invalidate(q);
> 
>          mutex_unlock(&q->lock);
> 
> You can call that only for case of write/erase operation
> 	/* Invalidate the data in the AHB buffer. */
> 	if (op->data.nbytes && op->data.dir == SPI_MEM_DATA_OUT)
> 	        fsl_qspi_invalidate(q);

Thank you for your feedback.

Unfortunately I can't be sure if the current operation is really a write 
or erase operation on the chip as this information is hidden behind the 
SPI mem layer.

Also in case of SPI NAND the AHB buffer needs to be invalidated as soon 
as its content won't match the on-chip page buffer anymore. This is 
usually the case when a page read op is issued.

So currently it is not possible to easily determine when to invalidate 
the AHB buffer and this is why I do it after each op.
In the future we might add some hook in the SPI mem layer to improve 
this situation.

Also, please keep discussions like this on the mailing list, so others 
can comment if necessary.

Thanks,
Frieder
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux