From: Tom Rini Date: Wed, 12 Mar 2014 17:05:34 -0400 Subject: [U-Boot] [U-Boot, 2/2] fw_env: correct writes to devices with small erase blocks In-Reply-To: <1394167703-11797-3-git-send-email-dustin@cumulusnetworks.com> References: <1394167703-11797-3-git-send-email-dustin@cumulusnetworks.com> Message-ID: <20140312210534.GK16805@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, Mar 06, 2014 at 08:48:23PM -0800, Dustin Byford wrote: > Some NOR flash devices have a small erase block size. For example, the > Micron N25Q512 can erase in 4K blocks. These devices expose a bug in > fw_env.c where flash_write_buf() incorrectly calculates bytes written > and attempts to write past the environment sectors. Luckily, a range > check prevents any real damage, but this does cause fw_setenv to fail > with an error. > > This change corrects the write length calculation. > > The bug was introduced with commit 56086921 from 2008 and only affects > configurations where the erase block size is smaller than the total > environment data size. > > Signed-off-by: Dustin Byford Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: