Cache is a CPU function; if you write to memory via the CPU, the cache will be updated and will remain unchanged.
If you write to the memory in some other way (for example, DMA transfer, as you think), you need to (possibly) first clear the cache, and then tell the CPU that the cache is invalid. How you do this depends on your system - for example, INVD and WBINVD for x86.
Two good reading articles on cache coherence and DMA Understanding Caching and Using DMA (both by James Bottomley, published in Linux Magazine, "Caching" in issue 117, January 2004 and "DMA" in release 121, May 2004).
source share