Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4373024pxv; Mon, 5 Jul 2021 22:29:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy07TxINIYV58TslACM2AADLMkTEQKjVu0dIYUePZConf10KMtWijdL3RBmcIchZrRF+imt X-Received: by 2002:a05:6638:2515:: with SMTP id v21mr4157802jat.141.1625549351230; Mon, 05 Jul 2021 22:29:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625549351; cv=none; d=google.com; s=arc-20160816; b=WV1asLhfUdnmz8iKYR/78tnZx7TWaSg3SypxpcAUDA+qPca9+nc84xPZD3EGdOLngb s4lmahd6aKxq6mJfmWkbloYT01k9P6GejGW2j3B7DpqZX8dqIXap1kRVEXFv7T8HnrIe JtY9l0WeU4mvdxeY3J4tEFSzNivuPWoGRCAbksqYp3pYIYhm7xL/BsicV+g4sHGKCkBT LcAmdXJFkkMegMLrbBMNG8/GgLoXO1QZWqa7U7BQZSHhUYOeJzYCFHQhwmxh2KyHfcni 9Ka91XVvcrofv5XT1lalUsUGTdK+D2NRNcpLMG4aLeOs0Vtay1bcNHWhI5XbRFBNN1as rkjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=OAFBTKXAL2m51SR8yV71v4AFJS8BkAMvXfQse+PeO+E=; b=cjqz6mOyyjim/whxl2uyaAa/VytUnMglIz+Ol+EKWB7V22nN8p6jOu9kylwMjw2s8S gXDAiRHG8AVsedv6d8yeDzEVZ29+bmMMTuBbEKZ/tR/rLjft2UyPVyZH0qTtuoD2vpzD quQnb57dCePllF/ziPtmYQbO+E27ILBXoQALwCS8nsEPSx0PAr/qYpAHPYz+VLjdmfIO J3RKnWfJgj8dfQ8F6qtKOJufvE5b7MEK7X+7a6QEIitC21RgIFzMMau8aOm7eYeiZqhC efCYspDxvV87lQhtK7LBA77ZKypmW0/bEKpApSDcHWL4MZzKvB4t1eJEb5MHXUZUpGd7 J3mw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f10si11407680jar.27.2021.07.05.22.28.59; Mon, 05 Jul 2021 22:29:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230107AbhGFF3t (ORCPT + 99 others); Tue, 6 Jul 2021 01:29:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230034AbhGFF3t (ORCPT ); Tue, 6 Jul 2021 01:29:49 -0400 Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4CC48C061574 for ; Mon, 5 Jul 2021 22:27:11 -0700 (PDT) Received: by angie.orcam.me.uk (Postfix, from userid 500) id AB5EB92009D; Tue, 6 Jul 2021 07:27:09 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id A45B492009B; Tue, 6 Jul 2021 07:27:09 +0200 (CEST) Date: Tue, 6 Jul 2021 07:27:09 +0200 (CEST) From: "Maciej W. Rozycki" To: Jean Delvare cc: linux-kernel@vger.kernel.org Subject: [PATCH 2/2] firmware: dmi: Log board vendor if no system vendor has been given In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some systems do not provide any names with System Information, e.g. the Tyan Tomcat IV S1564D mainboard reports: Legacy DMI 2.0 present. DMI: /i430HX, BIOS 4.51 PG 05/13/98 This is not unreasonable given that it was retailed as a bare mainboard rather that a complete system, so no information could have been known about the integrator. It does have the manufacturer correctly recorded with Base Board Information though: Handle 0x0001 DMI type 1, 8 bytes. System Information Manufacturer: Product Name: Version: Serial Number: Handle 0x0002 DMI type 2, 8 bytes. Base Board Information Manufacturer: Tyan Computer Corp Product Name: i430HX Version: Serial Number: Resort to logging the board manufacturer then if none has been given for the system. Also refrain from including the separating slash if no name has been given for the system. Output is now: Legacy DMI 2.0 present. DMI: Tyan Computer Corp i430HX, BIOS 4.51 PG 05/13/98 for said board, surely more informative (of course a better name could have been chosen for the product than just "i430HX", but there you go). Signed-off-by: Maciej W. Rozycki --- drivers/firmware/dmi_scan.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) linux-dmi-board-vendor.diff Index: linux-macro-ide-tty/drivers/firmware/dmi_scan.c =================================================================== --- linux-macro-ide-tty.orig/drivers/firmware/dmi_scan.c +++ linux-macro-ide-tty/drivers/firmware/dmi_scan.c @@ -535,17 +535,23 @@ static int __init print_filtered(char *b static void __init dmi_format_ids(char *buf, size_t len) { int c = 0; + const char *vendor; const char *board; /* Board Name is optional */ + const char *name; - c += print_filtered(buf + c, len - c, - dmi_get_system_info(DMI_SYS_VENDOR)); + vendor = dmi_get_system_info(DMI_SYS_VENDOR); + if (!vendor || !*vendor) + vendor = dmi_get_system_info(DMI_BOARD_VENDOR); + c += print_filtered(buf + c, len - c, vendor); c += scnprintf(buf + c, len - c, " "); - c += print_filtered(buf + c, len - c, - dmi_get_system_info(DMI_PRODUCT_NAME)); + + name = dmi_get_system_info(DMI_PRODUCT_NAME); + c += print_filtered(buf + c, len - c, name); board = dmi_get_system_info(DMI_BOARD_NAME); if (board && *board) { - c += scnprintf(buf + c, len - c, "/"); + if (name && *name) + c += scnprintf(buf + c, len - c, "/"); c += print_filtered(buf + c, len - c, board); } c += scnprintf(buf + c, len - c, ", BIOS ");