public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <jdelvare@suse.de>
To: <Mario_Limonciello@Dell.com>
Cc: <Allen_Hung@Dell.com>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] dmi-id: add dmi/id/oem group for exporting oem strings to sysfs
Date: Tue, 2 Aug 2016 15:43:01 +0200	[thread overview]
Message-ID: <20160802154301.24effa3e@endymion> (raw)
In-Reply-To: <b64a4975e2674f76bcc36f49c817cfd0@ausx13mpc124.AMER.DELL.COM>

Hi Mario, Allen,

On Tue, 19 Jul 2016 14:47:57 +0000, Mario_Limonciello@Dell.com wrote:
> Hi Jean,
> 
> I worked with Allen on this concept, so I've got some comments below.
> 
> > -----Original Message-----
> > From: Jean Delvare [mailto:jdelvare@suse.de]
> > Sent: Tuesday, July 19, 2016 4:03 AM
> > To: Hung, Allen <Allen_Hung@Dell.com>
> > Cc: Jean Delvare <jdelvare@suse.com>; linux-kernel@vger.kernel.org;
> > Limonciello, Mario <Mario_Limonciello@Dell.com>
> > Subject: Re: [PATCH 2/2] dmi-id: add dmi/id/oem group for exporting oem
> > strings to sysfs
> > 
> > Hello Allen,
> > 
> > On Thu, 14 Jul 2016 16:01:23 +0800, Allen Hung wrote:
> > > The oem strings in DMI system identification information of the BIOS have
> > > been parsed and stored as dmi devices in dmi_scan.c but they are not
> > > exported to userspace via sysfs.
> > 
> > They are intended for internal consumption by the kernel drivers.
> > 
> > > The patch intends to export oem strings to sysfs device /sys/class/dmi/id.
> > > As the number of oem strings are dynamic, a group "oem" is added to the
> > > device and the strings will be added to the group as string1, string2, ...,
> > > and stringN.
> > 
> > What is the use case? You can already get these strings easily using
> > dmidecode:
> > 
> > # dmidecode -qt 11
> > OEM Strings
> > 	String 1: Dell System
> > 	String 2: 1[05A4]
> > 	String 3: 3[1.0]
> > 	String 4: 12[www.dell.com]
> > 	String 5: 14[1]
> > 	String 6: 15[3]
> > 	String 7:
> > 
> > If needed, a dedicated option could be added to dmidecode to extract
> > specific OEM strings. Or existing option -s could be extended for that
> > purpose.
> 
> The main purpose was to be able to parse these easily from userspace
> without needing dmidecode installed and handling its output 
> (with tools such as grep, sed, and awk).

As I just stated above: dmidecode could be extended to extract the oem
strings directly if there is a need for it.

> For example in an initramfs, typically dmidecode isn't included, but there
> is value to being able to make decisions on things related to the values of 
> those OEM strings.

dmidecode is not included because nobody needs it. If you need it, you
can include it. 15 years ago, udev was not included in initramfs
either. But we still decided that this stuff should be done in
user-space and we wrote udev and added it to initramfs. It is in the
nature of initramfs to evolve with new needs, and to only include what
is needed on a given machine. mkinitrd/dracut checks the needs
dynamically. Why would it not work in your case?

I would appreciate more details than "there is value..." I would like
to hear about an actual use case.

> Instead this allows userspace to iterate the oem/ directory and directly
> look at the values of these strings.

At the cost of code which will run at every boot, and kernel memory
which will be used forever, on all systems. This is why I am reluctant.
You don't put things in the kernel because this is the easiest way to
fulfill your immediate need. You put things in the kernel because you
absolutely have to, or at the very least because it is where it makes
the most sense. At this point I am not convinced this is the case here.
I see no reason why the same can't be implemented easily in user-space
(dmidecode and dracut.)

> > Also your code doesn't even build. I won't review this patch until I
> > know why it is needed, and it builds (without warning.)
> 
> Allen had a mistake in that submission when he was refactoring it prior to 
> LKML submission.  
> He resubmitted it the next day fixing that mistake:
> https://patchwork.kernel.org/patch/9231473/

Sorry, my bad. The updated patch was already available when I
complained, just had not crawled far enough in my mailbox at the time I
replied.

-- 
Jean Delvare
SUSE L3 Support

  reply	other threads:[~2016-08-02 13:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-14  8:01 [PATCH 0/2] dmi-id: export oem strings to sysfs Allen Hung
2016-07-14  8:01 ` [PATCH 1/2] dmi-id: don't free dev structure after calling device_register Allen Hung
2016-07-18 17:09   ` Jean Delvare
2016-07-14  8:01 ` [PATCH 2/2] dmi-id: add dmi/id/oem group for exporting oem strings to sysfs Allen Hung
2016-07-14  9:16   ` kbuild test robot
2016-07-19  9:03   ` Jean Delvare
2016-07-19 14:47     ` Mario_Limonciello
2016-08-02 13:43       ` Jean Delvare [this message]
2016-08-02 18:56         ` Mario_Limonciello
2016-08-15  9:55           ` Allen Hung
2016-08-24  8:05             ` Allen Hung
2016-07-26 21:03     ` Mario_Limonciello
2016-07-29  9:59       ` Allen Hung
  -- strict thread matches above, loose matches on Subject: below --
2016-07-15  9:42 [PATCH 0/2] dmi-id: export " Allen Hung
2016-07-15  9:42 ` [PATCH 2/2] dmi-id: add dmi/id/oem group for exporting " Allen Hung

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160802154301.24effa3e@endymion \
    --to=jdelvare@suse.de \
    --cc=Allen_Hung@Dell.com \
    --cc=Mario_Limonciello@Dell.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox