From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00B8AC49EA6 for ; Sat, 26 Jun 2021 18:51:35 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5C3EE61C39 for ; Sat, 26 Jun 2021 18:51:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5C3EE61C39 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3C50482C3A; Sat, 26 Jun 2021 20:51:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="yqrKuMHP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 19D8182C38; Sat, 26 Jun 2021 20:51:32 +0200 (CEST) Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E945482C38 for ; Sat, 26 Jun 2021 20:51:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-wr1-x42c.google.com with SMTP id u11so14625257wrw.11 for ; Sat, 26 Jun 2021 11:51:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=rthzciqnR3iobRCiZcviLKnegEhGNt5BCnXMxADiLRk=; b=yqrKuMHPqYnr0eC4u7vTN1pApUFfEKvHFfQW3E0zn/1/Tj/+sqvmFDg+9uijqLeQGd q6vy9pDwVD00enraEsWL408rM23GucaUm1cD0JlntNZtL3TROQZ3BD9Vydwuw7zXY6A7 lGsV7U43ox/SPGK4cr/Y6ZrR0nKKBPW3toff109DIT5oeDJh3besZVCLBxb1pHr8q4il C32FRLj+qCLd8V+RGneQVzQtVsTdufMG2a5JEq1U3WA0G/Ja6BTRmEJGYarGAb5mPGta jVkWrX1nQ/rghIsT2LajGS89F7hECxk51x74wdeBYJBx2OYfhCxJdlDR5CyZGgf39X0K QStA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=rthzciqnR3iobRCiZcviLKnegEhGNt5BCnXMxADiLRk=; b=t5vBqMKHoheCdp+3ggXZnfXjCTFsqtsIKJF3xB6ipXu5p2PUfE0JhYDi7J0ay0mPOO fRAq6Ddk8gydnXwmLBWG7UhMr6Otked652y12eHPm1icJ83SaBfmFIJdzVImp3KngqCS SJlESmAgBFgW83v8DQ8WbUpgnrgabgOWOxuTp0KFHOQt1S4UrFFA7Do8sW+nviWY/paE vUhukK1um5SfZE4BmyE+JTwxFhHdQml7+w7vJrnjJGMxOxrXODqLTiNO52jspugO2McW 0aZ+o+b25b3p9EE9mnQNK8kK9aD/96MtiqvJt5cj5bY23vSf/d1jNdJRPU5lvF/0F76z 41Ng== X-Gm-Message-State: AOAM5318IOc8b4tQ47n5W+8ba5EWLUtOKCGgdAXpvAGNrpi71SwHN+4p kKJU4ZYMTn/35AF3BMW86YTZCg== X-Google-Smtp-Source: ABdhPJx9S5XBsC1h400VG6ciBUhi/xJLIiRw1OyUVQSeH2j4ZSqca+Q6+xEEKStsiImSti3f1jH0hg== X-Received: by 2002:adf:8061:: with SMTP id 88mr18291189wrk.233.1624733488488; Sat, 26 Jun 2021 11:51:28 -0700 (PDT) Received: from enceladus (athedsl-419796.home.otenet.gr. [79.131.191.210]) by smtp.gmail.com with ESMTPSA id p5sm9966169wrd.25.2021.06.26.11.51.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Jun 2021 11:51:28 -0700 (PDT) Date: Sat, 26 Jun 2021 21:51:25 +0300 From: Ilias Apalodimas To: Simon Glass Cc: Heinrich Schuchardt , Bin Meng , Christian Gmeiner , U-Boot Mailing List Subject: Re: [PATCH] smbios: Fix SMBIOS tables Message-ID: References: <20210610093316.833557-1-ilias.apalodimas@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean 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