On Wed, 09 Dec 2009 16:39:06 -0600 James Bottomley <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx> wrote: > Then this extra helpers added to block: rq_flush_dcache_pages() loops > over every segment of the request calling flush_dcache_page() for the > page. If you read the mtd code, it acts on a bio at a time so a request > with N bios flushes every page in the request N times (i'e N^2 flushes). > I'm assuming there's something somewhere I'm missing that restricts mtd > to single bio requests, which makes this all OK? Sorry. But why do you think that do_blktrans_request is dealing with bio? May be i don't know something... > The pio read case is the problematic one, because you dirty the kernel > alias by writing the read data to it and have to flush that before it's > made visible to the user alias view. The API for doing this is > flush_kernel_dcache_page() ... it *only* flushes the kernel view, not > the user view. The reason for this is that if the arch has to protect > the user aliases against speculative movein, that's done in the DMA API > before the request is completed. > > So for this: > > > case READ: > > for (; nsect > 0; nsect--, block++, buf += tr->blksize) > > if (tr->readsect(dev, block, buf)) > > return -EIO; > >+ rq_flush_dcache_pages(req); > > return 0; > > Actually all you need to do is loop over the pages and call > flush_kernel_dcache_page(). I don't think so. Please reread our discussion. I have this bug on system where icache don't look for code in dcache. And I need flush dcache exactly in physical layer. -- Ilya Loginov <isloginov@xxxxxxxxx> -- To unsubscribe from this list: send the line "unsubscribe linux-arch" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html