From: Jerry Van Baren <gerald.vanbaren@smiths-aerospace.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH v3] Fix initrd length miscalculation in bootm command when using a dtu
Date: Fri, 04 May 2007 10:22:09 -0400 [thread overview]
Message-ID: <463B4191.1000706@smiths-aerospace.com> (raw)
In-Reply-To: <200705041546.13452.sr@denx.de>
Stefan Roese wrote:
> Hi Timur,
>
> On Friday 04 May 2007 15:25, Timur Tabi wrote:
>> I'm glad you fixed the bug, so I'll just add a few comments:
>>> Your comment is actually wrong. The use of "len" is not limited to
>>> that purpose.
>> If you apply my patch, then the comment becomes correct. My goal was to
>> lock the variables 'len' and 'data' into one purpose. The reason the
>> bug existed is because the other developer didn't realize this. He used
>> 'len' thinking it was available. In a sense, I was trying to implement
>> some "defensive programming", so that the next time someone hacks up
>> do_bootm_linux(), he won't re-introduce the bug.
>>
>> Now, you might say that that won't happen again, but I disagree. I
>> think it can, for two reasons:
>>
>> 1) It happened once already, last year. You approved and applied a
>> patch which does overwrite the variable.
>>
>> 2) The libfdt code introduced a number of other bugs relating to dtu
>> usage, which have not yet been fixed.
>>
>> So I believe there is a real possibility that another patch could
>> re-introduce this bug. If you had applied my patch as-is, that
>> possibility would have been eliminated. This is why I think my patch is
>> better than yours.
>>
>> But I guess only time will tell who's right. :-)
>
> You have a point with your variable usage "restriction", and Wolfgang has a
> point with the "readability" of your patch as it doesn't really tell what is
> fixed without read the current source. Could be that your implementation is
> the "better" one, but the patch Wolfgang applied was just less intrusive.
>
>>> And please accept my apologies thatt his was so complicated and took
>>> so long. [Nevertheless you still might want to try to find a way to
>>> access the repository I created for you in case you have more
>>> patches.]
>> Stefan said he had a testing repo of some kind. How about we just use
>> that? If Stefan is willing, he can apply my emailed patches to his repo.
>
> No, we shouldn't "fork" the code here. Let's focus on the other open issues.
> You mention other bugs introduced by the libfdt code above. ;-)
>
> Best regards,
> Stefan
Timur has sent me two libfdt/dtu-related fixes
* fdt_copy_into() had the source and destination addresses reversed
* fdt_check_header() had the wrong sense on ==/!= 0
which I applied to my local repo last night and will push back to
u-boot-fdt soon (I still have not been successful in figuring out how to
make a multi-image to test the changes grrrr). The two bugs I
introduced in the conversion to libfdt were unrelated to the "len"
variable, but I probably replicated the "len" bug when I duplicated and
modified the original code. I will pull Wolfgang's fix tonight and see
what needs to be done to make all three bugs go away.
WRT to building a multi-image, I'm looking to combine linux, a dtb, and
an initrd into a single image to test that path of bootm (the path I had
the above screwups in).
Timur's hint for me was:
> mkimage -A ppc -T flat_dt -C none -d mpc836x_mds.dtb mpc836x_mds.dtu
>
> This, of course, creates a dtu with a value of 0 for ih_load. You
> probably need to specify -a or -e to set that field.
but I don't understand how to build an image with all three pieces in it
(I tried to use the ":" in the -d source parameter and mkimage just got
confused, couldn't find the files). Am I expecting too much??? Should
I just be wrapping the three pieces individually and loading them
separately? What exactly are you doing to test this, Timur?
Best regards,
gvb
next prev parent reply other threads:[~2007-05-04 14:22 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-03 22:30 [U-Boot-Users] [PATCH v3] Fix initrd length miscalculation in bootm command when using a dtu Timur Tabi
2007-05-03 23:47 ` Wolfgang Denk
2007-05-04 1:13 ` Timur Tabi
2007-05-04 8:28 ` Wolfgang Denk
2007-05-04 13:25 ` Timur Tabi
2007-05-04 13:46 ` Stefan Roese
2007-05-04 14:22 ` Jerry Van Baren [this message]
2007-05-04 16:02 ` Timur Tabi
2007-05-04 16:07 ` Jerry Van Baren
2007-05-04 15:57 ` Timur Tabi
2007-05-04 16:27 ` Wolfgang Denk
2007-05-04 16:32 ` Timur Tabi
2007-05-04 19:28 ` Wolfgang Denk
2007-05-04 19:40 ` Timur Tabi
2007-05-04 21:58 ` Timur Tabi
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=463B4191.1000706@smiths-aerospace.com \
--to=gerald.vanbaren@smiths-aerospace.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