Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1479526ybv; Thu, 6 Feb 2020 04:55:58 -0800 (PST) X-Google-Smtp-Source: APXvYqyl9/lja/a2RmyNuLpY3aT4yD05cbiGPUDXA8LdPpN5nxCJ0c3+/HkgX3aMhWaSr19gc35H X-Received: by 2002:a05:6830:1597:: with SMTP id i23mr28832645otr.109.1580993758843; Thu, 06 Feb 2020 04:55:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580993758; cv=none; d=google.com; s=arc-20160816; b=Pa0eLrexVsYMRfGqhestT8JO229XiRhNLIWY1lBDpMRmOmB5FA2zP0KGL/zTqxm/Pm 7tffgzdLT5BldWeg9TXLm/MCkWJm1WnFx0k0AlWqqncWgIzTIEOkOXOUGe189I9Uydbn +zS6KHXDE6aMwEaYSg/78eszih1VuPHrz8MGP2QAkcrgNhHz7w5DLOUa+8dWTYirPRQF xOsF7e9FJ8P+EzDpf+VtzeXb77fbtvWdTimWJGwEhZb+avVAV5DCKYAHo2sq79muYuEv qlN3CJ8Qe9Z4mDSyC8AigCBqFvu7N9wMr8SWAaCuvTPadntk+CDogsceox21QtJpLSVh bizQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=TPeReHZ/YnjriyOJ8Sth6S24xjy53mXcSx71JSIWQ7s=; b=0Y3pgyaxNizTp2O4jg2BjY+pKTGjRfg++K2xE0uhGbJ/wVzTAlN2XuNjzLjIZeVHLV nepv1PVOxB6tnkBeKOq93/8vb/l23TiWigcdtYjvdbGiNXbKj8USAVUU1fbeAFwzYdZM I6A3uM0yb5iGMLm568XfsjqtoLodXyDsNtaKPhOpnChPylQ840IVUz4GZ5+bwx2Sg9yu GX5VFF7mff5KirYmfzwFm5srJ5iuiGaG7ytFExJ96ZQWelPIjzzCCQ6AxLkgWqrI3tw+ hQa7IgRTKnO2lt656FQHcdxTvA9OVCawwKTstduClnWQ8e7q8p7Df5C58JCOLTQpwofN RCoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BGtDmfka; 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=pass (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 m16si1973915otj.7.2020.02.06.04.55.45; Thu, 06 Feb 2020 04:55:58 -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=pass header.i=@gmail.com header.s=20161025 header.b=BGtDmfka; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727861AbgBFM0x (ORCPT + 99 others); Thu, 6 Feb 2020 07:26:53 -0500 Received: from mail-ed1-f65.google.com ([209.85.208.65]:41458 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726744AbgBFM0w (ORCPT ); Thu, 6 Feb 2020 07:26:52 -0500 Received: by mail-ed1-f65.google.com with SMTP id c26so5709262eds.8; Thu, 06 Feb 2020 04:26:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=TPeReHZ/YnjriyOJ8Sth6S24xjy53mXcSx71JSIWQ7s=; b=BGtDmfka/MVNX9OjZh21QaD5yTgdNowi20aPryBLrJLeVhTjYQrVc0TeskJsZXW1Lt l2P7gilfRPI1r8/MXsnR4XnoS+3KDb9wu9/9yL1JHX4wRvQT2C59u4fLwnxeuR4q8LnO 4+wwLPRMGfL4SIrvps3d11pJlH30vGJNHcfsc69AiQMs7P2E4zivq2Z1jjy8U8WKp/I/ 8vzgdfUw52YM5mWu9lH6MQV1U19jEikHtv4ysuwcr+2sue3Fy9AwTBsKM9h7H2wQRB6Y 1BiAzVY7IT7EuPDTx9qJwKrkAEAYFQpj/yt+WW6iwwG3IZq6sfgMP3qf8dLfoEl3Opjk 8nOg== 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:content-transfer-encoding; bh=TPeReHZ/YnjriyOJ8Sth6S24xjy53mXcSx71JSIWQ7s=; b=aYnvty6E4GPhVF3s5/YfEB1oT+re8P3VKoDEC8aaKKMSi+LaEHcdKA1azi2pyyxeHM WfQpZwlPKa1pfLaz9fHLYICdQ1DFAFw9wKQLhvji0heHlBnS3fIDs5GDDKLk2McTElq5 oJqc5MFoTzJMyiw1k8UOp7HPLCluMq6bwB5LyhclQ3KtT4JAacj6gk8CvOIIJeyTkHe3 falvQGQbnNyTvd87zgFe7BpbnczqMf9UUufFyFzmVqEmmwfvUkRqAmqe0E7ccI1m0MA8 dIqOvuYhNQi/s/AI90cZhN1Tlqo0JXB+KMJKzwdb/ScW7XNtHu5TErITK65mhavjw7vb HtQQ== X-Gm-Message-State: APjAAAVZ4e4D1bZMW9QzO1pvSHvdDlBY6gZtPVByuESjBccV3bqcz197 RCvhfCZi8h/NUgvhiSdPtmiNwlSiIj1r2CeAUAQ= X-Received: by 2002:aa7:d9c6:: with SMTP id v6mr2835147eds.107.1580992010730; Thu, 06 Feb 2020 04:26:50 -0800 (PST) MIME-Version: 1.0 References: <20190918094323.17515-1-e.velu@criteo.com> <20191127150729.860625-1-e.velu@criteo.com> <20191127150729.860625-2-e.velu@criteo.com> <20200206132430.6082fa87@endymion> In-Reply-To: <20200206132430.6082fa87@endymion> From: Erwan Velu Date: Thu, 6 Feb 2020 13:25:16 +0100 Message-ID: Subject: Re: [PATCH 2/2] firmware/dmi: Report DMI Embedded Firmware release To: Jean Delvare Cc: Erwan Velu , Masahiro Yamada , Michal Marek , Mattias Jacobsson <2pi@mok.nu>, Andy Shevchenko , Changbin Du , "Robert P. J. Day" , Sumit Garg , open list , linux-kbuild@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks for the feedback Jean. I will update the patch accordingly. Le jeu. 6 f=C3=A9vr. 2020 =C3=A0 13:25, Jean Delvare a = =C3=A9crit : > > On Wed, 27 Nov 2019 16:07:26 +0100, Erwan Velu wrote: > > Servers that have a BMC encodes the release version of their firmwarein= the > > encodes -> encode > firmwarein -> firmware in > > > "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, 0= 444, DMI_BIOS_VERSION); > > DEFINE_DMI_ATTR_WITH_SHOW(bios_date, 0444, DMI_BIOS_DATE); > > DEFINE_DMI_ATTR_WITH_SHOW(sys_vendor, 0444, DMI_SYS_VEN= DOR); > > DEFINE_DMI_ATTR_WITH_SHOW(bios_release, 0444, DMI_BIOS_RELEASE= ); > > +DEFINE_DMI_ATTR_WITH_SHOW(fw_release, 0444, DMI_EMBEDDED_FW_= RELEASE); > > I suggest naming the define DMI_EC_FIRMWARE_RELEASE. "EC" is the > commonly accepted abbreviation for "embedded controller". "FW" on the > other hand is ambiguous as it can stand for firmware but also firewire > or firewall. > > Likewise I think the sysfs attribute should be named > "ec_firmware_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 buff= er_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_head= er *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_device= table.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 }, > > Also, as already mentioned during my first review, please merge both > patches together. They touch exactly the same areas, they are doing > basically the same thing, and will never be backported individually, so > splitting them creates more paperwork with no benefit. > > -- > Jean Delvare > SUSE L3 Support