From: Bhuvan Kumar MITTAL <bhuvan.mittal@st.com>
To: "'Alan Cox'" <alan@lxorguk.ukuu.org.uk>
Cc: <linux-kernel@vger.kernel.org>
Subject: RE: How to make mmap'ed kernel buffer non-cacheable
Date: Mon, 23 Apr 2007 09:41:20 +0530 [thread overview]
Message-ID: <008e01c7855d$7af41de0$142ec70a@dlh.st.com> (raw)
In-Reply-To: <20070420144312.74ec1ebd@the-village.bc.nu>
Hi Alan,
I believe that dma_alloc_coherent will mark the kernel buffer as uncached at alocation time.
But that is not my intention. I have mapped some user space memory to the kernel buffer and I wish to ensure that the contents of both are coherent and correctly ordered.
In other words I wish to flush the contents of the kernel buffer to user space as soon as new data is available in my kernel buffer. How to do that? Will doing mysnc from the user space help?
Rather than flushing everytime (or msyncing) I intend to make my user-to-kernel mapping as non cacheable so that multiple flushing can be avoided.
Bhuvan
> Hi,
> I am working on an audio device driver development on Linux. I have a kernel buffer which I have mapped to user space using mmap call from user space. My problem is that the data which comes to the kernel buffer is getting dropped in user space and I get only 50-60% of the data which is randomly ordered. The user to kernel level buffer address translation code is fine and I suspect this data dropping is occurring coz the kernel buffer is cacheable. Please suggest me some way of making the entire buffer non cacheable. I am stuck on this for quite a while now.
The dma mapping API (or the PCI equivalent) provide the neccessary
behaviours for DMA receive, DMA send and consistent memory space in a
portable fashion.
That may not be done using uncachable memory in all cases as not all
processors even support uncacheable memory spaces.
If you are using the ALSA core routines (snd_dma_alloc_coherent) then
ALSA already uses dma_alloc_coherent to ensure the memory is allocated
for the appropriate use and will be kernel marked uncached.
next prev parent reply other threads:[~2007-04-23 4:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-20 13:00 How to make mmap'ed kernel buffer non-cacheable Bhuvan Kumar MITTAL
2007-04-20 13:43 ` Alan Cox
2007-04-23 4:11 ` Bhuvan Kumar MITTAL [this message]
2007-04-23 4:25 ` Nick Piggin
2007-05-01 3:58 ` Bhuvan Kumar MITTAL
2007-05-01 12:09 ` Nick Piggin
2007-05-02 8:23 ` Bhuvan Kumar MITTAL
2007-05-02 8:45 ` Nick Piggin
-- strict thread matches above, loose matches on Subject: below --
2007-04-20 13:32 Daniel J Blueman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='008e01c7855d$7af41de0$142ec70a@dlh.st.com' \
--to=bhuvan.mittal@st.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox