From mboxrd@z Thu Jan 1 00:00:00 1970 From: York Sun Date: Mon, 3 Jan 2011 12:08:07 -0800 Subject: [U-Boot] [PATCH v2 2/9] make the hwconfig buffer deeper In-Reply-To: <20101218222535.58FF31524E8@gemini.denx.de> References: <1292630381-23022-1-git-send-email-yorksun@freescale.com> <1292630381-23022-2-git-send-email-yorksun@freescale.com> <20101218222535.58FF31524E8@gemini.denx.de> Message-ID: <1294085287.24386.52.camel@oslab-l1> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Sat, 2010-12-18 at 16:25 -0600, Wolfgang Denk wrote: > Dear York Sun, > > In message <1292630381-23022-2-git-send-email-yorksun@freescale.com> you wrote: > > To temporarily fix buffer issue when running at flash, use bigger buffer > > to push down the stack deeper. > > > > Signed-off-by: York Sun > > Please explain 1) why this is needed and 2) what it has to do with > running "at" (from?) flash? > > hwconfig is intended for simple h/w configurations. In which case do > you need more than 128 characters for such settings? And is this > really needed / reasonable? First of all, I don't need more than 128 characters for hwconfig. I think the buggy code makes the buffer less usable. If you look into the common/hwconfig.c, you will notice the _current_ code uses the stack as temporary memory to hold the variable. Even I don't agree with this way, I don't have a quick fix either. There may be two ways or more to fix it. One is to create wrapper functions to deal with pre-relocation and post-relocation functions. Another way is to allocate more space in gd. Which way do you think is better? York