mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Andrianov, Vitaly" <vitalya@ti.com>
To: Michal Nazarewicz <mina86@mina86.com>,
	"m.szyprowski@samsung.com" <m.szyprowski@samsung.com>,
	"kyungmin.park@samsung.com" <kyungmin.park@samsung.com>,
	"arnd@arndb.de" <arnd@arndb.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-keystone@list.ti.com - Linux developers for Keystone
	family of devices (May contain non-TIers)"
	<linux-keystone@list.ti.com>
Cc: "Chemparathy, Cyril" <cyril@ti.com>
Subject: RE: [PATCH] drivers: cma: fix addressing on PAE machines
Date: Fri, 30 Nov 2012 20:33:52 +0000	[thread overview]
Message-ID: <C279DA448D408F43B343F09155C1EE9B0C223C7E@DFLE09.ent.ti.com> (raw)
In-Reply-To: <xa1tk3t36sq4.fsf@mina86.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 3086 bytes --]



> -----Original Message-----
> From: Michal Nazarewicz [mailto:mpn@google.com] On Behalf Of Michal
> Nazarewicz
> Sent: Friday, November 30, 2012 10:01 AM
> To: Andrianov, Vitaly; m.szyprowski@samsung.com;
> kyungmin.park@samsung.com; arnd@arndb.de; linux-kernel@vger.kernel.org;
> linux-keystone@list.ti.com - Linux developers for Keystone family of
> devices (May contain non-TIers)
> Cc: Andrianov, Vitaly; Chemparathy, Cyril
> Subject: Re: [PATCH] drivers: cma: fix addressing on PAE machines
> 
> 
> On Fri, Nov 30 2012, Vitaly Andrianov <vitalya@ti.com> wrote:
> > This patch fixes a couple of bugs that otherwise impair CMA
> > functionality on PAE machines:
> >
> >   - alignment must be a 64-bit type when running on systems with 64-
> bit
> >     physical addresses.  If this is not the case, the limit
> calculation thunks
> >     allocations down to an address range < 4G.
> >
> >   - The allocated range check is removed. On 32bit ARM kernel with
> LPAE
> >     enabled the base may be allocated outside the fist 4GB of
> physical
> >     memory (keystone SoC for example).
> >
> > Signed-off-by: Vitaly Andrianov <vitalya@ti.com>
> > Signed-off-by: Cyril Chemparathy <cyril@ti.com>
> 
> To be consistent, you should also change the type in:
> 
> static long size_cmdline = -1;
> static const unsigned long size_bytes = CMA_SIZE_MBYTES * SZ_1M; static
> unsigned long __init __maybe_unused cma_early_percent_memory(void)
> 
> and in
> 
> void __init dma_contiguous_reserve(phys_addr_t limit)
> 

Can you elaborate why we need to change type for size? 

> > ---
> >  drivers/base/dma-contiguous.c |    6 +-----
> >  1 file changed, 1 insertion(+), 5 deletions(-)
> >
> > diff --git a/drivers/base/dma-contiguous.c
> > b/drivers/base/dma-contiguous.c index 9a14694..7936b2e 100644
> > --- a/drivers/base/dma-contiguous.c
> > +++ b/drivers/base/dma-contiguous.c
> > @@ -234,7 +234,7 @@ int __init dma_declare_contiguous(struct device
> *dev, unsigned long size,
> >  				  phys_addr_t base, phys_addr_t limit)  {
> >  	struct cma_reserved *r = &cma_reserved[cma_reserved_count];
> > -	unsigned long alignment;
> > +	phys_addr_t alignment;
> >
> >  	pr_debug("%s(size %lx, base %08lx, limit %08lx)\n", __func__,
> >  		 (unsigned long)size, (unsigned long)base, @@ -271,10 +271,6
> @@ int
> > __init dma_declare_contiguous(struct device *dev, unsigned long size,
> >  		if (!addr) {
> >  			base = -ENOMEM;
> >  			goto err;
> > -		} else if (addr + size > ~(unsigned long)0) {
> > -			memblock_free(addr, size);
> > -			base = -EINVAL;
> > -			goto err;
> >  		} else {
> >  			base = addr;
> >  		}
> > --
> > 1.7.9.5
> >
> 
> --
> Best regards,                                         _     _
> .o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
> ..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
> ooo +----<email/xmpp: mpn@google.com>--------------ooO--(_)--Ooo--

Thanks,
Vitaly
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

  reply	other threads:[~2012-11-30 20:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-30 12:58 Vitaly Andrianov
2012-11-30 15:00 ` Michal Nazarewicz
2012-11-30 20:33   ` Andrianov, Vitaly [this message]
2012-11-30 20:47     ` Michal Nazarewicz

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=C279DA448D408F43B343F09155C1EE9B0C223C7E@DFLE09.ent.ti.com \
    --to=vitalya@ti.com \
    --cc=arnd@arndb.de \
    --cc=cyril@ti.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-keystone@list.ti.com \
    --cc=m.szyprowski@samsung.com \
    --cc=mina86@mina86.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

all inboxes | Powered by JetHome®