public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* DMA to/from user buffers
@ 2001-09-04 14:45 Sebastian Heidl
  2001-09-04 19:30 ` Gerd Knorr
  2001-09-05  7:51 ` Helge Hafting
  0 siblings, 2 replies; 3+ messages in thread
From: Sebastian Heidl @ 2001-09-04 14:45 UTC (permalink / raw)
  To: linux-kernel


Hi,

two questions about using an user-supplied buffer (e.g. malloced
in user space) for DMA transfers:

1. Is it possible ?
2. What restrictions/requirements apply for the buffer (alignment...) ?

Documentation/DMA-mapping.txt only talks about buffers allocated in
kernel space.

thanks,
_sh_

-- 

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

* Re: DMA to/from user buffers
  2001-09-04 14:45 DMA to/from user buffers Sebastian Heidl
@ 2001-09-04 19:30 ` Gerd Knorr
  2001-09-05  7:51 ` Helge Hafting
  1 sibling, 0 replies; 3+ messages in thread
From: Gerd Knorr @ 2001-09-04 19:30 UTC (permalink / raw)
  To: linux-kernel

Sebastian Heidl wrote:
>  
>  Hi,
>  
>  two questions about using an user-supplied buffer (e.g. malloced
>  in user space) for DMA transfers:
>  
>  1. Is it possible ?
>  2. What restrictions/requirements apply for the buffer (alignment...) ?
>  
>  Documentation/DMA-mapping.txt only talks about buffers allocated in
>  kernel space.

Lock down the user pages using kiobufs (see include/linux/iobufs.h),
then feed these pages to the pci_* functions.

  Gerd

-- 
Damn lot people confuse usability and eye-candy.

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

* Re: DMA to/from user buffers
  2001-09-04 14:45 DMA to/from user buffers Sebastian Heidl
  2001-09-04 19:30 ` Gerd Knorr
@ 2001-09-05  7:51 ` Helge Hafting
  1 sibling, 0 replies; 3+ messages in thread
From: Helge Hafting @ 2001-09-05  7:51 UTC (permalink / raw)
  To: Sebastian Heidl, linux-kernel

Sebastian Heidl wrote:
> 
> Hi,
> 
> two questions about using an user-supplied buffer (e.g. malloced
> in user space) for DMA transfers:
> 
> 1. Is it possible ?
> 2. What restrictions/requirements apply for the buffer (alignment...) ?

There are some obvious problems with this.  First, a malloc'ed
buffer might not be in memory.  It might not be created yet if you
haven't touched it, and it might be on swap if you have.  

The recommended way is to allocate in the kernel, (probably by
the driver that want to do DMA), and mmap this buffer into
userspace.  

Helge Hafting

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

end of thread, other threads:[~2001-09-05  7:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-09-04 14:45 DMA to/from user buffers Sebastian Heidl
2001-09-04 19:30 ` Gerd Knorr
2001-09-05  7:51 ` Helge Hafting

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox