All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Simon Glass <sjg@chromium.org>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Bin Meng <bmeng.cn@gmail.com>,
	Christian Gmeiner <christian.gmeiner@gmail.com>,
	U-Boot Mailing List <u-boot@lists.denx.de>
Subject: Re: [PATCH] smbios: Fix SMBIOS tables
Date: Sat, 26 Jun 2021 21:51:25 +0300	[thread overview]
Message-ID: <YNd3LUE9YcN9LekE@enceladus> (raw)
In-Reply-To: <CAPnjgZ2P+fz5_ZUwjaUO3wT8VW1qkpcvsCLU8METT=ghZTg2aA@mail.gmail.com>

Hi Simon, 

> > ---
[...]
> > This depends on https://lists.denx.de/pipermail/u-boot/2021-June/451761.html
> >  lib/smbios.c | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> 
> It is strange that all the boards that defined the old CONFIG set it
> to "", meaning that an empty string is used. Was that just wrong?

Yea I think so. In fact Heinrich fixed an identical error due to that on 
00a871d34e2f

> 
> In your patch you are using 'Unknown' and 'Unknown Product'. Should it
> use CONFIG_SYS_VENDOR and CONFIG_SYS_BOARD instead?

I don't have an issue with that, as long as they are defined for every board.
I think already Tom pulled this though, but I can send a follow up.

> 
> Or should we actually fail (and return an error code), and require the
> properties to be set by the board? It does not seem very useful to
> have a meaningless string. Are these SMBIOS values ignored in Linux?
> 

Well the problem is that those tables are marked as mandatory (section 6.2)
So failing one would mean disable the entire thing.  Why dont we do something
less intrusive?  I can send a follow up, popping a warning 'fix your dts
and/or CONFIG_SYS_VENDOR/CONFIG_SYS_BOARD'.  Then we can rid of the fallback
but keep the warning for future boards.

I am not aware of all the cases linux uses those.  I found the problem trying
to enable fwupd and specifically the EFI capsule updates for the firmware.  In
that case, fwupd is trying to find the 'EFI bit' in 'BIOS Characteristics
Extension Byte 2'.  There were two things wrong, the bit was wrong and the
tables were not installed at all.  With the two patches applied fwupd seems
happy.

Cheers
/Ilias

> >
> > diff --git a/lib/smbios.c b/lib/smbios.c
> > index abdd157a7084..e2c6b1a44ee3 100644
> > --- a/lib/smbios.c
> > +++ b/lib/smbios.c
> > @@ -259,7 +259,11 @@ static int smbios_write_type1(ulong *current, int handle,
> >         fill_smbios_header(t, SMBIOS_SYSTEM_INFORMATION, len, handle);
> >         smbios_set_eos(ctx, t->eos);
> >         t->manufacturer = smbios_add_prop(ctx, "manufacturer");
> > +       if (!t->manufacturer)
> > +               t->manufacturer = smbios_add_string(ctx, "Unknown");
> >         t->product_name = smbios_add_prop(ctx, "product");
> > +       if (!t->product_name)
> > +               t->product_name = smbios_add_string(ctx, "Unknown Product");
> >         t->version = smbios_add_prop_si(ctx, "version",
> >                                         SYSINFO_ID_SMBIOS_SYSTEM_VERSION);
> >         if (serial_str) {
> > @@ -289,7 +293,11 @@ static int smbios_write_type2(ulong *current, int handle,
> >         fill_smbios_header(t, SMBIOS_BOARD_INFORMATION, len, handle);
> >         smbios_set_eos(ctx, t->eos);
> >         t->manufacturer = smbios_add_prop(ctx, "manufacturer");
> > +       if (!t->manufacturer)
> > +               t->manufacturer = smbios_add_string(ctx, "Unknown");
> >         t->product_name = smbios_add_prop(ctx, "product");
> > +       if (!t->product_name)
> > +               t->product_name = smbios_add_string(ctx, "Unknown Product");
> >         t->version = smbios_add_prop_si(ctx, "version",
> >                                         SYSINFO_ID_SMBIOS_BASEBOARD_VERSION);
> >         t->asset_tag_number = smbios_add_prop(ctx, "asset-tag");
> > @@ -314,6 +322,8 @@ static int smbios_write_type3(ulong *current, int handle,
> >         fill_smbios_header(t, SMBIOS_SYSTEM_ENCLOSURE, len, handle);
> >         smbios_set_eos(ctx, t->eos);
> >         t->manufacturer = smbios_add_prop(ctx, "manufacturer");
> > +       if (!t->manufacturer)
> > +               t->manufacturer = smbios_add_string(ctx, "Unknown");
> >         t->chassis_type = SMBIOS_ENCLOSURE_DESKTOP;
> >         t->bootup_state = SMBIOS_STATE_SAFE;
> >         t->power_supply_state = SMBIOS_STATE_SAFE;
> > --
> > 2.32.0.rc0
> >
> 
> Regrads,
> Simon

  reply	other threads:[~2021-06-26 18:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-10  9:33 [PATCH] smbios: Fix SMBIOS tables Ilias Apalodimas
2021-06-10  9:55 ` Heinrich Schuchardt
2021-06-26 18:30 ` Simon Glass
2021-06-26 18:51   ` Ilias Apalodimas [this message]
2021-06-27 19:32     ` Simon Glass

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=YNd3LUE9YcN9LekE@enceladus \
    --to=ilias.apalodimas@linaro.org \
    --cc=bmeng.cn@gmail.com \
    --cc=christian.gmeiner@gmail.com \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.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.