cache maintenance for device memory

Random Guy random.guy.from.russia at gmail.com
Thu Dec 3 16:29:53 EST 2015


Hi,

I have a device with a piece of RAM. That memory is accessible to CPU.
I write a driver for that device and it maps device memory directly to
userspace processes. This mapping is cacheable. So far so good.

Now I'd like to flush or invalidate cache on specific parts of that memory.
If it was just normal system memory I could use streaming DMA API:
dma_map_*/dma_sync_*/dma_unmap_*. But the device memory is not
a part of system memory and so there are no struct page for its pages,
and thus streaming DMA support functions don't work.

Is there anything wrong with my setup?
What should I use to maintain caches for device memory?

TIA



More information about the Kernelnewbies mailing list