public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] env_mmc: fix buffer allocation for armv7
Date: Sun, 6 Oct 2013 16:42:14 -0400	[thread overview]
Message-ID: <20131006204214.GO15917@bill-the-cat> (raw)
In-Reply-To: <20131005195728.AE316380A3C@gemini.denx.de>

On Sat, Oct 05, 2013 at 09:57:28PM +0200, Wolfgang Denk wrote:
> Dear Tom Rini,
> 
> In message <20131004170203.GL15917@bill-the-cat> you wrote:
> > 
> > I really don't like this.  We're now allocating for example 256KiB on
> > the stack, rather than malloc.  I posted a patch recently to convert the
> > non-redundant case to malloc instead for this reason.  I believe the
> > answer is we need to be using memalign here, like
> > common/bouncebuf.c::bounce_buffer_start does.  Can you do this?  If not,
> > can you test a patch?  Thanks.
> 
> What exactly don't you like in using the stack for temporary data
> buffers?  That's what it has been invented for.  Using malloc() is
> only useful when the allocated buffers neet to be kept across file
> scope, which appears not to be the case here.
> 
> For file scope buffers, usign the satck is the most efficient and
> preferred approach - it's fast and results in minimal (virtually no)
> code.
> 
> Why do you hesitate to use the stack?

Mainly to allow us to work in restricted stack areas like SPL where we
simply may not have that much space available.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20131006/c2026da9/attachment.pgp>

  reply	other threads:[~2013-10-06 20:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-04 13:48 [U-Boot] [PATCH] env_mmc: fix buffer allocation for armv7 Markus Niebel
2013-10-04 17:02 ` Tom Rini
2013-10-05 19:57   ` Wolfgang Denk
2013-10-06 20:42     ` Tom Rini [this message]
2013-10-07  5:34       ` Wolfgang Denk
2013-10-07 12:20         ` Tom Rini
2013-10-07 13:58           ` Wolfgang Denk
2013-10-08 13:44             ` Tom Rini
2013-10-08 18:17               ` Wolfgang Denk
2013-10-11 18:27                 ` Tom Rini
2013-10-07  7:58   ` Markus Niebel
2013-10-14 20:26 ` [U-Boot] " Tom Rini

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=20131006204214.GO15917@bill-the-cat \
    --to=trini@ti.com \
    --cc=u-boot@lists.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