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=-17.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,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 CC22AC07E96 for ; Tue, 6 Jul 2021 15:22:05 +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 559A4619AE for ; Tue, 6 Jul 2021 15:22:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 559A4619AE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.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 92A9A82D8F; Tue, 6 Jul 2021 17:22:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="PIUuaIA1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1917E82D8B; Tue, 6 Jul 2021 17:21:58 +0200 (CEST) Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) (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 1C6C582D7E for ; Tue, 6 Jul 2021 17:21:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-wm1-x331.google.com with SMTP id i2-20020a05600c3542b02902058529ea07so2524646wmq.3 for ; Tue, 06 Jul 2021 08:21:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NQgJlwEnYz/sMyGJmdi1h+G7wa71JE1SWZtjZhAWijw=; b=PIUuaIA1uHNuAxfaohHfT6kka7vdOHs9K09Fr1Prr11xZm1VrYc1hyJ0m5NUsA6xOq IN2XDomE6H1unPwD1H00SrxQCSghZxlLBfx0TMBQBzeTheSLbi9o5TrnSTkVPXu88mDU y4HKjcIxugsasOfUK16Iq/ZSW7y7yqtqipeCg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NQgJlwEnYz/sMyGJmdi1h+G7wa71JE1SWZtjZhAWijw=; b=EbbtnkQVMgf202uB8R8fFDLBb99hh1rcHDfbJbJ/6JgrWRd+1NC4ao5pdPsnXEFOi5 DfGdYawRG0hZ3zyS+hNZATfGbKkPaHlJ89xsqAxPncK9GOBKG5iqtBXL1ew9F9F0peyD eM9U0BjlvgcsfdI/GHW5UWQKqT/0WtkjBOuqTxnNkL755wAZnJTFLqy5a+CMo78tHJQW w0Q6/aef5w4+KBDVc0ALM86oc0FS3ESZOSAeZ4eAX7MDOhDcDGDFsCzZJ/WEs4FlvkE3 l25e8IE70uzHf2eHZLWq6zPGZvCRJ4Bkjkx4USZAEg71MKoZT4PdoqsM6IB0lO0ou06I v0mw== X-Gm-Message-State: AOAM532nYOf2X58xxWailhQurZMOf2kuyHx/P8576mqpCJmYBqmmZJhL W0QPPUXSQg6GZJJqNyquU9PtbewPuljstoIx18NvtA== X-Google-Smtp-Source: ABdhPJyrROjF0kM4iRT9mQNiN7g5wFeBmGhanm3NhYB9K/bMaTeN5tXJTlu7vyAgTBb4UcO/7j0V62o9frjEV3eqrDY= X-Received: by 2002:a05:600c:3391:: with SMTP id o17mr1361260wmp.119.1625584913429; Tue, 06 Jul 2021 08:21:53 -0700 (PDT) MIME-Version: 1.0 References: <20210705084915.32008-1-ilias.apalodimas@linaro.org> In-Reply-To: From: Simon Glass Date: Tue, 6 Jul 2021 09:21:41 -0600 Message-ID: Subject: Re: [PATCH] smbios: Try CONFIG_SYS_ options before using "Unknow" as a value To: Ilias Apalodimas Cc: Heinrich Schuchardt , Da Xue , Bin Meng , Christian Gmeiner , U-Boot Mailing List Content-Type: text/plain; charset="UTF-8" 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 Ilias, On Mon, 5 Jul 2021 at 11:31, Ilias Apalodimas wrote: > > Simon, Bin, > > As Heinrich points out some of the CONFIG_SYS_* values are not representing > the devices properly. Maybe it's a better idea to only check the .dts? > If the values are missing we can pop a runtime warning and keep using > 'Unknown'. I think we should pick one of two options: 1. Fail if we don't have the info 2. Try to use CONFIG_SYS_... as the old code did As mentioned earlier, I actually prefer 1, since then it means boards must add the info in the DT (probably) which indicates that someone has actually thought about it. But if we go with 2, we may as well go all the way, and use all the info at our disposal. > > On Mon, Jul 05, 2021 at 09:29:57AM -0600, Simon Glass wrote: > > On Mon, 5 Jul 2021 at 02:49, Ilias Apalodimas > > wrote: > > > > > > SMBIOS entries for manufacturer and board can't be empty, as the spec > > > explicitly requires a value. > > > Instead of passing "Unknown" and "Unknown product" for the manufacturer and > > > product name if the .dts options are missing, try to use CONFIG_SYS_VENDOR > > > and CONFIG_SYS_BOARD respectively. If those are not found either warn the > > > user at runtime and use "Unknown" for both entries. > > > > > > Signed-off-by: Ilias Apalodimas > > > --- > > > lib/smbios.c | 14 ++++++++------ > > > 1 file changed, 8 insertions(+), 6 deletions(-) > > > > Reviewed-by: Simon Glass > > > > I'm not quite sure what this is based on, but perhaps the code changed > > without me noticing. > > > > How about adding some tests for this code? > > How? The only valid test we can do is that the values we expect are not "". > But as the code is right now it will always replace "" with "Unknown" I just mean we need unit tests for generation of smbios tables....it is complicated enough. Regards, Simon