Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5638427ybc; Wed, 27 Nov 2019 07:12:07 -0800 (PST) X-Google-Smtp-Source: APXvYqxC84I7giKweOS455lVP0zohjjnUR5eeRRMSQra1jtkiyB8R3SMcdNbwG2jKxxMicNgdpmZ X-Received: by 2002:a17:906:a457:: with SMTP id cb23mr49240717ejb.191.1574867527730; Wed, 27 Nov 2019 07:12:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574867527; cv=none; d=google.com; s=arc-20160816; b=SdeUfDHGagwttpo5SDxZ6q3G/op8YgJF6LDlt38lUhbaLJPlbFtXTo68cdG5GvkqUa JrMYL+Co7i79XXhrflX8/+XEw+XSaLvrRY+de+C3aYlH9xIOHpAkyyOL8+rEMryk6WQH JenT/znhVcJozNQGbv7AQS7fMlMvCHtiqRQbkvx/kv/9hw9zIWJDpVFhKslf3g69ri+i uTF7Qi6eOR8kJbhte9Icl99prtbw0jfYzztMtuNi1sDXSHKMoDaHZk0Fx2fi+RfTssqf qO2MdcYftNTKmPnFJNbZ9z2Kd0/a2X4C58f36pFuTWAcvmTo5Kkk8yRE37qPtQv5Ge4X pMCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=cjO37N9FrEVVAlj2Cp+V8ZeFjWK0fAAiQ+h/m2gAVW0=; b=oaA7u5JJ7/8+7AkB0WjvuGjS8UfBdW1fFXAYC30EfW2GynIcqb1KZzyJZUSN5mJ+7D xbsXYMOjMS3ku2M1Gs6kKaAyHSscdvdjE2k9P/oE8MLnzclD2HnQufKfZY+1PJeecbNl ahlaHybD6GK6q/9WoprRT1RrDTHnxLGcKafDuJvf7gfTvN9zvi9Y8XBUAYVGBWM0DmZr mJXp29pp9UxXoiAqw1le86GOl+Nrl7O68zkspSUmz1rlBDFbN5ffQZdWuontOMkT6G/r X2nvPF1Uzhbz8ngGNLufcKvhPHq022cBpr79BI/RkDfDrkLVCuR4fu6+xzSQNks+xK4n xXmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=RfoJsU55; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f7si11149150edy.92.2019.11.27.07.11.43; Wed, 27 Nov 2019 07:12:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=RfoJsU55; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727031AbfK0PJn (ORCPT + 99 others); Wed, 27 Nov 2019 10:09:43 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:40226 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726514AbfK0PJn (ORCPT ); Wed, 27 Nov 2019 10:09:43 -0500 Received: by mail-wm1-f65.google.com with SMTP id y5so7898207wmi.5; Wed, 27 Nov 2019 07:09:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cjO37N9FrEVVAlj2Cp+V8ZeFjWK0fAAiQ+h/m2gAVW0=; b=RfoJsU550WYts4lENLmG1Mjt4l3KoXW+iPjR1k7X4R8g3zY21kZhUEb+i/cNfIPe/O BF0wcM2svSVXF1S6BbtEoWXnoudvulZvRx//hoDhQ6wXK72lrgBCI3/F2+JVsNJMGWra /SqKwfXp2+DUaLtE0HvNHXzsLLKzZ2X76rgRcgdc5pNmowwRjyO/xzHzMjZiKuFmxA8q XI2JtRaMT4lw2i/BvDWw3eJBrXE/mWUMKLvEYxzGvSiUMxbuzlqxXHePvH9fiAkkzrbs a8K9Is1VY/f7AQlXiFzwCzK68Mu9Fb014aucKxLNT1GVXGtEntrnYeAAhQnkIb5a0Rcg 9Bdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cjO37N9FrEVVAlj2Cp+V8ZeFjWK0fAAiQ+h/m2gAVW0=; b=nMVaFanChO8kHyKoa0mJ+VGdbmd70kPCQ8FtcDzstORkW47/ukXB47o22SEzwepdti lAl4swZzOMeIuTp+WOI2Q2TLguaAnMu2djF0vQh/ZOA0iBoYnkMJ+bBejmNM2wpQ0GCK TxSvjpihq/YmS/cj2iqIQtkJO8TELeFXGnPVHCeKLtLR9itpNxG69BfpB9OnpjwR9lt5 Sn2nXXJ8YG4YHTXy3W+XvVFbXi5va/cKx7uq6+kzEJ18Dae1P21fxXDFpCBvS94rsn5+ yoqZr+No/yKMAO2tAHpybFkbpeunoWQQ8b3+31vzcFCGelRhob/B4Kl4ROwo5T1vnLHc CBdw== X-Gm-Message-State: APjAAAVz+x58gDGHo+Eb/BXlLl6O0vUJyoPgVj/Z8ZMu8HKA3792XjOz 3EDogE4MnUORMUVKMSv2VoU= X-Received: by 2002:a1c:b1c3:: with SMTP id a186mr4953875wmf.10.1574867381522; Wed, 27 Nov 2019 07:09:41 -0800 (PST) Received: from t1700.criteois.lan ([91.199.242.236]) by smtp.gmail.com with ESMTPSA id o1sm4496500wrn.84.2019.11.27.07.09.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Nov 2019 07:09:41 -0800 (PST) From: Erwan Velu X-Google-Original-From: Erwan Velu Cc: Erwan Velu , Jean Delvare , Masahiro Yamada , Michal Marek , Mattias Jacobsson <2pi@mok.nu>, Andy Shevchenko , Changbin Du , "Robert P. J. Day" , Sumit Garg , linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org Subject: [PATCH 2/2] firmware/dmi: Report DMI Embedded Firmware release Date: Wed, 27 Nov 2019 16:07:26 +0100 Message-Id: <20191127150729.860625-2-e.velu@criteo.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191127150729.860625-1-e.velu@criteo.com> References: <20190918094323.17515-1-e.velu@criteo.com> <20191127150729.860625-1-e.velu@criteo.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Servers that have a BMC encodes the release version of their firmwarein the "Embedded Controller Firmware {Major|Minor} Release" fields of Type 0. This information is used to know which BMC release actually runs. It could be used for some quirks, debugging sessions or inventory tasks. A typical output for a Dell system running the 3.75 bios is : [root@t1700 ~]# cat /sys/devices/virtual/dmi/id/fw_release 3.75 [root@t1700 ~]# Signed-off-by: Erwan Velu --- drivers/firmware/dmi-id.c | 3 +++ drivers/firmware/dmi_scan.c | 1 + include/linux/mod_devicetable.h | 1 + scripts/mod/file2alias.c | 1 + 4 files changed, 6 insertions(+) diff --git a/drivers/firmware/dmi-id.c b/drivers/firmware/dmi-id.c index a2aac65ff771..93eca3222fb0 100644 --- a/drivers/firmware/dmi-id.c +++ b/drivers/firmware/dmi-id.c @@ -43,6 +43,7 @@ DEFINE_DMI_ATTR_WITH_SHOW(bios_version, 0444, DMI_BIOS_VERSION); DEFINE_DMI_ATTR_WITH_SHOW(bios_date, 0444, DMI_BIOS_DATE); DEFINE_DMI_ATTR_WITH_SHOW(sys_vendor, 0444, DMI_SYS_VENDOR); DEFINE_DMI_ATTR_WITH_SHOW(bios_release, 0444, DMI_BIOS_RELEASE); +DEFINE_DMI_ATTR_WITH_SHOW(fw_release, 0444, DMI_EMBEDDED_FW_RELEASE); DEFINE_DMI_ATTR_WITH_SHOW(product_name, 0444, DMI_PRODUCT_NAME); DEFINE_DMI_ATTR_WITH_SHOW(product_version, 0444, DMI_PRODUCT_VERSION); DEFINE_DMI_ATTR_WITH_SHOW(product_serial, 0400, DMI_PRODUCT_SERIAL); @@ -80,6 +81,7 @@ static ssize_t get_modalias(char *buffer, size_t buffer_size) { "bvr", DMI_BIOS_VERSION }, { "bd", DMI_BIOS_DATE }, { "br", DMI_BIOS_RELEASE }, + { "efr", DMI_EMBEDDED_FW_RELEASE }, { "svn", DMI_SYS_VENDOR }, { "pn", DMI_PRODUCT_NAME }, { "pvr", DMI_PRODUCT_VERSION }, @@ -190,6 +192,7 @@ static void __init dmi_id_init_attr_table(void) ADD_DMI_ATTR(bios_version, DMI_BIOS_VERSION); ADD_DMI_ATTR(bios_date, DMI_BIOS_DATE); ADD_DMI_ATTR(bios_release, DMI_BIOS_RELEASE); + ADD_DMI_ATTR(fw_release, DMI_EMBEDDED_FW_RELEASE); ADD_DMI_ATTR(sys_vendor, DMI_SYS_VENDOR); ADD_DMI_ATTR(product_name, DMI_PRODUCT_NAME); ADD_DMI_ATTR(product_version, DMI_PRODUCT_VERSION); diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c index d010c915c1ab..5394aa553140 100644 --- a/drivers/firmware/dmi_scan.c +++ b/drivers/firmware/dmi_scan.c @@ -467,6 +467,7 @@ static void __init dmi_decode(const struct dmi_header *dm, void *dummy) dmi_save_ident(dm, DMI_BIOS_VERSION, 5); dmi_save_ident(dm, DMI_BIOS_DATE, 8); dmi_save_release(dm, DMI_BIOS_RELEASE, 21); + dmi_save_release(dm, DMI_EMBEDDED_FW_RELEASE, 23); break; case 1: /* System Information */ dmi_save_ident(dm, DMI_SYS_VENDOR, 4); diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 618933d770e6..ad64a101676d 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h @@ -533,6 +533,7 @@ enum dmi_field { DMI_BIOS_VERSION, DMI_BIOS_DATE, DMI_BIOS_RELEASE, + DMI_EMBEDDED_FW_RELEASE, DMI_SYS_VENDOR, DMI_PRODUCT_NAME, DMI_PRODUCT_VERSION, diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index cc48930cc02a..c0e1d379d9df 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c @@ -937,6 +937,7 @@ static const struct dmifield { { "bvr", DMI_BIOS_VERSION }, { "bd", DMI_BIOS_DATE }, { "br", DMI_BIOS_RELEASE }, + { "efr", DMI_EMBEDDED_FW_RELEASE }, { "svn", DMI_SYS_VENDOR }, { "pn", DMI_PRODUCT_NAME }, { "pvr", DMI_PRODUCT_VERSION }, -- 2.23.0