From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TzPuv-000147-TR for barebox@lists.infradead.org; Sun, 27 Jan 2013 10:56:54 +0000 Date: Sun, 27 Jan 2013 11:56:51 +0100 From: Sascha Hauer Message-ID: <20130127105651.GV1906@pengutronix.de> References: <20130125235326.GG26329@game.jcrosoft.org> <20130127100813.GU1906@pengutronix.de> <20130127103856.GJ26329@game.jcrosoft.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20130127103856.GJ26329@game.jcrosoft.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: barebox-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: [PATCH 0/7] globalvar: add multiple device support To: Jean-Christophe PLAGNIOL-VILLARD Cc: barebox@lists.infradead.org On Sun, Jan 27, 2013 at 11:38:56AM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > On 11:08 Sun 27 Jan , Sascha Hauer wrote: > > On Sat, Jan 26, 2013 at 12:53:26AM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > > > HI, > > > > > > this will allow to reduce the scope of device and params to search > > > during boot time > > > > > > we keep the retro compatibility > > > > > > The following changes since commit 2c93912f34ce06585c4ede0298aef7225e096df2: > > > > > > atmel_mci: gpio: request and configure card detect (2013-01-25 19:52:44 +0100) > > > > > > are available in the git repository at: > > > > > > git://git.jcrosoft.org/barebox.git delivery/globalvar > > > > When compiling this I get: > > > > common/bootargs.c: In function 'linux_bootargs_get': > > common/bootargs.c:50:2: warning: passing argument 1 of 'global_get_match' from incompatible pointer type [enabled by default] > > In file included from common/bootargs.c:23:0: > > include/globalvar.h:19:7: note: expected 'struct device_d *' but argument is of type 'char *' > > common/bootargs.c:54:2: warning: passing argument 1 of 'global_get_match' from incompatible pointer type [enabled by default] > > In file included from common/bootargs.c:23:0: > > include/globalvar.h:19:7: note: expected 'struct device_d *' but argument is of type 'char *' > > common/bootargs.c: In function 'bootargs_init': > > common/bootargs.c:83:19: warning: assignment from incompatible pointer type [enabled by default] > > > > When starting this I get: > > > > unable to handle NULL pointer dereference at address 0x00000068 > > pc : [] lr : [] > > sp : a6effc18 ip : 00000002 fp : 00000000 > > r10: a6ffdf2c r9 : a6ffd704 r8 : a6ffb009 > > r7 : 00000000 r6 : 00000000 r5 : 00000000 r4 : 00000000 > > r3 : 00000000 r2 : 00000000 r1 : a6ffb009 r0 : 00000000 > > Flags: nZCv IRQs off FIQs off Mode SVC_32 > > [] (get_param_by_name+0xc/0xb4) from [] (dev_add_param+0x18/0x94) > > [] (dev_add_param+0x18/0x94) from [] (global_add_simple+0x14/0x18) > > [] (global_add_simple+0x14/0x18) from [] (globalvar_add_simple+0x98/0xb0) > > [] (globalvar_add_simple+0x98/0xb0) from [] (do_global+0x110/0x188) > > [] (do_global+0x110/0x188) from [] (execute_command+0x38/0x78) > > [] (execute_command+0x38/0x78) from [] (run_list_real+0x7e0/0x938) > > [] (run_list_real+0x7e0/0x938) from [] (parse_stream_outer+0x198/0x270) > > [] (parse_stream_outer+0x198/0x270) from [] (parse_string_outer+0x9c/0x100) > > [] (parse_string_outer+0x9c/0x100) from [] (source_script+0x40/0x78) > > ... > > > > Overall I'm not sure this is worth it. I did some measurements on a > > 400MHz ARM9 board. From startup until booting the kernel barebox spends > > about 5.5ms in getenv/setenv. This can be reduced quite easily to 3ms > > by moving globalvar_init to a core_initcall. > > > > Anyway, the series is not mergable as is. Also the search through subdevices > > of the globalvar device seems to have some undesirable side effects. > > I test here no issue wired > > I test also here with more global ar about 100 > > I found 200ms diff on the all boot (cold start) > > which for my case is critical > > which config do you use? pcm038_defconfig See the attached patch commit 3bbc0037970e35dab9838980bbd5dfb67cf2dada Author: Sascha Hauer Date: Sun Jan 27 00:53:14 2013 +0100 fix Signed-off-by: Sascha Hauer diff --git a/common/bootargs.c b/common/bootargs.c index d82d853..e9248ab 100644 --- a/common/bootargs.c +++ b/common/bootargs.c @@ -26,7 +26,7 @@ static char *linux_bootargs; static int linux_bootargs_overwritten; -static char *global_linux_dev; +static struct device_d *global_linux_dev; /* * This returns the Linux bootargs diff --git a/common/globalvar.c b/common/globalvar.c index d0aa2a3..aa4f8a0 100644 --- a/common/globalvar.c +++ b/common/globalvar.c @@ -135,6 +135,11 @@ int globalvar_add_simple(const char *name) subname = ++data; dev = global_get_child_by_name(tmp); + if (!dev) { + dev = global_device; + subname = name; + } + } ret = global_add_simple(dev, subname); -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox