public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v1] fs: fat: dynamically allocate memory for temporary buffer
Date: Thu, 6 Dec 2018 11:06:46 -0500	[thread overview]
Message-ID: <20181206160646.GC32109@bill-the-cat> (raw)
In-Reply-To: <c2037134c283cafc0be83e60c75502ff@agner.ch>

On Thu, Dec 06, 2018 at 04:45:08PM +0100, Stefan Agner wrote:
> On 06.12.2018 16:13, Tom Rini wrote:
> > On Thu, Dec 06, 2018 at 02:58:52PM +0100, Stefan Agner wrote:
> > 
> >> From: Stefan Agner <stefan.agner@toradex.com>
> >>
> >> Drop the statically allocated get_contents_vfatname_block and
> >> dynamically allocate a buffer only if required. This saves
> >> 64KiB of memory.
> >>
> >> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
> > 
> > Is there a particular issue you're running into here, or just that what
> > we're doing is just generally not a great idea?  I ask since I need to
> > poke git history to make sure that the thing at the back of my mind
> > about us needing to do this for some annoying boot case is intentional.
> 
> I was in the process checking large global variables since I had issues
> on a target with limited SRAM (used pre-relocation). I only after
> writing this patch I realized that the space for the .bss section is not
> required pre-relocation, so the patch did not help in my particular
> case.
> 
> That said, in git history I saw that get_contents_vfatname_block has
> been used more broadly in earlier FAT implementations. Now it is only
> used to handle a corner case: when loading from a file with an offset...
> I guess the .bss section is cleared, so we probably safe 64KiB of
> zeroing out... I feel it is still worth doing the change, but I don't
> have a really strong feeling.

Thanks for checking.  Yes, this is probably a good thing to do overall
and whatever historical reason we needed it like this isn't applicable
now if we're doing offset loading only in this case which isn't an SPL
thing anyhow.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181206/134eabdf/attachment.sig>

  reply	other threads:[~2018-12-06 16:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-06 13:58 [U-Boot] [PATCH v1] fs: fat: dynamically allocate memory for temporary buffer Stefan Agner
2018-12-06 14:42 ` Lukasz Majewski
2018-12-06 15:13 ` Tom Rini
2018-12-06 15:45   ` Stefan Agner
2018-12-06 16:06     ` Tom Rini [this message]
2018-12-06 15:46 ` Stefan Agner

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=20181206160646.GC32109@bill-the-cat \
    --to=trini@konsulko.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