mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: Userspace DMA
@ 2003-11-18 15:09 Alex Bennee
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Bennee @ 2003-11-18 15:09 UTC (permalink / raw)
  To: Linux Mailing List

Now my mailer is fixed :-)

-----Forwarded Message-----
> From: Alex Bennee <kernel-hacker@bennee.com>
> To: Peter Chubb <peter@chubb.wattle.id.au>
> Cc: public@mikl.as, Linux Mailing List <linux-kernel@vger.kernel.org>
> Subject: Re: Userspace DMA
> Date: Mon, 17 Nov 2003 10:37:40 +0000
> 
> On Mon, 2003-11-17 at 04:34, Peter Chubb wrote:
> > >>>>> "Andrew" == Andrew Miklas <public@mikl.as> writes:
> > Andrew> Hi, Is there an accepted way of doing userspace DMA with
> > Andrew> Linux?
> > 
> > I'm currently working on a framework for user-space device drivers,
> > that allow suitably privileged user-space programs to set up and tear
> > down dma regions 
> 
> Hi,
> 
> I've also been doing some work on allowing user processes to access the
> DMA hardware facilities of the processor platform. This is not actually
> aimed at pci stuff but used for other devices on the embedded SH board I
> use. It works using a packetised writev interface to send DMA requests
> to kernel space where the mapping of memory is done. It really works
> best with scatter gather dma as user-pages can be spread out all over
> the place.
> 
> Whether there is any overlap between my approach, what your doing and
> what Andrew is looking for I have no idea :-) I'm certainly interested
> in seeing any code if only for ideas.
> 
> You can find an alpha (but working on my system) copy of the code at:
> 
> http://www.bennee.com/~alex/software/kernel/index.php
-- 
Alex, homepage: http://www.bennee.com/~alex/
I used to get high on life but lately I've built up a resistance.


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

* Re: Userspace DMA
  2003-11-16 23:42 Andrew Miklas
@ 2003-11-17  4:34 ` Peter Chubb
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Chubb @ 2003-11-17  4:34 UTC (permalink / raw)
  To: public; +Cc: linux-kernel

>>>>> "Andrew" == Andrew Miklas <public@mikl.as> writes:

Andrew> Hi, Is there an accepted way of doing userspace DMA with
Andrew> Linux?

I'm currently working on a framework for user-space device drivers,
that allow suitably privileged user-space programs to set up and tear
down dma regions -- essentially exposing pci_alloc_consistent and
pci_{un}map_sg to userspace -- and also to handle interrupts in user
space.  The framework is implemented as a pair of filesystems, one for
interrupts (actually, I hijack /proc/interrupts/*)  and one for
mappings --- mainly to allow easy cleanup when the userspace program
dies.

It's not yet in a fit state to release, but contact me offline if
you'd like a copy.

--
Dr Peter Chubb  http://www.gelato.unsw.edu.au  peterc AT gelato.unsw.edu.au
The technical we do immediately,  the political takes *forever*



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

* Userspace DMA
@ 2003-11-16 23:42 Andrew Miklas
  2003-11-17  4:34 ` Peter Chubb
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Miklas @ 2003-11-16 23:42 UTC (permalink / raw)
  To: linux-kernel

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

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

end of thread, other threads:[~2003-11-18 15:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-18 15:09 Userspace DMA Alex Bennee
  -- strict thread matches above, loose matches on Subject: below --
2003-11-16 23:42 Andrew Miklas
2003-11-17  4:34 ` Peter Chubb

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®