public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] cmd_sf: Fix problem with "sf update" and unaligned length
Date: Mon, 12 Jan 2015 22:12:29 +0100	[thread overview]
Message-ID: <20150112211229.CBA60384DF9@gemini.denx.de> (raw)
In-Reply-To: <54B380C2.4050208@keymile.com>

Dear Gerlando Falauto,

In message <54B380C2.4050208@keymile.com> you wrote:
> 
> That's right, and that's the whole point: cmp_buf points to the data 
> read from the flash sector before erasing it, because that's what we 
> want to keep (by re-writing it).
> The first part, however, we overwrite with the new data (buf).
> So there's nothing to erase.

Well, if we have only a partially filled buffer, then there is some
remainder which is left over from previous use.  This should not make
it to external storage.  If you write any additional bytes, these
should be known-to-be-harmless content, say all 0x00 or 0xFF bytes,
but never any data that just happen to be there.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
For every complex problem, there is a solution that is simple,  neat,
and wrong.                                           -- H. L. Mencken

  reply	other threads:[~2015-01-12 21:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-09 13:39 [U-Boot] [PATCH] cmd_sf: Fix problem with "sf update" and unaligned length Stefan Roese
2015-01-12  7:17 ` Wolfgang Denk
2015-01-12  7:27   ` Stefan Roese
2015-01-12  8:07     ` Gerlando Falauto
2015-01-12 21:12       ` Wolfgang Denk [this message]
2015-01-12 21:10     ` Wolfgang Denk
2015-01-13  6:05       ` Stefan Roese
2015-04-22 11:11         ` Jagan Teki
2015-04-22 11:15           ` Stefan Roese
2015-04-22 11:26             ` Jagan Teki
2015-01-12  7:51 ` Gerlando Falauto
2015-01-12  7:56   ` Stefan Roese
2015-01-12  8:12     ` Gerlando Falauto

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=20150112211229.CBA60384DF9@gemini.denx.de \
    --to=wd@denx.de \
    --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