Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6398726ybe; Wed, 18 Sep 2019 02:50:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqzuN9AGI/njBx6pf5n+EoCdxAGe22QJObMoT3T7TdGiHO+ZJ39TxJkXiwlsac9hCKfz896F X-Received: by 2002:a50:bb22:: with SMTP id y31mr9626914ede.58.1568800243336; Wed, 18 Sep 2019 02:50:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568800243; cv=none; d=google.com; s=arc-20160816; b=p3Nf2zTuck0wLVHHFm28LoY+a8YUJWrKawMjC/qwOn8VWzU8LlgxZLlhXYnD3NHiap UN3n9bClIbGvbj03EQWTAvsGBC0qPE9Hh/zk9o65cvGwmO5/1man+GhHmbFf0bEfjszm BcaWg5ASeE1dPtW1/DbwS0prmaHkh4Ybw4+g017j6MrBE2CRKbyzkaQXF1nglg4imngh FdFyOEPbLWb5fIDu7nmK5W+l9eTOc72SG7JL5nrZVyV7hc2/dSF5x6G0QveVC8Ond2Vf gLhMURoOH/O4xUUQ2Ede6Nnm0V6BXoobZoLtXUBm9YWF6V3oiaZexj0G2MdHatjYp5cG UHNQ== 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=7dhk1Hk3Bb6XgUyVTseaXPBZDZxG8PQ8XpSkQyIOCo0=; b=GMakCem3MeMjVQclDXB/V2Vn8A/AyJ6LD+n9w2ueh7BRXj4HBt2UX12G8g9gXgQPi8 bnylZidV6zf73EuVdXpPnX7TUy1T8wGDxyn+a559nUc/imhWdFFJRIpgcBRtnexVJtXx DNCZFHZc6W8fK16GYHlU92KHudTBvJ6cAR6ILD3QYbl6Lw/pl4bGYhntXIavAJJo8+Ts MaMeXEHxuJaC0ticcsahS9zbIKLGMVqB0cS25X1zlG/0ThYH3p1CtTzzrGlvVST6No30 VpQWyns/0mm5HXufFuMov4ZrMhaJhyxlz+n2d4nzf93pO5Yj2+P2XwYSaXwd81pNqsTR Ivpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=qtWy2WBp; 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 x62si2966923ede.352.2019.09.18.02.50.19; Wed, 18 Sep 2019 02:50:43 -0700 (PDT) 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=qtWy2WBp; 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 S1728646AbfIRJor (ORCPT + 99 others); Wed, 18 Sep 2019 05:44:47 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:36805 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728474AbfIRJoq (ORCPT ); Wed, 18 Sep 2019 05:44:46 -0400 Received: by mail-wr1-f66.google.com with SMTP id y19so6181800wrd.3; Wed, 18 Sep 2019 02:44:44 -0700 (PDT) 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=7dhk1Hk3Bb6XgUyVTseaXPBZDZxG8PQ8XpSkQyIOCo0=; b=qtWy2WBpQiLo8F9ybCLRuGnYHVz28bNy44jl+In8YdnSQ8ESQO29s8H+Ypaihuj2G5 DyW8K4ryLMB4eeMG9eCRriuF7F1k9Lh5jM2NxmJG/9XHhAdRlMBudExa+MAnRq8dGu4z 3an6AiplykmLL8Sn2WX6ulD2GlfJosliHhp4m1mMO8QD4Gc9BrUcR6FRhMz8bG5zZcmj MchthaETjDAQ6pe7mw1uXPYBJDhdyv6la+H6+qlxUZzkyVegwOqlX/EyfaYaT3BKObIL UEf1+x90REz4RFMCGs0Nglsp1x5X7ebN3wUM7tRPnaQvnTwkRLRT5+8pQTRwd5+5X55T bgwA== 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=7dhk1Hk3Bb6XgUyVTseaXPBZDZxG8PQ8XpSkQyIOCo0=; b=IqzwwmPZDBpnE1jQWSej+SV7PhJfjHzZlZsUSw9fJhr+tT+0OUULDtbF+Vlr+/CAE2 wSbGBd1MDLvrMEexe7dYEvr13qnljZEwV8G+GrLB4b6dj6Nmwi2FPsfRmekWlEr/JLCR fAX4q6TEJe5lAKAJxD5VfqpTxyzZN+h0spx3pbh7yY5o74zIJtgZ1iPWDblk4Q2NMMt3 IAKzaRqL9zrIYsWdBsQtBhw1tCEbNczsIZz0CYiueu290NNJp/H1cOAD5QaVC2gfbGn7 vs3od4VfXiy2vOroT8nwWcwdxGN8Pr3zpFIVCwZZhd7imMSxq6BTD4kGC+h5CWmvDHFl 4XMw== X-Gm-Message-State: APjAAAU12T8tbJ16BOC9rY9njR7t3zcvX8yTPXpZaakLBmEOyoofWDIr jdXWc2+ef+Qkwt46ZsY7f3k= X-Received: by 2002:adf:ec91:: with SMTP id z17mr2425218wrn.346.1568799883545; Wed, 18 Sep 2019 02:44:43 -0700 (PDT) Received: from t1700.criteois.lan ([91.199.242.236]) by smtp.gmail.com with ESMTPSA id t8sm3776341wrx.76.2019.09.18.02.44.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Sep 2019 02:44:43 -0700 (PDT) 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 , Mauro Carvalho Chehab , "David S. Miller" , Sumit Garg , Boris Brezillon , Changbin Du , "Robert P. J. Day" , linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org Subject: [PATCH 2/3] firmware/dmi: Report DMI Bios release Date: Wed, 18 Sep 2019 11:43:20 +0200 Message-Id: <20190918094323.17515-2-e.velu@criteo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190918094323.17515-1-e.velu@criteo.com> References: <20190918094323.17515-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 Some vendors like HPe or Dell, encodes the release version of their BIOS in the "System BIOS {Major|Minor} Release" fields of Type 0. This information is useful to know which release of the bios is actually running. It could be used for some quirks, debugging sessions or inventory tasks. This patch extract these 2 fields in DMI_BIOS_MAJOR_RELEASE & DMI_BIOS_MINOR_RELEASE. A typical output for a Dell system running the 65.27 bios is : [root@t1700 ~]# cat /sys/devices/virtual/dmi/id/bios_release_major 65 [root@t1700 ~]# cat /sys/devices/virtual/dmi/id/bios_release_minor 27 [root@t1700 ~]# Signed-off-by: Erwan Velu --- drivers/firmware/dmi-id.c | 6 ++++++ drivers/firmware/dmi_scan.c | 2 ++ include/linux/mod_devicetable.h | 2 ++ scripts/mod/file2alias.c | 2 ++ 4 files changed, 12 insertions(+) diff --git a/drivers/firmware/dmi-id.c b/drivers/firmware/dmi-id.c index ff39f64f2aae..3248c2837a4d 100644 --- a/drivers/firmware/dmi-id.c +++ b/drivers/firmware/dmi-id.c @@ -42,6 +42,8 @@ DEFINE_DMI_ATTR_WITH_SHOW(bios_vendor, 0444, DMI_BIOS_VENDOR); 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_major, 0444, DMI_BIOS_MAJOR_RELEASE); +DEFINE_DMI_ATTR_WITH_SHOW(bios_release_minor, 0444, DMI_BIOS_MINOR_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); @@ -78,6 +80,8 @@ static ssize_t get_modalias(char *buffer, size_t buffer_size) { "bvn", DMI_BIOS_VENDOR }, { "bvr", DMI_BIOS_VERSION }, { "bd", DMI_BIOS_DATE }, + { "bjr", DMI_BIOS_MAJOR_RELEASE }, + { "bmr", DMI_BIOS_MINOR_RELEASE }, { "svn", DMI_SYS_VENDOR }, { "pn", DMI_PRODUCT_NAME }, { "pvr", DMI_PRODUCT_VERSION }, @@ -187,6 +191,8 @@ static void __init dmi_id_init_attr_table(void) ADD_DMI_ATTR(bios_vendor, DMI_BIOS_VENDOR); ADD_DMI_ATTR(bios_version, DMI_BIOS_VERSION); ADD_DMI_ATTR(bios_date, DMI_BIOS_DATE); + ADD_DMI_ATTR(bios_release_major, DMI_BIOS_MAJOR_RELEASE); + ADD_DMI_ATTR(bios_release_minor, DMI_BIOS_MINOR_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 202bd2c69d0f..886ace54e527 100644 --- a/drivers/firmware/dmi_scan.c +++ b/drivers/firmware/dmi_scan.c @@ -464,6 +464,8 @@ static void __init dmi_decode(const struct dmi_header *dm, void *dummy) dmi_save_ident(dm, DMI_BIOS_VENDOR, 4); dmi_save_ident(dm, DMI_BIOS_VERSION, 5); dmi_save_ident(dm, DMI_BIOS_DATE, 8); + dmi_save_release(dm, DMI_BIOS_MAJOR_RELEASE, 20); + dmi_save_release(dm, DMI_BIOS_MINOR_RELEASE, 21); 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 5714fd35a83c..2471de601bd6 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h @@ -532,6 +532,8 @@ enum dmi_field { DMI_BIOS_VENDOR, DMI_BIOS_VERSION, DMI_BIOS_DATE, + DMI_BIOS_MAJOR_RELEASE, + DMI_BIOS_MINOR_RELEASE, DMI_SYS_VENDOR, DMI_PRODUCT_NAME, DMI_PRODUCT_VERSION, diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index e17a29ae2e97..1b4f9bc3b06c 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c @@ -931,6 +931,8 @@ static const struct dmifield { { "bvn", DMI_BIOS_VENDOR }, { "bvr", DMI_BIOS_VERSION }, { "bd", DMI_BIOS_DATE }, + { "bjr", DMI_BIOS_MAJOR_RELEASE }, + { "bmr", DMI_BIOS_MINOR_RELEASE }, { "svn", DMI_SYS_VENDOR }, { "pn", DMI_PRODUCT_NAME }, { "pvr", DMI_PRODUCT_VERSION }, -- 2.21.0