All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@ozlabs.org, Anton Blanchard <anton@au1.ibm.com>,
	Brian J King <bjking1@us.ibm.com>
Subject: Re: [PATCH 2/3] powerpc/dma: Support 32-bit coherent mask with 64-bit dma_mask
Date: Tue, 24 Feb 2015 17:05:06 -0600	[thread overview]
Message-ID: <1424819106.4698.32.camel@freescale.com> (raw)
In-Reply-To: <1424810457.12891.49.camel@kernel.crashing.org>

On Wed, 2015-02-25 at 07:40 +1100, Benjamin Herrenschmidt wrote:
> On Tue, 2015-02-24 at 14:34 -0600, Scott Wood wrote:
> > On Fri, 2015-02-20 at 19:35 +1100, Benjamin Herrenschmidt wrote:
> > >  static u64 dma_direct_get_required_mask(struct device *dev)
> > > diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
> > > index f146ef0..a7f15e2 100644
> > > --- a/arch/powerpc/mm/mem.c
> > > +++ b/arch/powerpc/mm/mem.c
> > > @@ -277,6 +277,11 @@ int dma_pfn_limit_to_zone(u64 pfn_limit)
> > >  	return -EPERM;
> > >  }
> > >  
> > > +u64 dma_get_zone_limit(int zone)
> > > +{
> > > +	return max_zone_pfns[zone] << PAGE_SHIFT;
> > > +}
> > 
> > If you must do this in terms of bytes rather than pfn, cast to u64
> > before shifting -- and even then the result will be PAGE_SIZE - 1 too
> > small.
> 
> Do we have RAM above what a unsigned long can hold ? I think I'll just
> make it a pfn and respin...

Yes, we can have over 4 GiB RAM on 32-bit.

-Scott

      reply	other threads:[~2015-02-24 23:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-20  8:35 [PATCH 2/3] powerpc/dma: Support 32-bit coherent mask with 64-bit dma_mask Benjamin Herrenschmidt
2015-02-24 20:34 ` Scott Wood
2015-02-24 20:40   ` Benjamin Herrenschmidt
2015-02-24 23:05     ` Scott Wood [this message]

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=1424819106.4698.32.camel@freescale.com \
    --to=scottwood@freescale.com \
    --cc=anton@au1.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=bjking1@us.ibm.com \
    --cc=linuxppc-dev@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 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.