Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1658184

Re: [PATCH 15/16] platform/x86: wmi-mof: New driver to expose embedded WMI MOF metadata

From Darren Hart <dvhart@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH 15/16] platform/x86: wmi-mof: New driver to expose embedded WMI MOF metadata
Date 2017-06-06 00:20 +0200
Message-ID <tP8vT-e0-5@gated-at.bofh.it> (permalink)
References <tLCCd-7vw-3@gated-at.bofh.it> <tLCCe-7vw-13@gated-at.bofh.it> <tLHVf-2Df-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat, May 27, 2017 at 01:14:15PM +0200, Pali Rohár wrote:
> Hi! Note that in WMI is stored binary MOF (BMOF; .bmf file; compiled 
> MOF), not ordinary MOF data which are plain text. So maybe it could make 
> sense to include "B" into name of sysfs entry? Or not? (Just suggestion)

Did some digging, and .... yeah, you're right.

I've replaced with MOF with Binary MOF or bmof throughout the patch. Will resend
in a v2. Thanks.

> 
> On Saturday 27 May 2017 07:31:29 Darren Hart wrote:
> > From: Andy Lutomirski <luto@kernel.org>
> > 
> > Quite a few laptops (and maybe servers?) have embedded WMI MOF
> 
> Not "a few", but "lots of" :-)

I'll just use "Many" and save us continued debate :-)

> 
> > metadata. I think that Samba has tools to interpret it, but there is
> > currently no interface to get the data in the first place.
> 
> No, there is no non-ms-windows tool for interpreting those binary MOF 
> (BMF) data yet.

Good point. Updated.

> 
> > +	priv->mofdata = wmidev_block_query(wdev, 0);
> > +	if (!priv->mofdata) {
> > +		dev_warn(&wdev->dev, "failed to read MOF\n");
> > +		return -EIO;
> > +	}
> > +
> > +	if (priv->mofdata->type != ACPI_TYPE_BUFFER) {
> > +		dev_warn(&wdev->dev, "MOF is not a buffer\n");
> > +		ret = -EIO;
> > +		goto err_free;
> > +	}
> 
> Are not those problems fatal for driver and therefore dev_err() better?
> 

Yes, agreed. Updated.

> > +	sysfs_bin_attr_init(&priv->mof_bin_attr);
> > +	priv->mof_bin_attr.attr.name = "mof";
> > +	priv->mof_bin_attr.attr.mode = 0400;
> 
> 0400 means to be readable only by root? Is there then reason why normal 
> user should not be able to read it?
> 

We can always open access up, harder to lock it down later. Let's start with
this and adjust if necessary.

-- 
Darren Hart
VMware Open Source Technology Center

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 15/16] platform/x86: wmi-mof: New driver to expose embedded WMI MOF metadata Darren Hart <dvhart@infradead.org> - 2017-05-27 07:40 +0200
  Re: [PATCH 15/16] platform/x86: wmi-mof: New driver to expose embedded WMI MOF metadata Pali Rohár <pali.rohar@gmail.com> - 2017-05-27 13:20 +0200
    Re: [PATCH 15/16] platform/x86: wmi-mof: New driver to expose  embedded WMI MOF metadata Andy Lutomirski <luto@kernel.org> - 2017-05-27 23:10 +0200
      Re: [PATCH 15/16] platform/x86: wmi-mof: New driver to expose  embedded WMI MOF metadata Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-05-30 17:30 +0200
        Re: [PATCH 15/16] platform/x86: wmi-mof: New driver to expose  embedded WMI MOF metadata Darren Hart <dvhart@infradead.org> - 2017-05-30 18:50 +0200
        Re: [PATCH 15/16] platform/x86: wmi-mof: New driver to expose embedded WMI MOF metadata Pali Rohár <pali.rohar@gmail.com> - 2017-05-30 19:10 +0200
          Re: [PATCH 15/16] platform/x86: wmi-mof: New driver to expose  embedded WMI MOF metadata Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-05-30 19:30 +0200
    Re: [PATCH 15/16] platform/x86: wmi-mof: New driver to expose  embedded WMI MOF metadata Darren Hart <dvhart@infradead.org> - 2017-06-06 00:20 +0200
      Re: [PATCH 15/16] platform/x86: wmi-mof: New driver to expose embedded WMI MOF metadata Pali Rohár <pali.rohar@gmail.com> - 2017-06-06 00:20 +0200
        Re: [PATCH 15/16] platform/x86: wmi-mof: New driver to expose  embedded WMI MOF metadata Andy Lutomirski <luto@amacapital.net> - 2017-06-06 00:50 +0200
          Re: [PATCH 15/16] platform/x86: wmi-mof: New driver to expose  embedded WMI MOF metadata Pali Rohár <pali.rohar@gmail.com> - 2017-06-06 13:10 +0200
            Re: [PATCH 15/16] platform/x86: wmi-mof: New driver to expose  embedded WMI MOF metadata Pali Rohár <pali.rohar@gmail.com> - 2017-06-06 16:00 +0200
            RE: [PATCH 15/16] platform/x86: wmi-mof: New driver to expose  embedded WMI MOF metadata <Mario.Limonciello@dell.com> - 2017-06-06 16:00 +0200
        Re: [PATCH 15/16] platform/x86: wmi-mof: New driver to expose  embedded WMI MOF metadata Darren Hart <dvhart@infradead.org> - 2017-06-06 04:40 +0200

csiph-web