linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <Mario.Limonciello@dell.com>
To: <enric.balletbo@collabora.com>, <rjw@rjwysocki.net>
Cc: <rafael@kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-acpi@vger.kernel.org>, <lenb@kernel.org>,
	<kernel@collabora.com>, <groeck@chromium.org>,
	<bleung@chromium.org>, <dtor@chromium.org>,
	<gwendal@chromium.org>, <vbendeb@chromium.org>,
	<andy@infradead.org>, <ayman.bagabas@gmail.com>,
	<benjamin.tissoires@redhat.com>, <blaz@mxxn.io>,
	<dvhart@infradead.org>, <dmitry.torokhov@gmail.com>,
	<gregkh@linuxfoundation.org>, <hdegoede@redhat.com>,
	<jeremy@system76.com>, <2pi@mok.nu>, <mchehab+samsung@kernel.org>,
	<rajatja@google.com>, <srinivas.pandruvada@linux.intel.com>,
	<platform-driver-x86@vger.kernel.org>
Subject: RE: [PATCH v4] platform: x86: Add ACPI driver for ChromeOS
Date: Wed, 10 Jun 2020 21:28:36 +0000	[thread overview]
Message-ID: <59771d3689da41a5bbc67541aa6f4777@AUSX13MPC105.AMER.DELL.COM> (raw)
In-Reply-To: <4e7f8bf3-b72b-d418-ec95-e1f8c3d61261@collabora.com>



> -----Original Message-----
> From: platform-driver-x86-owner@vger.kernel.org <platform-driver-x86-
> owner@vger.kernel.org> On Behalf Of Enric Balletbo i Serra
> Sent: Wednesday, June 10, 2020 4:22 PM
> To: Rafael J. Wysocki
> Cc: Rafael J. Wysocki; Linux Kernel Mailing List; ACPI Devel Maling List;
> Len Brown; Collabora Kernel ML; Guenter Roeck; Benson Leung; Dmitry
> Torokhov; Gwendal Grignou; vbendeb@chromium.org; Andy Shevchenko; Ayman
> Bagabas; Benjamin Tissoires; Blaž Hrastnik; Darren Hart; Dmitry Torokhov;
> Greg Kroah-Hartman; Hans de Goede; Jeremy Soller; Mattias Jacobsson; Mauro
> Carvalho Chehab; Rajat Jain; Srinivas Pandruvada; platform-driver-
> x86@vger.kernel.org
> Subject: Re: [PATCH v4] platform: x86: Add ACPI driver for ChromeOS
> 
> 
> [EXTERNAL EMAIL]
> 
> Hi Rafael,
> 
> Many thanks for your feedback. See my answers inline.
> 
> On 5/6/20 13:17, Rafael J. Wysocki wrote:
> > On Tuesday, April 14, 2020 4:35:38 PM CEST Enric Balletbo i Serra wrote:
> >> Hi Rafael,
> >>
> >> On 13/4/20 22:41, Rafael J. Wysocki wrote:
> >>> On Mon, Apr 13, 2020 at 3:46 PM Enric Balletbo i Serra
> >>> <enric.balletbo@collabora.com> wrote:
> >>>>
> >>>> This driver attaches to the ChromeOS ACPI device and then exports the
> values
> >>>> reported by the ACPI in a sysfs directory. These values are not
> exported
> >>>> via the standard ACPI tables, hence a specific driver is needed to do
> >>>> it.
> >>>
> >>> So how exactly are they exported?
> >>>
> >>
> >> They are exported through sysfs.
> >>
> >>>> The ACPI values are presented in the string form (numbers as decimal
> >>>> values) or binary blobs, and can be accessed as the contents of the
> >>>> appropriate read only files in the standard ACPI devices sysfs
> directory tree.
> >>>
> >>> My understanding based on a cursory look at the patch is that there is
> >>> an ACPI device with _HID equal to "GGL0001"  and one or more special
> >>> methods under it that return values which you want to export over
> >>> sysfs as binary attributes.  They appear to be read-only.
> >>>
> >>
> >> Exactly, there is an ACPI device equal to "GGL0001" and one special
> method
> >> called MLST that returns a list of the other control methods supported
> by the
> >> Chrome OS hardware device. The driver calls the special MLST method and
> goes
> >> through the list.
> >>
> >>> I guess that these data are to be consubed by user space?
> >>>
> >>
> >> Yes, this is used by user space, to be more specific ChromeOS userspace
> uses it.
> >
> > Well, let me start over.
> >
> > The subject and changelog of this patch are not precise enough IMO and
> there is
> > not enough information in the latter.
> >
> 
> Ok, I can improve that.
> 
> > It is not clear what "ACPI driver for ChromeOS" means.  There may be many
> ACPI
> > drivers in a Linux-based system as a rule.
> >
> > It is unclear what the ChromeOS ACPI device is and why it is there.  Is
> there
> > any documentation of it you can point me to?
> >
> 
> I'm afraid, I don't think there is any documentation, I'll ask around.
> 
> > It is unclear what you mean by "These values are not exported via the
> standard
> > ACPI tables".
> >
> > It looks like (but it is not actually documented in any way) the idea is
> to
> > get to the ACPI device object with _HID returning "GGL0001", evaluate the
> > MLST method under it and then evaluate the methods listed by it and
> export the
> > data returned by them via sysfs, under the "GGL0001" device on the "acpi"
> bus.
> > Is this correct?
> >
> 
> Yes, this is correct.
> 
> > If so, there is a couple of issues here.
> >
> > First off, GGL0001 is not a valid ACPI device ID, because the GGL prefix
> is not
> > present in the list at https://uefi.org/acpi_id_list
> >
> > There are two ways to address that.  One would be to take the GOOG prefix
> > (present in the list above), append a proper unique number (if I were to
> > guess, I would say that 0001 had been reserved already) to it and then
> > put the resulting device ID into the firmware, to be returned _HID for
> the
> > device in question (you can add a _CID returning "GGL0001" so it can be
> > found by the old invalid ID at least from the kernel).
> 
> As Dmitry said, this is not going to happen.

I think it's probably worth grouping "existing" platforms and new platforms
separately.  More below.

> 
> 
> > The other one would
> > be to properly register the GGL prefix for Google and establish a process
> for
> > allocating IDs with that prefix internally.
> >
> 
> IIUC I think this is the option we should go, although I am not really sure
> how
> to do it (I will investigate or ask).
> 
> To give you some references, if I'm not wrong, this prefix is used in all
> or
> almost all Intel Chromebook devices (auron, cyan, eve, fizz, hatch,
> octopus,
> poppy, strago ...) The ACPI source for this device can be found here [1],
> and,
> if not all, almost all Intel based Chromebooks are shipped with the
> firmware
> that supports this.

You can potentially carry a small patch in your downstream kernel for the
legacy stuff until it reaches EOL.  At least for the new stuff you could
enact a process that properly reserves unique numbers and changes the driver
when the interface provided by the ACPI device has changed.

> 
> > Next, device attributes in sysfs are part of the kernel ABI and once
> defined,
> > they cannot change (exceptions happen, but rarely), so you must guarantee
> > that whatever appears in there, will always be present for devices with
> the
> > given device ID in the future in the same format.
> >
> > Can you actually guarantee that?  If so, what is that guarantee based on?
> >
> 
> Although is not really documented, can we say that this is a standard "de
> facto"
> assuming that there are lots of devices in the field and for a long time
> with
> that? Can this be a guarantee?
> 
> > Thanks!
> >
> >
> >
> 
> Thanks!
> 
> [1]
> https://chromium.googlesource.com/chromiumos/third_party/coreboot/+/refs/he
> ads/chromeos-2016.05/src/vendorcode/google/chromeos/acpi/chromeos.asl

  reply	other threads:[~2020-06-10 21:28 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-13 13:46 [PATCH v4] platform: x86: Add ACPI driver for ChromeOS Enric Balletbo i Serra
2020-04-13 14:12 ` Greg Kroah-Hartman
2020-04-24 14:43   ` Enric Balletbo i Serra
2020-06-05 11:03   ` Rafael J. Wysocki
2020-04-13 20:41 ` Rafael J. Wysocki
2020-04-14 14:35   ` Enric Balletbo i Serra
2020-06-05 11:17     ` Rafael J. Wysocki
2020-06-06 18:04       ` Dmitry Torokhov
2020-06-23 14:46         ` Enric Balletbo i Serra
2020-06-10 21:21       ` Enric Balletbo i Serra
2020-06-10 21:28         ` Mario.Limonciello [this message]
2020-06-10 21:40           ` Dmitry Torokhov
2020-06-10 21:52             ` Mario.Limonciello
2020-06-10 22:43               ` Dmitry Torokhov
2020-06-11 11:06                 ` Enric Balletbo i Serra
2020-07-09  9:31                   ` Enric Balletbo i Serra
2020-07-09 11:57                     ` Rafael J. Wysocki
2020-07-09 12:01         ` Rafael J. Wysocki

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=59771d3689da41a5bbc67541aa6f4777@AUSX13MPC105.AMER.DELL.COM \
    --to=mario.limonciello@dell.com \
    --cc=2pi@mok.nu \
    --cc=andy@infradead.org \
    --cc=ayman.bagabas@gmail.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=blaz@mxxn.io \
    --cc=bleung@chromium.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=dtor@chromium.org \
    --cc=dvhart@infradead.org \
    --cc=enric.balletbo@collabora.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=groeck@chromium.org \
    --cc=gwendal@chromium.org \
    --cc=hdegoede@redhat.com \
    --cc=jeremy@system76.com \
    --cc=kernel@collabora.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab+samsung@kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rajatja@google.com \
    --cc=rjw@rjwysocki.net \
    --cc=srinivas.pandruvada@linux.intel.com \
    --cc=vbendeb@chromium.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;
as well as URLs for NNTP newsgroup(s).