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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 9A3C8C433FE for ; Thu, 29 Sep 2022 23:56:43 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BD34A84CEF; Fri, 30 Sep 2022 01:56:22 +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="eZwbSkir"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4C61F84CD7; Fri, 30 Sep 2022 01:56:08 +0200 (CEST) Received: from mail-oa1-x35.google.com (mail-oa1-x35.google.com [IPv6:2001:4860:4864:20::35]) (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 3CD1484C81 for ; Fri, 30 Sep 2022 01:56:03 +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-oa1-x35.google.com with SMTP id 586e51a60fabf-131ea99262dso1391112fac.9 for ; Thu, 29 Sep 2022 16:56:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=BD40Be0q1/xNY8rRQi+gfDJRTQpqTlYsphWF8TmVP6k=; b=eZwbSkir2poFfg1eD2AluT22wTw5H1UWoB/6JI8LaReuUsmTtVIUFz93OIYbu1vzE+ O8CM52+MK1lCwzSnb3s0y3yaDlAw49FxdzB0B8Rjl6LyapQLmPUFQm/EcBMAUZc3SHvZ IeQPqtOWzG/S9RSgJCSTnTUMdNCKYL1mdRMmc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=BD40Be0q1/xNY8rRQi+gfDJRTQpqTlYsphWF8TmVP6k=; b=kYo+q/Q8RS5vVa2g6b5QlvIo+uBx+Yj8xPHcH8thGYtzr1l8I1oyHF0MF2QKKJOMs0 V8i/ysJHYF7l5KrlfJOuAABhcJJJwEW5wL7Z6wGzsgbTIkoxJ9fdhuletCDW/Ue/7acP hl+RUK9zActVXiuHjvow5SC1xpcl1gAZ1wCVXJJPHgM3xTC3mm2SpJlOTWhCmUs5Rvl0 vxF1BKiv0nv55VHrnbcHj+hdVu5I8Ubw9BdOIllEXo2UhEWUQoFPtI/+AWE16JLuDDWY G5C6LXbIGuhIZb7OxqEPjiXa/R7+o9VghM8GYZmKtJYDR+E07QRWHy/91tg1K9x6Lj9z n1YQ== X-Gm-Message-State: ACrzQf2uge1ptc7SZ4csG3c8QcKG8aBPNexG0TsiLjnaV04+kGXMTTTN FuFwar2KK/oumro9933cXHzo4h2hY04zD6pOTRKnKQ== X-Google-Smtp-Source: AMsMyM5I962V37BtAeWJ0XpkA9fOATIH5VcGEQKcu/qQl6WCcNkgDgC3V8qp+hsJ0MoAFqfyb8NQwW9As2g9cfqD4GY= X-Received: by 2002:a05:6870:a2cc:b0:131:83eb:60b6 with SMTP id w12-20020a056870a2cc00b0013183eb60b6mr9193763oak.170.1664495761089; Thu, 29 Sep 2022 16:56:01 -0700 (PDT) MIME-Version: 1.0 References: <20220906134426.53748-1-ilias.apalodimas@linaro.org> <20220906134426.53748-2-ilias.apalodimas@linaro.org> In-Reply-To: From: Simon Glass Date: Thu, 29 Sep 2022 17:55:43 -0600 Message-ID: Subject: Re: [PATCH 2/2] smbios: Fallback to the default DT if sysinfo nodes are missing To: Ilias Apalodimas Cc: Peter Robinson , U-Boot Mailing List , Tom Rini , Heinrich Schuchardt Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.6 at phobos.denx.de X-Virus-Status: Clean Hi Ilias, On Thu, 29 Sept 2022 at 04:23, Ilias Apalodimas wrote: > > Hi Simon, > > On Thu, Sep 29, 2022 at 03:59:51AM -0600, Simon Glass wrote: > > Hi, > > > > On Tue, 20 Sept 2022 at 05:10, Peter Robinson wrote: > > > > > > On Tue, Sep 6, 2022 at 2:44 PM Ilias Apalodimas > > > wrote: > > > > > > > > In order to fill in the SMBIOS tables U-Boot currently relies on a > > > > "u-boot,sysinfo-smbios" compatible node. This is fine for the boards > > > > that already include such nodes. However with some recent EFI changes, > > > > the majority of boards can boot up distros, which usually rely on > > > > things like dmidecode etc for their reporting. For boards that > > > > lack this special node the SMBIOS output looks like: > > > > > > > > System Information > > > > Manufacturer: Unknown > > > > Product Name: Unknown > > > > Version: Unknown > > > > Serial Number: Unknown > > > > UUID: Not Settable > > > > Wake-up Type: Reserved > > > > SKU Number: Unknown > > > > Family: Unknown > > > > > > > > This looks problematic since most of the info are "Unknown". The DT spec > > > > specifies standard properties containing relevant information like > > > > 'model' and 'compatible' for which the suggested format is > > > > . So let's add a last resort to our current > > > > smbios parsing. If none of the sysinfo properties are found, we can > > > > scan the root node for 'model' and 'compatible'. > > > > > > I don't think the information below all needs to go in the commit, > > > maybe in the cover letter? > > > > > > > pre-patch dmidecode: > > > > > > > > Handle 0x0001, DMI type 1, 27 bytes > > > > System Information > > > > Manufacturer: Unknown > > > > Product Name: Unknown > > > > Version: Unknown > > > > Serial Number: Unknown > > > > UUID: Not Settable > > > > Wake-up Type: Reserved > > > > SKU Number: Unknown > > > > Family: Unknown > > > > > > > > Handle 0x0002, DMI type 2, 14 bytes > > > > Base Board Information > > > > Manufacturer: Unknown > > > > Product Name: Unknown > > > > Version: Unknown > > > > Serial Number: Not Specified > > > > Asset Tag: Unknown > > > > Features: > > > > Board is a hosting board > > > > Location In Chassis: Not Specified > > > > Chassis Handle: 0x0000 > > > > Type: Motherboard > > > > > > > > Handle 0x0003, DMI type 3, 21 bytes > > > > Chassis Information > > > > Manufacturer: Unknown > > > > Type: Desktop > > > > Lock: Not Present > > > > Version: Not Specified > > > > Serial Number: Not Specified > > > > Asset Tag: Not Specified > > > > Boot-up State: Safe > > > > Power Supply State: Safe > > > > Thermal State: Safe > > > > Security Status: None > > > > OEM Information: 0x00000000 > > > > Height: Unspecified > > > > Number Of Power Cords: Unspecified > > > > Contained Elements: 0 > > > > > > > > > > > > post-pastch dmidecode: > > > > > > > > Handle 0x0001, DMI type 1, 27 bytes > > > > System Information > > > > Manufacturer: socionext,developer-box > > > > Product Name: Socionext Developer Box > > > > Version: Unknown > > > > Serial Number: Unknown > > > > UUID: Not Settable > > > > Wake-up Type: Reserved > > > > SKU Number: Unknown > > > > Family: Unknown > > > > > > > > Handle 0x0002, DMI type 2, 14 bytes > > > > Base Board Information > > > > Manufacturer: socionext,developer-box > > > > Product Name: Socionext Developer Box > > > > Version: Unknown > > > > Serial Number: Not Specified > > > > Asset Tag: Unknown > > > > Features: > > > > Board is a hosting board > > > > Location In Chassis: Not Specified > > > > Chassis Handle: 0x0000 > > > > Type: Motherboard > > > > > > > > Handle 0x0003, DMI type 3, 21 bytes > > > > Chassis Information > > > > Manufacturer: socionext,developer-box > > > > Type: Desktop > > > > Lock: Not Present > > > > Version: Not Specified > > > > Serial Number: Not Specified > > > > Asset Tag: Not Specified > > > > Boot-up State: Safe > > > > Power Supply State: Safe > > > > Thermal State: Safe > > > > Security Status: None > > > > OEM Information: 0x00000000 > > > > Height: Unspecified > > > > Number Of Power Cords: Unspecified > > > > Contained Elements: 0 > > > > > > > > > > > > Signed-off-by: Ilias Apalodimas > > > > > > Reviewed-by: Peter Robinson > > > Tested-by: Peter Robinson > > > > > > > --- > > > > lib/smbios.c | 41 +++++++++++++++++++++++++++++++++++++++-- > > > > 1 file changed, 39 insertions(+), 2 deletions(-) > > > > I've thought about this a lot. > > > > As I mentioned earlier, we should require boards to add this > > information when they enable GENERATE_SMBIOS_TABLE > > > > It is a simple patch for each board vendor and it solves the problem. > > What we have here just masks it. > > > Not entirely. I think we just see the problem differently here. I agree > that the code here masks a problem (but only for *some* boards) and ideally > we should go and add smbios nodes on the boards that miss it. However we > conveniently keep ignoring OF_BOARD here. Until those things are documented > in a spec and you can *demand* a previous bootloader to include it, we'll have > boards that display "Unknown" all over the place. Personally I don't > think that's acceptable, hence the last resort solution. I think you mean OF_HAS_PRIOR_STAGE - we have an explicit Kconfig now. We can easily make U-Boot halt if the info is not there but it is needed. That will cause people to fix it for their board. > > I'd be much happier if we popped a warning on boards that miss the smbios > node and are not compiling with OF_BOARD, explaining smbios will be > disabled for them in the future, while having the flexibility to not > display values that make no sense. How about just failing the build and producing an error, if people enable the SMBIOS tables without the data? We could run with a warning for a while if you like, then change it to an error. Regards, Simon