It is definitely intended to work. Otherwise we would not have code
like this:
christoph@fly:~/linux-2.6$ find . -name "*.c" | xargs grep "flush_dcache_page"|grep virt
./drivers/scsi/scsi_tgt_if.c: flush_dcache_page(virt_to_page(ev));
./drivers/scsi/scsi_tgt_if.c: flush_dcache_page(virt_to_page(ev));
Ok. I think your patch is fine as a quick fix for 2.6.22. I am a bit
uneasy with that given that its in such a broadly used function while its
only use is to enable flush_dcache_page to work. But we need the general
issue taken care of after 2.6.22.
As explained about: There are corner cases in which it does not work. You
seem to assume that flush_dcache_page can become a no op. That may not be
true on platforms that need explicit cache flushing for a DMA engine to
access a data structure. The above listed use suggests that the caller
expects flushing to occur correctly.
-