All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Russell King <rmk+lkml@arm.linux.org.uk>
Cc: Linus Torvalds <torvalds@osdl.org>,
	Jeff Garzik <jgarzik@pobox.com>,
	Matt Porter <mporter@kernel.crashing.org>,
	Jamey Hicks <jamey.hicks@hp.com>, Ian Molton <spyro@f2s.com>,
	linux-kernel@vger.kernel.org, greg@kroah.com, tony@atomide.com,
	david-b@pacbell.net, joshua@joshuawise.com
Subject: Re: DMA API issues
Date: Wed, 23 Jun 2004 17:36:57 +0200	[thread overview]
Message-ID: <s5hbrjajnfq.wl@alsa2.suse.de> (raw)
In-Reply-To: <20040623133423.B27549@flint.arm.linux.org.uk>

At Wed, 23 Jun 2004 13:34:23 +0100,
Russell King wrote:
> 
> On Tue, Jun 22, 2004 at 12:40:45PM +0200, Takashi Iwai wrote:
> > At Mon, 21 Jun 2004 20:26:39 -0700 (PDT),
> > Linus Torvalds wrote:
> > > 
> > > On Mon, 21 Jun 2004, Linus Torvalds wrote:
> > > > 
> > > > The argument at some point was that some architectures may not even _have_
> > > > a "struct page" for DMA memory, since it's not "normal" memory (ie "slow
> > > > memory" on m68k). However, I thought we all agreed that such a "struct
> > > > page" could be furnished if that architecture wants so support mmap'ing.
> > > 
> > > .. which is not to say that we shouldn't have a "pci_mmap_pages()" thing
> > > _too_. Pretty clearly the easiest interface often is to just map the pages
> > > at mmap() time, and then we should just have a helper function to do that. 
> > > 
> > > I thought we did one already, but hey, maybe not.
> > 
> > I don't think we have such.
> > 
> > Russell has once proposed a similar one (but not pci-specific), and I
> > believe it makes sense for many drivers.  We can hide the
> > architecture-specific cache handling inside the helper function, too.
> 
> Ok.  So does anyone have any objections if I push the ARM DMA mmap
> interface upstream, which consists of:
> 
> /**
>  * dma_mmap_coherent - map a coherent DMA allocation into user space
>  * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
>  * @vma: vm_area_struct describing requested user mapping
>  * @cpu_addr: kernel CPU-view address returned from dma_alloc_coherent
>  * @handle: device-view address returned from dma_alloc_coherent
>  * @size: size of memory originally requested in dma_alloc_coherent
>  *
>  * Map a coherent DMA buffer previously allocated by dma_alloc_coherent
>  * into user space.  The coherent DMA buffer must not be freed by the
>  * driver until the user space mapping has been released.
>  */
> int dma_mmap_coherent(struct device *dev, struct vm_area_struct *vma,
>                       void *cpu_addr, dma_addr_t handle, size_t size);

This looks easy to use for me.


> and a similar one for the ARM-specific "write combining" case (for
> framebuffers utilising the DMA API)?

pgprot_noncached() is used on many other architectures in fbmem.c
(well, not really, but the result is identical).
Should it be provided as another one, or is it used as default in
dma_mmap_coherent()?

Also, it would be nice to have a version for sg-buffer, too.


Takashi

  reply	other threads:[~2004-06-23 15:37 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-18 16:59 DMA API issues Ian Molton
2004-06-18 18:07 ` Matt Porter
2004-06-18 18:19   ` Ian Molton
2004-06-18 18:58     ` Matt Porter
2004-06-18 18:33   ` Jamey Hicks
2004-06-18 19:21     ` Matt Porter
2004-06-18 19:43       ` Russell King
2004-06-21 13:35         ` Takashi Iwai
2004-06-21 23:08           ` Russell King
2004-06-22  2:06             ` Jeff Garzik
2004-06-22  3:18               ` Linus Torvalds
2004-06-22  3:26                 ` Linus Torvalds
2004-06-22 10:40                   ` Takashi Iwai
2004-06-23 12:34                     ` Russell King
2004-06-23 15:36                       ` Takashi Iwai [this message]
2004-06-23 15:44                         ` Russell King
2004-06-23 16:01                           ` Takashi Iwai
2004-06-23 16:10                             ` Russell King
2004-06-22 10:48             ` Takashi Iwai
2004-06-18 19:48       ` Jamey Hicks
2004-06-18 21:08 ` Jeff Garzik
2004-06-18 22:12   ` Richard B. Johnson
2004-06-18 23:27     ` Ian Molton
2004-06-18 23:26   ` Ian Molton
2004-06-18 23:30     ` James Bottomley
2004-06-18 23:32       ` Jeff Garzik
     [not found]         ` <20040619005714.37b68453.spyro@f2s.com>
     [not found]           ` <40D3838B.2070608@pobox.com>
     [not found]             ` <20040619011621.4491600a.spyro@f2s.com>
     [not found]               ` <40D3872F.5010007@pobox.com>
2004-06-19  0:34                 ` Ian Molton
2004-06-19 21:15                   ` Tony Lindgren
  -- strict thread matches above, loose matches on Subject: below --
2004-06-18 18:20 James Bottomley
2004-06-18 18:35 ` Ian Molton
2004-06-18 18:52   ` James Bottomley
2004-06-18 18:57     ` Ian Molton
2004-06-18 19:20       ` David Brownell
2004-06-18 19:44         ` Ian Molton
2004-06-18 19:57           ` James Bottomley
2004-06-18 21:08             ` David Brownell
2004-06-18 21:14               ` James Bottomley
2004-06-18 22:38                 ` David Brownell
2004-06-18 23:07                   ` James Bottomley
2004-06-18 23:31                     ` Ian Molton
2004-06-19 18:23                     ` David Brownell
2004-06-19 20:41                       ` Russell King
2004-06-19 21:46                         ` James Bottomley
2004-06-19 22:49                           ` Ian Molton
2004-06-20 13:37                             ` James Bottomley
2004-06-20 15:50                               ` Ian Molton
2004-06-20 16:26                                 ` Jeff Garzik
2004-06-20 16:57                                   ` Ian Molton
2004-06-20 20:15                                   ` David Brownell
2004-06-20 16:46                                 ` James Bottomley
2004-06-20 18:02                                   ` Oliver Neukum
2004-06-20 19:27                                     ` James Bottomley
2004-06-20 19:34                                       ` Oliver Neukum
2004-06-20 20:07                                   ` David Brownell
2004-06-20 20:18                               ` David Brownell
2004-06-20 20:02                         ` David Brownell
2004-06-18 23:25             ` Ian Molton
2004-06-18 23:29               ` James Bottomley
2004-06-18 23:51                 ` Ian Molton
2004-06-19  0:04                   ` James Bottomley
2004-06-19  0:14                     ` Ian Molton
2004-06-19  3:49                       ` James Bottomley
2004-06-20 20:59                         ` Jamey Hicks
2004-06-18 19:30       ` James Bottomley
2004-06-18 19:56         ` Ian Molton
2004-06-18 19:22     ` Jamey Hicks
2004-06-18 19:41       ` James Bottomley
2004-06-18 20:02         ` Oliver Neukum
2004-06-18 20:07           ` James Bottomley
2004-06-18 20:14       ` Benjamin Herrenschmidt
2004-06-18 20:24         ` James Bottomley
2004-06-18 21:20           ` Russell King
2004-06-18 23:20             ` Ian Molton
2004-06-20 18:25               ` Deepak Saxena

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=s5hbrjajnfq.wl@alsa2.suse.de \
    --to=tiwai@suse.de \
    --cc=david-b@pacbell.net \
    --cc=greg@kroah.com \
    --cc=jamey.hicks@hp.com \
    --cc=jgarzik@pobox.com \
    --cc=joshua@joshuawise.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mporter@kernel.crashing.org \
    --cc=rmk+lkml@arm.linux.org.uk \
    --cc=spyro@f2s.com \
    --cc=tony@atomide.com \
    --cc=torvalds@osdl.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.