linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Grant Erickson <marathon96@gmail.com>
To: <dedekind1@gmail.com>, Stefano Babic <sbabic@denx.de>
Cc: linux-mtd@lists.infradead.org,
	Bastian Ruppert <bastian.ruppert@sewerin.de>
Subject: Re: ubiformat: libmt error (side effect from last Large Buffer Allocations patch)
Date: Tue, 26 Apr 2011 08:44:38 -0700	[thread overview]
Message-ID: <C9DC3676.28755%marathon96@gmail.com> (raw)
In-Reply-To: <1303807043.2778.45.camel@localhost>

On 4/26/11 1:37 AM, Artem Bityutskiy wrote:
> On Tue, 2011-04-26 at 08:56 +0200, Stefano Babic wrote:
>> I have seen a side effect introduced with Grant's patch. I have applied
>> the patchset and this fix the allocation problem in kernel.
> 
> I think it would be great to actually CC grant :-) So, this e-mail is
> about this patch:
> 
> http://lists.infradead.org/pipermail/linux-mtd/2011-April/034818.html
> 
> Grant, the original e-mail from Stefano:
> http://lists.infradead.org/pipermail/linux-mtd/2011-April/035190.html
> 
>> However, the result lenght can be an odd multiple of the minimum I/O
>> size, and when there is not enough memory available, the introduced
>> mtd_malloc_up_to_size() tries to allocate half the amount of requested
>> size, getting a buffer not aligned with the minimum I/O size. The result
>> is that the test in nand_base.c for the alignment fails:
> 
> Good catch! Shame on me to not foresee this issue. Thanks for reporting!
> 
>> IMHO mtd_malloc_up_to_size() must allocate a buffer aligned with the
>> minimum I/O size. What about adding the I/O size as parameter to
>> mtd_malloc_up_to_size, so the function will return always an aligned
>> buffer ?
> 
> Yes, I think this is the right solution. I've cooked the following
> patch, compile-tested only - please review and test.
> 
> 
> From 18d93dac176025defd5711b429acd91ef8563a9a Mon Sep 17 00:00:00 2001
> From: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
> Date: Tue, 26 Apr 2011 11:42:10 +0300
> Subject: [PATCH] mtd: a fix candidate for mtd_kmalloc_up_to

Artem:

Thanks for adding me to the thread. Agree that the proposed patch seems like
a good solution.

Best,

Grant

      parent reply	other threads:[~2011-04-26 15:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-26  6:56 ubiformat: libmt error (side effect from last Large Buffer Allocations patch) Stefano Babic
2011-04-26  8:37 ` Artem Bityutskiy
2011-04-26 10:45   ` Stefano Babic
2011-04-28 16:33     ` Artem Bityutskiy
2011-04-26 15:44   ` Grant Erickson [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=C9DC3676.28755%marathon96@gmail.com \
    --to=marathon96@gmail.com \
    --cc=bastian.ruppert@sewerin.de \
    --cc=dedekind1@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=sbabic@denx.de \
    /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).