Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1352876ybt; Thu, 9 Jul 2020 05:05:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylyn3YscptOManMNC9lYV89K/lp4NoExhk63JhcC/YXdDiq5tL4A93cUqS9ABqljzecnCu X-Received: by 2002:aa7:c887:: with SMTP id p7mr58294100eds.240.1594296321209; Thu, 09 Jul 2020 05:05:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594296321; cv=none; d=google.com; s=arc-20160816; b=UZoglCZ92QZuOqMpObm4UBkmPbvvjNn8zdjFg5Sbpy7SntAhf4Tm9Q4ySX9lCc0MyW xx3i4nE3QmmpEqXHm6Vm6Q/asCdklILJISRq6z/Z6LQs4P1s3XLTME6v/6qWJcYLUp/E oCl5wwhuMBLfJU9BNfmfs8UsAS4Xll4QNfGwnUqXbL5RrLDnFdNFvODfYllfBW4EoNXA c6lM6MBzQnUZBQzv1Xy+vNqsipG9vTwDx1P2E4sBfD0HiTMxrdXVUh30AsCrSM5O0Fkr hqUT1Dd44+BJ29rgvsxntvSHFbeDXfgGTbzLWlB3KXx1MWOcuWSDXSZrmWAY/NEx3ZZ9 OTnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=arGB3qPgvw7a+4/UTLYjhwxhE2h0cMITMWEpR/EppSw=; b=s9dZuGPs3IU3AhnfSfFtBel2tI3pO3vrCuYAF5N/usFbxcVP+VQneX3oVU1BPU4Kcp ABgusp1FoLyGCMbil6sf4t/Fo/KXopY2/sOuRPwKQtVGC0WRGUY4GtwjFjHgkvaANybg tm/xAZJuCb1DeE/aN5Wx0qLBlP1vhnlyFCTS2iPDPHFYDeI5PSn3G/V4jBijzgLzPQ0Q QbNjuNygD2sIKqche1OiuAeBRxFY5wR7nBhgYtCeyVXNh+2Qloir2F1iHH12pDqNfkBa iT/bi+r4uQvdXmkQ4DnZ3blhBbq1CzZy/yQasO19qXXyJ58QewfmBLEypkqo2n4AlL9f BoYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i10si1662754ejf.146.2020.07.09.05.04.54; Thu, 09 Jul 2020 05:05:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727107AbgGIMB5 (ORCPT + 99 others); Thu, 9 Jul 2020 08:01:57 -0400 Received: from mail-oi1-f194.google.com ([209.85.167.194]:41371 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726327AbgGIMB4 (ORCPT ); Thu, 9 Jul 2020 08:01:56 -0400 Received: by mail-oi1-f194.google.com with SMTP id y22so1637967oie.8; Thu, 09 Jul 2020 05:01:56 -0700 (PDT) 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; bh=arGB3qPgvw7a+4/UTLYjhwxhE2h0cMITMWEpR/EppSw=; b=uBsTAjL0aPJAYww5WDd40Mr+Kb/BoFcsie8Swc9NxfoAJZOWypqKGuXWhP9+c/pbu6 nAORn6sZlxeobItXKwsfxKu9BEv/f5svBcPkv5MIWIqtnZvgC1dFJOFPX/pALwdk9hE1 zNAe/g13uAMmrNtlsVJuqMmtJCX5pkLvRZ4XwPQ0uu6I6yUGiVZLbE4zvBK6SWK6+AqO VOmI5sSLAfG1ZjVzRsCM6rVFGeKb6H6LveZRJDcVn+H3iT14ChjWGv1duWrWcjTOdp+/ feSx378mjhOiQiFuUhWyZ1JJraCwkpy5bfJ3axinEtVjfIM3BWh4THT+U8weM5PJMYBG sFkA== X-Gm-Message-State: AOAM530cJJVruX889HBaeiazC02MqS30HE/+rCvqQ1F8oiDbaMuHaWb4 vMTLiMhFhzOAd6szaKh/vil35DmUXcIAhopj5FU= X-Received: by 2002:aca:4a89:: with SMTP id x131mr11350502oia.103.1594296115512; Thu, 09 Jul 2020 05:01:55 -0700 (PDT) MIME-Version: 1.0 References: <20200413134611.478441-1-enric.balletbo@collabora.com> <10490419.gsntqH5CaE@kreacher> <4e7f8bf3-b72b-d418-ec95-e1f8c3d61261@collabora.com> In-Reply-To: <4e7f8bf3-b72b-d418-ec95-e1f8c3d61261@collabora.com> From: "Rafael J. Wysocki" Date: Thu, 9 Jul 2020 14:01:43 +0200 Message-ID: Subject: Re: [PATCH v4] platform: x86: Add ACPI driver for ChromeOS To: Enric Balletbo i Serra Cc: "Rafael J. Wysocki" , "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 , =?UTF-8?Q?Bla=C5=BE_Hrastnik?= , Darren Hart , Dmitry Torokhov , Greg Kroah-Hartman , Hans de Goede , Jeremy Soller , Mattias Jacobsson <2pi@mok.nu>, Mauro Carvalho Chehab , Rajat Jain , Srinivas Pandruvada , Platform Driver Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 10, 2020 at 11:21 PM Enric Balletbo i Serra wrote: > > 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 > >>> 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. Please do. > > 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 [cut] > > 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? I would like the firmware interface to be documented in Documentation/firmware-guide/acpi/ in the first place, given the lack of any existing documentation of it that can be pointed to. Thanks!