mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 0/7] globalvar: add multiple device support
Date: Sun, 27 Jan 2013 11:56:51 +0100	[thread overview]
Message-ID: <20130127105651.GV1906@pengutronix.de> (raw)
In-Reply-To: <20130127103856.GJ26329@game.jcrosoft.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 : [<a7f1f928>]    lr : [<a7f1faf8>]
> > 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
> > [<a7f1f928>] (get_param_by_name+0xc/0xb4) from [<a7f1faf8>] (dev_add_param+0x18/0x94)
> > [<a7f1faf8>] (dev_add_param+0x18/0x94) from [<a7f07800>] (global_add_simple+0x14/0x18)
> > [<a7f07800>] (global_add_simple+0x14/0x18) from [<a7f0789c>] (globalvar_add_simple+0x98/0xb0)
> > [<a7f0789c>] (globalvar_add_simple+0x98/0xb0) from [<a7f1e438>] (do_global+0x110/0x188)
> > [<a7f1e438>] (do_global+0x110/0x188) from [<a7f05940>] (execute_command+0x38/0x78)
> > [<a7f05940>] (execute_command+0x38/0x78) from [<a7f02150>] (run_list_real+0x7e0/0x938)
> > [<a7f02150>] (run_list_real+0x7e0/0x938) from [<a7f01798>] (parse_stream_outer+0x198/0x270)
> > [<a7f01798>] (parse_stream_outer+0x198/0x270) from [<a7f0190c>] (parse_string_outer+0x9c/0x100)
> > [<a7f0190c>] (parse_string_outer+0x9c/0x100) from [<a7f022e8>] (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 <s.hauer@pengutronix.de>
Date:   Sun Jan 27 00:53:14 2013 +0100

    fix
    
    Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

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

      reply	other threads:[~2013-01-27 10:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-25 23:53 Jean-Christophe PLAGNIOL-VILLARD
2013-01-25 23:55 ` [PATCH 1/7] params: allow to access first sub-device and params via env Jean-Christophe PLAGNIOL-VILLARD
2013-01-25 23:55   ` [PATCH 2/7] globalvar: add it's own bus Jean-Christophe PLAGNIOL-VILLARD
2013-01-25 23:55   ` [PATCH 3/7] globalvar: allow to register multiple device Jean-Christophe PLAGNIOL-VILLARD
2013-01-25 23:55   ` [PATCH 4/7] net: switch to global device Jean-Christophe PLAGNIOL-VILLARD
2013-01-25 23:55   ` [PATCH 5/7] dhcp: switch globalvar to it's own device Jean-Christophe PLAGNIOL-VILLARD
2013-01-25 23:55   ` [PATCH 6/7] bootm: " Jean-Christophe PLAGNIOL-VILLARD
2013-01-25 23:55   ` [PATCH 7/7] bootargs: " Jean-Christophe PLAGNIOL-VILLARD
2013-01-26  0:45   ` [PATCH 1/7] params: allow to access first sub-device and params via env Alexander Aring
2013-01-27 10:08 ` [PATCH 0/7] globalvar: add multiple device support Sascha Hauer
2013-01-27 10:38   ` Jean-Christophe PLAGNIOL-VILLARD
2013-01-27 10:56     ` Sascha Hauer [this message]

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=20130127105651.GV1906@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=plagnioj@jcrosoft.com \
    /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