From: Timur Tabi <timur@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] libfdt: make fdt_increase_size() available to everyone
Date: Wed, 19 May 2010 10:34:50 -0500 [thread overview]
Message-ID: <4BF4051A.1090202@freescale.com> (raw)
In-Reply-To: <20100519151402.9066DE6D663@gemini.denx.de>
Wolfgang Denk wrote:
> I think the places where strcat() is used actually try and make sure
> to have enough room in the target buffer; also, almost all of themn
> appent static strigs with well-known sizes only.
>
> You talked about inserting user-supplied data of unknown size.
Yes and no. The data is supplied by the user, but it will also be limited
in size by a compile-time constant. In this case, the firmware should come
only from Freescale, and the limit is double the size of current firmware,
so that should be enough to handle all situations, now and in the future.
>> I could, for instance, add an lmb parameter to fdt_increase_size(), but this
>> will only apply in instances where the fdt exists inside an lmb. There is no
>> lmb_realloc() function, so the most I can do is return an error if the lmb
>> isn't big enough.
>
> You could add a lmb_realloc() function...
I'm not sure that would work in the context of the way lmb regions are
currently being used. reallocating an lmb will probably require moving it
as well, and the caller of lmb_realloc() might not be able to handle updated
pointers.
>> The problem is that by the time the code needs to resize the fdt, it has
>> long since forgotten about the lmb. We would need to modify
>
> You could add code so that this information gets stored in a suitable
> way.
You make a lot of statements saying that I can do this and I can do that,
but you provide no examples. Have you even looked at the code to see what
such a change would require?
I believe that modifying the parameters for fdt_board_setup() is too
intrusive of a change. So the only available spot where we could put the
lmb pointers is in the bd_t structure. And my understanding is that this
structure is already too fragile and should not be modified.
>> ft_board_setup() to take an lmb as a parameter, but that would require
>> changes to almost 30 boards!
>
> There have been changes in the past that required changes to many,
> many more boards. What exactly is the problem with doing this?
It's not worth it. It would be easier for me to take the code of
fdt_increase_size() and just copy it into boot_relocate_fdt().
In fact, I think that's what I will do. I thought I was being polite by
simply re-using an existing function, but I'd rather just copy the code into
boot_relocate_fdt() if it means I don't have to argue with you about it.
--
Timur Tabi
Linux kernel developer at Freescale
next prev parent reply other threads:[~2010-05-19 15:34 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-10 21:26 [U-Boot] [PATCH 2/3] libfdt: make fdt_increase_size() available to everyone Timur Tabi
2010-05-10 21:30 ` Timur Tabi
2010-05-13 17:46 ` Kumar Gala
2010-05-16 2:11 ` [U-Boot] " Gerald Van Baren
2010-05-16 4:13 ` Timur Tabi
2010-05-17 11:24 ` Jerry Van Baren
2010-05-17 13:16 ` Wolfgang Denk
2010-05-17 14:16 ` Timur Tabi
2010-05-17 20:33 ` Wolfgang Denk
2010-05-18 14:10 ` Timur Tabi
2010-05-18 15:18 ` Wolfgang Denk
2010-05-18 15:32 ` Timur Tabi
2010-05-18 22:20 ` Wolfgang Denk
2010-05-19 0:51 ` Timur Tabi
2010-05-19 6:54 ` Wolfgang Denk
2010-05-19 14:57 ` Timur Tabi
2010-05-19 15:14 ` Wolfgang Denk
2010-05-19 15:34 ` Timur Tabi [this message]
2010-05-19 15:44 ` Wolfgang Denk
2010-05-19 21:46 ` Kumar Gala
2010-05-19 22:06 ` Wolfgang Denk
2010-05-19 22:12 ` Timur Tabi
2010-05-20 8:28 ` Wolfgang Denk
2010-05-20 11:44 ` Timur Tabi
2010-05-25 16:07 ` Timur Tabi
2010-05-25 17:50 ` Wolfgang Denk
2010-05-25 18:01 ` Timur Tabi
2010-05-25 19:15 ` Wolfgang Denk
2010-05-25 19:28 ` Timur Tabi
2010-05-25 22:11 ` Wolfgang Denk
2010-05-26 15:11 ` Timur Tabi
2010-05-26 16:11 ` Wolfgang Denk
2010-05-26 16:38 ` Timur Tabi
2010-05-26 17:23 ` Scott Wood
2010-05-26 17:56 ` Timur Tabi
2010-05-26 18:06 ` Scott Wood
2010-05-26 18:23 ` Timur Tabi
2010-05-26 19:14 ` Wolfgang Denk
2010-05-26 19:08 ` Wolfgang Denk
2010-05-20 13:34 ` Kumar Gala
2010-05-20 12:58 ` Timur Tabi
2010-05-17 11:25 ` [U-Boot] [PATCH 2/3] " Jerry Van Baren
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=4BF4051A.1090202@freescale.com \
--to=timur@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