All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Jonas Bonn <jonas@southpole.se>
Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org
Subject: Re: [PATCH v2 07/19] OpenRISC: DMA
Date: Fri, 8 Jul 2011 09:44:30 +0200	[thread overview]
Message-ID: <201107080944.30330.arnd@arndb.de> (raw)
In-Reply-To: <1310110579.3073.19.camel@jerome>

On Friday 08 July 2011 09:36:19 Jonas Bonn wrote:
> I put a bit more thought into what we actually need for DMA and came up
> with the implementation in this patch.  This is a lot simpler than what
> we had before, but it seems to fit nicely with the model that we have.
> 
> The jist of it is that allocation of coherent memory just needs to
> return pages with the cache-inhibit bit set so we now:
> 
> i)   call __get_free_pages (via alloc_pages_exact)
> ii)  set the CI bit on those pages
> iii) flush the pages from cache
> 
> This should mean that we don't have any conflicting page table entries
> for these pages anymore.
> 
> I'd appreciate if you could look over this implementation to make sure
> I haven't missed anything fundamental.

Looks ok to me. A few more points for future optimization though:

* If your CPU can do different page sizes, you should make the kernel
  mapping use the largest possible page size. This will however make
  the dma mapping part much harder.

* If you ever want to map a frame buffer with this, you should
  add a write-combining mapping type, uncached accesses are really
  slow.

* Cache coherency is good. If you can make the hardware do cache-coherent
  DMA, then just use cacheable pages for alloc_coherent.

	Arnd

  reply	other threads:[~2011-07-08  7:45 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-02 21:15 OpenRISC Architecture: Patch set version 2 Jonas Bonn
2011-07-02 21:15 ` [PATCH v2 01/19] OpenRISC: Boot code Jonas Bonn
2011-07-02 21:15 ` [PATCH v2 02/19] OpenRISC: Device tree Jonas Bonn
2011-07-03 18:07   ` Segher Boessenkool
2011-07-03 20:51   ` Grant Likely
     [not found]     ` <CACxGe6tFX=EQjaL-4EjSXquY5eh+bca29=d=cE5-YAVCUVRCvA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-07-03 21:39       ` Benjamin Herrenschmidt
2011-07-03 21:39         ` Benjamin Herrenschmidt
2011-07-04  4:58     ` Jonas Bonn
2011-07-04  4:58       ` Jonas Bonn
2011-07-04  5:35       ` Grant Likely
2011-07-02 21:15 ` [PATCH v2 03/19] OpenRISC: Memory management Jonas Bonn
2011-07-02 21:15 ` [PATCH v2 04/19] OpenRISC: Signal handling Jonas Bonn
2011-07-02 21:15 ` [PATCH v2 05/19] OpenRISC: Build infrastructure Jonas Bonn
2011-07-02 21:15 ` [PATCH v2 06/19] OpenRISC: PTrace Jonas Bonn
2011-07-03 19:40   ` Marcin Slusarz
2011-07-05 15:42   ` Arnd Bergmann
2011-07-05 16:05     ` Jonas Bonn
2011-07-05 16:42       ` Arnd Bergmann
2011-07-02 21:15 ` [PATCH v2 07/19] OpenRISC: DMA Jonas Bonn
2011-07-05 15:37   ` Arnd Bergmann
2011-07-08  7:36     ` Jonas Bonn
2011-07-08  7:36       ` Jonas Bonn
2011-07-08  7:44       ` Arnd Bergmann [this message]
2011-07-02 21:15 ` [PATCH v2 08/19] OpenRISC: Timekeeping Jonas Bonn
2011-07-02 21:15 ` [PATCH v2 09/19] OpenRISC: IRQ Jonas Bonn
2011-07-02 21:15 ` [PATCH v2 10/19] OpenRISC: System calls Jonas Bonn
2011-07-05 15:39   ` Arnd Bergmann
2011-07-02 21:15 ` [PATCH v2 11/19] OpenRISC: Idle/Power management Jonas Bonn
2011-07-02 21:15 ` [PATCH v2 12/19] OpenRISC: Scheduling/Process management Jonas Bonn
2011-07-02 21:15 ` [PATCH v2 13/19] OpenRISC: GPIO Jonas Bonn
2011-07-02 21:15 ` [PATCH v2 14/19] OpenRISC: Module support Jonas Bonn
2011-07-02 21:15 ` [PATCH v2 15/19] OpenRISC: Traps Jonas Bonn
2011-07-02 21:15 ` [PATCH v2 16/19] OpenRISC: Headers Jonas Bonn
2011-07-02 21:15 ` [PATCH v2 17/19] OpenRISC: Library routines Jonas Bonn
2011-07-02 21:15 ` [PATCH v2 18/19] OpenRISC: Miscellaneous Jonas Bonn
2011-07-02 21:15 ` [PATCH v2 19/19] OpenRISC: Add MAINTAINERS entry Jonas Bonn
2011-07-05 15:56 ` OpenRISC Architecture: Patch set version 2 Arnd Bergmann
2011-07-06 15:51   ` linux-next inclusion request: OpenRISC architecture Jonas Bonn
2011-07-16  3:55     ` Stephen Rothwell
     [not found]     ` <20110707163231.ebc75eef6be02f5490c949d7@canb.auug.org.au>
     [not found]       ` <201107071305.02061.arnd@arndb.de>
2011-07-16  4:01         ` arm-soc tree inclusion Stephen Rothwell

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=201107080944.30330.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=jonas@southpole.se \
    --cc=linux-arch@vger.kernel.org \
    --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 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.