public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC PATCH] POST: add test before execution of post_run to avoid unneeded run
Date: Tue, 26 Jul 2011 17:44:47 +0200	[thread overview]
Message-ID: <20110726154447.EB87F138EED4@gemini.denx.de> (raw)
In-Reply-To: <1311602833-29320-1-git-send-email-valentin.longchamp@keymile.com>

Dear Valentin Longchamp,

In message <1311602833-29320-1-git-send-email-valentin.longchamp@keymile.com> you wrote:
> Some boards have the environment variables defined in a slow EEPROM. post_run
> accesses these environment variables to define which tests have to be run (in
> post_get_flags). This is very slow before the code relocation on some boards
> with a slow I2C EEPROM for environement variables.
> 
> This patch adds a check at the beginning of post_run to avoid to run
> post_get_flags (which may be slow on some boards for the above reason) for some
> given POST flags if no tests are defined with these flags (for instance, no need
> to run POST tests with POST_ROM if no tests for POST_ROM are defined).

I think I understand what you are tying to do, but I'm sorry, I cannot
understand your code.

> diff --git a/post/post.c b/post/post.c
> index 1b7f2aa..d97f330 100644
> --- a/post/post.c
> +++ b/post/post.c
> @@ -169,6 +169,18 @@ static void post_bootmode_test_off (void)
>  	post_word_store (word);
>  }
>  
> +static int post_test_defined(int flags)
> +{
> +	int i;
> +	int run_flags = flags & ~(POST_RAM | POST_ROM);

Why are you masking out the POST_RAM and POST_ROM bits here?

Assuming your intention is to shortcut post_run(), then this should
be done always, independent of the mode.

> +	for (i = 0; i < post_list_size; i++)
> +		if (post_list[i].flags & run_flags)
> +			return 1;

Please try if omitting run_flags and testing 

		if (post_list[i].flags & flags)

instead still has the intended effect.  If so, then please resubmit a
cleaned up patch.

If not, then please explain in detail how your patch is supposed to
work.

Thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Women are more easily and more deeply terrified ...  generating  more
sheer horror than the male of the species.
	-- Spock, "Wolf in the Fold", stardate 3615.4

  reply	other threads:[~2011-07-26 15:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-25 14:07 [U-Boot] [RFC PATCH] POST: add test before execution of post_run to avoid unneeded run Valentin Longchamp
2011-07-26 15:44 ` Wolfgang Denk [this message]
2011-07-27  9:54   ` Valentin Longchamp

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=20110726154447.EB87F138EED4@gemini.denx.de \
    --to=wd@denx.de \
    --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