[MTD/NAND] Blackfin NFC driver DMA bug ?
Bryan Wu
cooloney at kernel.org
Mon Feb 25 06:15:19 EST 2008
On Fri, Feb 22, 2008 at 4:54 PM, Ivan Djelic <ivan.djelic at parrot.com> wrote:
> 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).
>
Thanks a lot for the clarification.
If can be fixed in drivers or in MTD API, maybe MTD API is good place
to fix it completely as David mentioned.
I will found some way to fix it in my driver firstly.
Regards,
-Bryan Wu
More information about the linux-mtd
mailing list