All of lore.kernel.org
 help / color / mirror / Atom feed
From: Goldschmidt Simon <sgoldschmidt@de.pepperl-fuchs.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] cmd: nvedit: env_get_f must check for env_get_char error codes
Date: Sat, 3 Feb 2018 10:27:32 +0000	[thread overview]
Message-ID: <FD897F46D140444CAB8DC80B08F0742B018A4B9378@PFDE-MX10.EU.P-F.BIZ> (raw)

On 02/02/2018 21:04, York Sun wrote:
> On 02/02/2018 10:51 AM, Maxime Ripard wrote:
> 
> <snip>
> 
>>>>>
>>>> Simon,
>>>>
>>>> This patch looks correct. But it doesn't fix NOR flash. Do you have plan
>>>> to add .get_char function to other drivers? Without that function, we
>>>> cannot get env variables before relocation.
>>>
>>> Ehrm, sorry  I don't plan to do that, no: my target seems to run fine
>>> without this.
>>>
>>> Given that only the eeprom and nvram env drivers support the get_char
>>> method, I don't know if this is widely used at all. Maybe a better fallback
>>> would be to just remove that get_char code path totally and always load from
>>> the internal (default) environment until the full environment is available
>>> (after relocation).
>>>
>>> After all, the environment variables loaded via get_char are not CRC checked
>>> at all. To me, this is another indication that this code is not really
>>> useful and should probably be removed.
>>
>> To be honest, I'm not really sure what get_char was here for in the
>> first place, so getting rid of it sounds like a good idea :)
>>
> 
> On almost all my boards, a variable hwconfig is read before relocation
> to determine DDR configuration. This has been broken. I don't mind you
> remove some dead code. But this is breaking almost all my boards booting
> from NOR flash.

When talking about removing a feature I meant the code that
exists for 2 env drivers only where single characters are loaded
from an external environment without checking its crc first.

The thing you seem to need is reading from the default environment
before relocation. This should not be removed, of course!

I might prepare a patch to better show what I mean...

Simon

             reply	other threads:[~2018-02-03 10:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-03 10:27 Goldschmidt Simon [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-01-31  6:56 [U-Boot] [PATCH] cmd: nvedit: env_get_f must check for env_get_char error codes Simon Goldschmidt
2018-01-31  8:39 ` Maxime Ripard
2018-01-31 23:00 ` York Sun
2018-02-01  9:16   ` Simon Goldschmidt
2018-02-02 18:51     ` Maxime Ripard
2018-02-02 20:04       ` York Sun
2018-02-05 13:43         ` Maxime Ripard
2018-02-05 16:30           ` York Sun
2018-02-07  8:31             ` Maxime Ripard

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=FD897F46D140444CAB8DC80B08F0742B018A4B9378@PFDE-MX10.EU.P-F.BIZ \
    --to=sgoldschmidt@de.pepperl-fuchs.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.