New issue
Advanced search Search tips

Issue 594037 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment

Implement sysfs interface for EC MOTIONSENSE_CMD_KB_WAKE_ANGLE

Project Member Reported by jwer...@chromium.org, Mar 11 2016

Issue description

A new power_manager feature ( issue 552049 ) needs to send an EC command to set the keyboard wake angle. I first implemented this by calling ectool, but it has now turned out that using ectool on production images is not desired. Therefore, we need a new sysfs API that allows userspace to write the wake angle. In order to support older convertibles, this needs to be backported at least back to 3.14.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Mar 11 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/4d53b0b6f7d015f9cb18495e657e49493152f573

commit 4d53b0b6f7d015f9cb18495e657e49493152f573
Author: Julius Werner <jwerner@chromium.org>
Date: Thu Mar 10 22:50:47 2016

power: Temporarily disable EcWakeupHelper

CL:329948 added a new feature to powerd that needs to call into ectool
to control the EC keyboard wake angle. Unfortunately, I only just now
Discovered that ectool is only available in test images, and that
deploying it on production images is not desired.

This patch temporarily disables the EcWakeupHelper that was introduced
by that patch until we can implement the appropriate kernel interface to
make this work again. It's supposed to be a short-term band-aid to avoid
spamming crash reports and intentionally not removing any code yet,
since it's not completely clear how the new interface will look and
which parts we'll still need yet.

BUG=chrome-os-partner:50993, chromium:594037 
TEST=Emerged with tests on Minnie and Falco.

Change-Id: I8480445df76f460250c818ed4af5ba48269e22ea
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/332260
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/4d53b0b6f7d015f9cb18495e657e49493152f573/power_manager/powerd/system/ec_wakeup_helper.cc

Project Member

Comment 2 by bugdroid1@chromium.org, Mar 18 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/b22f158e6e66396448448e5756613e79b92f7700

commit b22f158e6e66396448448e5756613e79b92f7700
Author: Julius Werner <jwerner@chromium.org>
Date: Wed Mar 16 22:17:21 2016

chromeos-accelerometer-init: Make udev grant kb wake access to powerd

This patch extends the udev init script for the EC accelerometer driver
to grant write access of the in_angl_offset or kb_wake_angle node (one
of which controls the motionsense kb_wake property on the EC, depending
on kernel version) to the power group. It is used by powerd to control
wakeup behavior.

BUG= chromium:594037 
TEST=Deployed on Minnie and confirmed the access rights were changed
accordingly after reboot.

Change-Id: I59f0ed2b4c9c57388355729d8608cdde870644e4
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/333075
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

[rename] https://crrev.com/b22f158e6e66396448448e5756613e79b92f7700/chromeos-base/chromeos-accelerometer-init/chromeos-accelerometer-init-0.0.1-r8.ebuild
[modify] https://crrev.com/b22f158e6e66396448448e5756613e79b92f7700/chromeos-base/chromeos-accelerometer-init/files/udev/accelerometer-init.sh

Project Member

Comment 3 by bugdroid1@chromium.org, Mar 19 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/8d36df646da90c32667222ad4b7ffae41fb323ee

commit 8d36df646da90c32667222ad4b7ffae41fb323ee
Author: Julius Werner <jwerner@chromium.org>
Date: Wed Mar 16 22:13:15 2016

power: Reenable EcWakeupHelper via sysfs access

This patch reenables the EcWakeupHelper class that was disabled in
CL:332260 and implements the EC keyboard wake angle control through
this interface. Since it changed from 3.14 to 3.18 kernels and we want
to support older devices as well, we need to implement support and
detection for two slightly different interfaces.

Also remove the old powerd_setuid_helper code that calls ectool since it
is no longer needed.

CQ-DEPEND=CL:333075
BUG= chromium:594037 
TEST=Deployed on Minnie, confirmed that keyboard wakeup behavior was as
expected. Built with unit tests for Falco. Deployed on Oak and confirmed
that kb_wake property on the EC was written correctly.

Change-Id: I4c263feec6f35c3811ff4ec3149a18a59fd61257
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/333038
Commit-Ready: Dan Shi <dshi@google.com>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

[modify] https://crrev.com/8d36df646da90c32667222ad4b7ffae41fb323ee/power_manager/powerd/powerd_setuid_helper.cc
[modify] https://crrev.com/8d36df646da90c32667222ad4b7ffae41fb323ee/power_manager/powerd/system/ec_wakeup_helper.h
[modify] https://crrev.com/8d36df646da90c32667222ad4b7ffae41fb323ee/power_manager/powerd/system/ec_wakeup_helper.cc

Status: Fixed (was: Assigned)
Thanks for all the help with this, Gwendal!

Sign in to add a comment