Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4216479yba; Tue, 9 Apr 2019 13:48:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqzLfNcGTrVTJ4GkQUHZY6bEo5+UI+/xOgNCm145wLaCXobPxQ/zrD9XL9/pkoa/VXdZlXx6 X-Received: by 2002:a63:e44f:: with SMTP id i15mr32741822pgk.362.1554842890243; Tue, 09 Apr 2019 13:48:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554842890; cv=none; d=google.com; s=arc-20160816; b=nK1gW1OBGClloTUlF4FedP3mJHeVg9+1S3T3hyVWjSMikb8wFAHDRO4wyYCQ131B1E S817tyiWrc3sIKYXhWRhJHli03Hj7EUNJziC0/I3rNZbYWgRm6JzIcHbIoE4tSqWOC4B wnx79Qf4qfLu7vhNeqn2hUndjfOh7F2qnxb+czfLprj3pPekNdOkw7zZQN7+dv9lQ3zN 7Jo+Q3yyBFc+8JfDWbiYTa/qDrPF+rxtexatm3nu5eqiGFPwp17/3e3NKUZkgt8n7JIS YZuz81j2rNZxp0Tml3nNU1ODKi10OR1+GrB+x8VrSYxMsH7hrTg4QJ2ybreNNSM25LMj fP+g== 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:dkim-signature; bh=oyDk/9dlhI5kjqXMFYaoIcxr51Gg4hwSfB6MpA4YNh0=; b=v7ywDPPNIklecQCxKtEyfIgjjZEawJhpnZbhihHALhiP5nEmlpFj8Qi+GanDEUGhqt 66llG5bjTvXf8xBvux0VGBCVw6+DYbUivc8Lf0S5+h0OndN+UWBopoJIb8arUlB2x72m qUlWyv5aJbyVU7UbsOpjH+sXp0gDdSbaMLs19hwpZXannkt2BCDE2Dixjhzir6oRGTa/ 7NrSQbDI0d7We0/VyN/s0x7Lhu4uU9Ronif/t2PJQrN3f/wrO45Czh2r1ApKzjk2bYHc iVElMkprmREOBJ+yDWo7lgAsLF8SLV855a3/UZI3fdTXw759mVb10T1Lq7z9U9FH0624 MRAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=myzeeAj1; 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=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o6si31466449plh.186.2019.04.09.13.47.53; Tue, 09 Apr 2019 13:48:10 -0700 (PDT) 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=@chromium.org header.s=google header.b=myzeeAj1; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726554AbfDIUrJ (ORCPT + 99 others); Tue, 9 Apr 2019 16:47:09 -0400 Received: from mail-oi1-f193.google.com ([209.85.167.193]:33582 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726337AbfDIUrJ (ORCPT ); Tue, 9 Apr 2019 16:47:09 -0400 Received: by mail-oi1-f193.google.com with SMTP id e5so14824126oii.0 for ; Tue, 09 Apr 2019 13:47:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=oyDk/9dlhI5kjqXMFYaoIcxr51Gg4hwSfB6MpA4YNh0=; b=myzeeAj1RmCZTa0NhTaLGBShCrB/tfva8Uoiki+s4FGVjyyEcJpFRQ+IsWbLEx2Ga+ 0D1XvCH5vKTwoT+kS9GPsl9OStq7Kd7I+sF5WZP+QEXxUqj9iHQN48JJ3zGCE/lAMe0T hejPX9roOxJpk3jR2LwtZKN0yO4mfQtTePQOQ= 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=oyDk/9dlhI5kjqXMFYaoIcxr51Gg4hwSfB6MpA4YNh0=; b=tHU5AAKL2mcw1LlZxz9UD0kTZWFJFkcvWk9FmG6tIRUuJ8CCB2pj7a/3BMmZPboapK Gu9gXFW2bLvz5c4nEZSBhWa7iiKZdmkreir+jp5t08kvtzuk20dKsp8YM1vhTHRzyH6d xmcXREX/AugWf9bpcE2IaHsm+3UZoz1dYy7Xjc2I+upCJTIDVNVap4gY0SYeVLqUIYXs 1Pw0HKIs3idKENW4CUUxASCmT1l6P3HR3mxSFgloI/TlvEseuNlSG1StoynHd9TGayaS k9BSMbUNRPI0fnbWJ7A2R+jekuXwEDSFZ42/dvt26+3u4/OA+p0Z/+YJVM8Ty/d0xyUx Vzkw== X-Gm-Message-State: APjAAAXLtmEumHg0DfG3FmBzknktPXz9LMAe0OrpmCqVZlDIxBZAsrTW KLyRh+o9uaC/Zqwyh6Ul2BZ3xDw12SU= X-Received: by 2002:aca:51d0:: with SMTP id f199mr218982oib.104.1554842828801; Tue, 09 Apr 2019 13:47:08 -0700 (PDT) Received: from mail-oi1-f174.google.com (mail-oi1-f174.google.com. [209.85.167.174]) by smtp.gmail.com with ESMTPSA id k65sm14056204oia.16.2019.04.09.13.47.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Apr 2019 13:47:07 -0700 (PDT) Received: by mail-oi1-f174.google.com with SMTP id t81so14772815oig.10 for ; Tue, 09 Apr 2019 13:47:07 -0700 (PDT) X-Received: by 2002:aca:378a:: with SMTP id e132mr178588oia.171.1554842826817; Tue, 09 Apr 2019 13:47:06 -0700 (PDT) MIME-Version: 1.0 References: <20190404003156.205051-1-ncrews@chromium.org> In-Reply-To: <20190404003156.205051-1-ncrews@chromium.org> From: Nick Crews Date: Tue, 9 Apr 2019 14:46:55 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3] platform/chrome: Add Wilco EC Event Handling To: Enric Balletbo i Serra , Benson Leung Cc: linux-kernel , Duncan Laurie , Oleh Lamzin , Bartosz Fabianowski , Guenter Roeck , Dmitry Torokhov 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 Hi! I know people had questions with the structure/uses of the events in the previous versions of this patch. Does this clear things up? Thanks, Nick On Wed, Apr 3, 2019 at 6:31 PM Nick Crews wrote: > > The Wilco Embedded Controller can create custom events that > are not handled as standard ACPI objects. These events can > contain information about changes in EC controlled features, > such as errors and events in the dock or display. For example, > an event is triggered if the dock is plugged into a display > incorrectly. These events are needed for telemetry and > diagnostics reasons, and for possibly alerting the user. > > These events are triggered by the EC with an ACPI Notify(0x90), > and then the BIOS reads the event buffer from EC RAM via an > ACPI method. When the OS receives these events via ACPI, > it passes them along to this driver. The events are put into > a queue which can be read by a userspace daemon via a char device > that implements read() and poll(). The char device will appear at > /dev/wilco_event{n}, where n is some small non-negative integer, > starting from 0. Standard ACPI events such as the battery getting > plugged/unplugged can also come through this path, but they are > dealt with via other paths, and are ignored here. > > To test, you can tail the binary data with > $ cat /dev/wilco_event0 | hexdump -ve '1/1 "%x\n"' > and then create an event by pressing fn+Esc. > > v3 changes: > - Made commit description more accurate and useful. > - Added an exclusive lock for opening the char device, > so only one userspace process can read events at a time. > > Signed-off-by: Nick Crews