From: Andrew Miklas <public@mikl.as>
To: linux-kernel@vger.kernel.org
Subject: Userspace DMA
Date: Sun, 16 Nov 2003 18:42:00 -0500 [thread overview]
Message-ID: <200311161842.00253.public@mikl.as> (raw)
Hi,
Is there an accepted way of doing userspace DMA with Linux?
I've gone over a large number of posts, and all seem to recommend something
different, and each method seems to involve certain drawbacks.
What I'd like to do is allow a process to be able to do operations like
pci_alloc_consistent and pci_free_consistent. I'm trying to do this to allow
a driver running under the Bochs emulator to interact with its (non-emulated)
hardware using DMA.
I was originally going to do a pci_alloc_consistent and then mmap the space
into the emulator's process. The process would then get the physical address
of the memory through an ioctl, or I would leave the physical address at the
start of the allocated buffer for the process to later retrieve.
However, it appears that remap_page_range won't work with addresses obtained
from pci_alloc_consistent. I've also read that using the nopage callback can
cause issues if the range I need to allocate is greater than one page.
Most of the approaches I've found seem to require that the hardware be capable
of scatter-gather DMA (video4linux and bttv, for ex.). I've also seen one
solution that had the driver do a pci_alloc_consistent on a certain ioctl,
and then return the physical address of the buffer. The process would then
mmap /dev/mem to access the buffer. However, someone warned that this method
could have coherency issues.
Is there some other method that I should be looking at to accomplish this?
Thanks,
Andrew
next reply other threads:[~2003-11-16 23:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-16 23:42 Andrew Miklas [this message]
2003-11-17 4:34 ` Peter Chubb
2003-11-18 15:09 Alex Bennee
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=200311161842.00253.public@mikl.as \
--to=public@mikl.as \
--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
all inboxes | Powered by JetHome®