public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: Russell King <rmk+lkml@arm.linux.org.uk>
Cc: James Bottomley <James.Bottomley@steeleye.com>,
	Ian Molton <spyro@f2s.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	greg@kroah.com, tony@atomide.com, jamey.hicks@hp.com,
	joshua@joshuawise.com
Subject: Re: DMA API issues
Date: Sun, 20 Jun 2004 13:02:30 -0700	[thread overview]
Message-ID: <40D5ED56.4060409@pacbell.net> (raw)
In-Reply-To: <20040619214126.C8063@flint.arm.linux.org.uk>

Russell King wrote:
> On Sat, Jun 19, 2004 at 11:23:23AM -0700, David Brownell wrote:
> 
>>I'm having to guess at your point here, even from other emails.
>>You've asserted a difference, but not what it is.  Maybe it's
>>something to do with the problem's NUMA nature?  Are you for
>>some reason applying DMA _mapping_ requirements (main-memory
>>only) to the DMA memory _allocation_ problem?
> 
> ...
> 
> Currently, there are drivers which assume that it's possible that
> dma_alloc_coherent memory is backed by system memory, which has
> page structures associated with each page.  For this "new" memory,
> there are no such page structures, so things like bus_to_virt()
> don't work on them (not that they were guaranteed to work on a

This shouldn't include the USB stack, FWIW; nothing in drivers/usb
makes such calls (on 2.6).  The device drivers don't have any
reason to use such calls, either.


> In addition, the ARM implementation of dma_alloc_coherent()
> implicitly believes in struct page pointers - they're a fundamental
> properly of the way that has been implemented, so any deviation from
> "memory with struct page" means more or less a rewrite this.

Or just bypassing it before it gets to __dma_alloc(), which would
be ugly but functional.  Or flagging the devices in question as
needing to use that particular memory zone ... so for example a
dma_zone(dev) macro, used with alloc_pages_node(), might be a
cleaner approach.


> I would say that, yes, from a perfectly objective view, if you are
> unable to do coherent DMA from system memory, but your system provides
> you with a totally separate memory system which does indeed provide
> coherent DMA, it seems logical to allow dma_alloc_coherent() to use
> it - at risk of breaking some drivers making incorrect assumptions.
> 
> And I don't see _that_ case as being vastly different from Ian's
> case.

That's hardly a vast difference, no!


> So, I think as long as we can ensure that drivers do not make bad
> assumptions about dma_alloc_coherent() _and_ we have a suitable DMA
> MMAP API to solve the cases where device drivers want to mmap DMA
> buffers (and they _do_ want to do this) it should be possible.

Right, and the whole USB stack should "just work" once that's done.
Subject to memory cramping for some uses!  :)


> Depending on how I look at the problem, I'm oscillating between "yes
> it should be done" (if its an overall system thing like DMA memory
> on a PCI north bridge separate from your normal system non-DMA
> memory) and "no it's out of the question."

I'm clearly on the "yes" side, though I suspect Deepak is right
that doing it very cleanly as an all-arch extension may not be
a near-term 2.6 option.

- Dave




  parent reply	other threads:[~2004-06-20 20:03 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-18 18:20 DMA API issues 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 [this message]
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-19 15:11                     ` DMA API issues... summary Ian Molton
2004-06-20 20:49                       ` Joshua Wise
2004-06-18 19:30       ` DMA API issues 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
  -- strict thread matches above, loose matches on Subject: below --
2004-06-18 16:59 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
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

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=40D5ED56.4060409@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=James.Bottomley@steeleye.com \
    --cc=greg@kroah.com \
    --cc=jamey.hicks@hp.com \
    --cc=joshua@joshuawise.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk+lkml@arm.linux.org.uk \
    --cc=spyro@f2s.com \
    --cc=tony@atomide.com \
    /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