From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] fsl: board EEPROM has the CRC in the wrong location
Date: Fri, 13 Jul 2012 16:45:04 -0500 [thread overview]
Message-ID: <500096E0.9010406@freescale.com> (raw)
In-Reply-To: <20120713212501.4C8132000F2@gemini.denx.de>
On 07/13/2012 04:25 PM, Wolfgang Denk wrote:
> Dear Tabi Timur-B04825,
>
> In message <50001038.50303@freescale.com> you wrote:
>>>
>> York is mistaken. The CRC was always at location 0xFC, but for some
>> reason, when I wrote the code, I put it at 0xCC. Now I'm fixing it, and
>> providing some backwards compatibility to avoid causing problems for
>> people who upgrade U-Boot on existing boards. I don't see how this is
>> controversial in any way.
>
> In case you have an EEPROM with correct layout (CRC at 0xFC) but
> incorrect CRC, you will access random data and interpret this as CRC.
> This is provoking undefined behaviour.
>
> Yes, it is inlikely that you happen to find a matching CRC in such a
> case, but it is possible.
>
> Undefined behaviour is something you must avoid.
Is it any more likely that this will happen, than that you'll see
arbitrary data accidentally match a magic number that identifies a data
format?
> If you want, then rather provide an update tool that theuser can use
> (manually!) to update, but this should be done once, and with explicit
> confirmation from the user, never automagically.
In the real world, this will result in more problems than Timur's
approach (even if the "problems" are just increased support burden from
users asking why ethernet isn't working any more). The odds of a user
screwing up (or simply not being aware that this update of U-Boot
requires special migration steps) is much more than one in four billion.
Perhaps this could be limited to boards that are known to have had the
bug in the past?
Timur, I know you said you don't control the format, but could you ask
for a version number bump so that going forward there's a way to
unambiguously mark the contents as "good" (the spec wouldn't change, but
there would be no known implementations of v2 with this bug)?
If not, and Wolfgang still refuses to accept this, what about checking
the old location on a CRC fail, and if the old CRC passes, don't
automatically use it but print a message telling the user that they
probably need to run the migration command?
-Scott
next prev parent reply other threads:[~2012-07-13 21:45 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-12 21:46 [U-Boot] [PATCH] fsl: board EEPROM has the CRC in the wrong location Timur Tabi
2012-07-12 22:03 ` sun york-R58495
2012-07-12 22:37 ` Scott Wood
2012-07-12 22:44 ` Timur Tabi
2012-07-12 22:46 ` sun york-R58495
2012-07-12 22:49 ` Scott Wood
2012-07-12 22:52 ` Timur Tabi
2012-07-13 4:32 ` Wolfgang Denk
2012-07-13 12:11 ` Tabi Timur-B04825
2012-07-13 21:26 ` Wolfgang Denk
2012-07-13 4:30 ` Wolfgang Denk
2012-07-13 4:38 ` sun york-R58495
2012-07-13 12:12 ` Tabi Timur-B04825
2012-07-13 21:22 ` York Sun
2012-07-13 12:10 ` Tabi Timur-B04825
2012-07-13 21:25 ` Wolfgang Denk
2012-07-13 21:29 ` Timur Tabi
2012-07-13 21:32 ` Wolfgang Denk
2012-07-13 21:39 ` Timur Tabi
2012-07-13 21:45 ` Scott Wood [this message]
2012-07-13 21:53 ` Timur Tabi
2012-07-13 22:19 ` Scott Wood
2012-07-13 22:22 ` Timur Tabi
2012-07-13 22:41 ` Scott Wood
2012-07-13 22:46 ` Timur Tabi
2012-07-13 22:54 ` Scott Wood
2012-07-13 23:01 ` Wolfgang Denk
2012-07-13 23:12 ` Scott Wood
[not found] ` <C5EFF1F960B6FC4C873CF9BD5FE250210791DCC8@039-SN2MPN1-013.039d.mgd.msft.net>
2012-07-15 12:52 ` Tabi Timur-B04825
2012-07-16 19:57 ` Wolfgang Denk
2012-07-16 22:32 ` Scott Wood
2012-07-13 22:59 ` Wolfgang Denk
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=500096E0.9010406@freescale.com \
--to=scottwood@freescale.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