linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Shaohui Xie <Shaohui.Xie@freescale.com>
Cc: Mingkai Hu <Mingkai.hu@freescale.com>,
	linuxppc-dev@lists.ozlabs.org,
	Chen Yuanquan <B41889@freescale.com>
Subject: Re: [PATCH] powerpc/mm: add ZONE_NORMAL zone for 64 bit kernel
Date: Mon, 23 Jul 2012 16:06:09 +1000	[thread overview]
Message-ID: <1343023569.2957.19.camel@pasglop> (raw)
In-Reply-To: <1342786906-12634-1-git-send-email-Shaohui.Xie@freescale.com>

On Fri, 2012-07-20 at 20:21 +0800, Shaohui Xie wrote:
> PowerPC platform only supports ZONE_DMA zone for 64bit kernel, so all the
> memory will be put into this zone. If the memory size is greater than
> the device's DMA capability and device uses dma_alloc_coherent to allocate
> memory, it will get an address which is over the device's DMA addressing,
> the device will fail.
> 
> So we split the memory to two zones by adding a zone ZONE_NORMAL, since
> we already allocate PCICSRBAR/PEXCSRBAR right below the 4G boundary (if the
> lowest PCI address is above 4G), so we constrain the DMA zone ZONE_DMA
> to 2GB, also, we clear the flag __GFP_DMA and set it only if the device's
> dma_mask < total memory size. By doing this, devices which cannot DMA all
> the memory will be limited to ZONE_DMA, but devices which can DMA all the
> memory will not be affected by this limitation.

This is wrong. Don't you have an iommu do deal with those devices
anyway ? What about swiotlb ?

If you *really* need to honor 32 (or 31 even) bit DMAs, what you -may-
want to do is create a ZONE_DMA32 like other architectures, do not
hijack the historical ZONE_DMA.

But even then, I'm dubious this is really needed.

Cheers,
Ben.

  reply	other threads:[~2012-07-23  6:06 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-20 12:21 [PATCH] powerpc/mm: add ZONE_NORMAL zone for 64 bit kernel Shaohui Xie
2012-07-23  6:06 ` Benjamin Herrenschmidt [this message]
2012-07-23 16:17   ` Scott Wood
2012-07-23 22:20     ` Benjamin Herrenschmidt
2012-07-23 23:08       ` Tabi Timur-B04825
2012-07-23 23:12         ` Benjamin Herrenschmidt
2012-07-23 23:15           ` Timur Tabi
2012-07-23 23:29             ` Benjamin Herrenschmidt
2012-07-23 23:30               ` Benjamin Herrenschmidt
2012-07-24  1:37                 ` Scott Wood
2012-07-23 23:36               ` Timur Tabi
2012-07-24  3:08                 ` Benjamin Herrenschmidt
2012-07-24  3:52                   ` Tabi Timur-B04825
2012-07-24  3:59                   ` Zang Roy-R61911
2012-07-24  4:04                   ` Tabi Timur-B04825
2012-07-24  4:45                     ` Benjamin Herrenschmidt
2012-07-24  8:01                       ` Bhushan Bharat-R65777
2012-07-24  1:49       ` Scott Wood

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=1343023569.2957.19.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=B41889@freescale.com \
    --cc=Mingkai.hu@freescale.com \
    --cc=Shaohui.Xie@freescale.com \
    --cc=linuxppc-dev@lists.ozlabs.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).