linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Disable Caching for mmap() address
@ 2009-11-09 23:21 Jonathan Haws
  2009-11-12  9:32 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Haws @ 2009-11-09 23:21 UTC (permalink / raw)
  To: linuxppc-dev@lists.ozlabs.org

All,

I would like to disable caching for an address that was returned from a cal=
l to mmap().  I am using this address for DMA operations in user space and =
want to make sure that the data cache is turned off for that buffer.

The way this works is the driver simply takes an address I provide and begi=
ns a DMA operation to that location in RAM (I have ensured that this is a p=
hysical address I am passing already).  When the DMA is complete, an interr=
upt fires and the ISR gives a semaphore that the user space application is =
pending on (RT_SEM from Xenomai).  I have tried simply calling a cache inva=
lidate routine in the ISR before I give the semaphore, but the kernel crash=
es when I try to call that routine - my guess it because the kernel does no=
t have direct access to that location in memory (only my application does, =
according to the MMU).

Anyway, all I want to do is make sure that the buffer is never stored in th=
e cache and that I always fetch it from RAM.  How can I specify that using =
mmap() on the /dev/mem device, or is there a better way to accomplish this?

Thanks,

Jonathan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-11-12 15:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-09 23:21 Disable Caching for mmap() address Jonathan Haws
2009-11-12  9:32 ` Benjamin Herrenschmidt
2009-11-12 15:26   ` Jonathan Haws

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).