Re: [MTD/NAND] Blackfin NFC driver DMA bug ?

Ivan Djelic
2008-02-22T08:54:06Z

On Fri, Feb 22, 2008 at 09:45:33AM +0100, Ivan Djelic wrote:
> > Oh, I am not fully understand your concern. The code is invalidating
> > or flushing buf before DMA operation.
> > And invalidate and flush operation is OK for buf which is not
> > cache-aligned on Blackfin arch. it also should be
> > OK for other arch.
>
> Well, consider the following scenario, in which 'buf' is not cache-aligned:
>
> 1) function bf5xx_nand_dma_rw() is called for reading data.
>
> 2) dcache is partially invalidated on a range containing 'buf': this range is
> cache-aligned, of course.
>
> 3) some variable residing nearby 'buf' (in the same cache line interval) is
> read (not modified), resulting in a cache line being fetched. Cache line is not
> dirty.

Also, the variable contents in 3) may also be corrupted because of the
invalidation in 2).