New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 659819 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

ec: virtual battery: cache more attributes

Project Member Reported by sha...@chromium.org, Oct 26 2016

Issue description

Kernel 4.4 host is now asking for SB reg 03h, 0Fh, etc. Let's cache these attributes as well.
 
Owner: philipchen@chromium.org
Status: Started (was: Untriaged)
Project Member

Comment 2 by bugdroid1@chromium.org, Dec 14 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/ec/+/4912f214aabf4c9ba231329df0d3583c5ddea9d6

commit 4912f214aabf4c9ba231329df0d3583c5ddea9d6
Author: philipchen <philipchen@google.com>
Date: Sun Nov 06 00:08:15 2016

i2c_passthru: fix virtual battery operation

In some cases, the virtual battery code creates
transactions that violate SB spec.

One example:
If the host command is structured as two messages -
a write to 0x03 (reg addr), followed by two bytes of write data,
the first byte of the second message (write data) will be sent to
virtual_battery_read(), as if it were a reg read request.

Let's do the following change for virtual battery:
1. Parse the command more carefully with state machines.
2. Support write caching for some critical registers.
3. Cache more attributes (0x03 and 0x0f).

BUG=chrome-os-partner:59239,  chromium:659819 
BRANCH=none
TEST='power_supply_info' works on kevin

Change-Id: Icdeb12b21f0dc3c329f29b206b7b9395ca4c9998
Reviewed-on: https://chromium-review.googlesource.com/407987
Commit-Ready: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>

[add] https://crrev.com/4912f214aabf4c9ba231329df0d3583c5ddea9d6/common/virtual_battery.c
[modify] https://crrev.com/4912f214aabf4c9ba231329df0d3583c5ddea9d6/common/charge_state_v2.c
[modify] https://crrev.com/4912f214aabf4c9ba231329df0d3583c5ddea9d6/common/build.mk
[add] https://crrev.com/4912f214aabf4c9ba231329df0d3583c5ddea9d6/include/virtual_battery.h
[modify] https://crrev.com/4912f214aabf4c9ba231329df0d3583c5ddea9d6/common/i2c.c
[modify] https://crrev.com/4912f214aabf4c9ba231329df0d3583c5ddea9d6/include/charge_state_v2.h

Project Member

Comment 3 by bugdroid1@chromium.org, Dec 14 2016

Labels: merge-merged-firmware-gru-8785.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/ec/+/3c854599f57c8b57116e035f1af7f30967e66517

commit 3c854599f57c8b57116e035f1af7f30967e66517
Author: philipchen <philipchen@google.com>
Date: Sun Nov 06 00:08:15 2016

i2c_passthru: fix virtual battery operation

In some cases, the virtual battery code creates
transactions that violate SB spec.

One example:
If the host command is structured as two messages -
a write to 0x03 (reg addr), followed by two bytes of write data,
the first byte of the second message (write data) will be sent to
virtual_battery_read(), as if it were a reg read request.

Let's do the following change for virtual battery:
1. Parse the command more carefully with state machines.
2. Support write caching for some critical registers.
3. Cache more attributes (0x03 and 0x0f).

BUG=chrome-os-partner:59239,  chromium:659819 
BRANCH=none
TEST='power_supply_info' works on kevin

Change-Id: Icdeb12b21f0dc3c329f29b206b7b9395ca4c9998
Reviewed-on: https://chromium-review.googlesource.com/407987
Commit-Ready: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
(cherry picked from commit 4912f214aabf4c9ba231329df0d3583c5ddea9d6)
Reviewed-on: https://chromium-review.googlesource.com/419804
Commit-Queue: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>

[add] https://crrev.com/3c854599f57c8b57116e035f1af7f30967e66517/common/virtual_battery.c
[modify] https://crrev.com/3c854599f57c8b57116e035f1af7f30967e66517/common/charge_state_v2.c
[modify] https://crrev.com/3c854599f57c8b57116e035f1af7f30967e66517/common/build.mk
[add] https://crrev.com/3c854599f57c8b57116e035f1af7f30967e66517/include/virtual_battery.h
[modify] https://crrev.com/3c854599f57c8b57116e035f1af7f30967e66517/common/i2c.c
[modify] https://crrev.com/3c854599f57c8b57116e035f1af7f30967e66517/include/charge_state_v2.h

Project Member

Comment 4 by bugdroid1@chromium.org, Dec 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/ec/+/00f7fc9f5f9503617f6dc7eb26bfab051a905973

commit 00f7fc9f5f9503617f6dc7eb26bfab051a905973
Author: Philip Chen <philipchen@google.com>
Date: Thu Dec 15 06:32:57 2016

virtual_battery: fix the build error

It builds successfully on ToT, but not on firmware-gru-8785.B.
Let's fix it.

BUG=chrome-os-partner:59239,  chromium:659819 
BRANCH=none
TEST=build gru and kevin

Change-Id: Ib788c2e999959dc25db3babe7e3fa0ef7dbd6906
Reviewed-on: https://chromium-review.googlesource.com/420448
Reviewed-by: Philip Chen <philipchen@chromium.org>
Commit-Queue: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>

[modify] https://crrev.com/00f7fc9f5f9503617f6dc7eb26bfab051a905973/common/virtual_battery.c

Status: Fixed (was: Started)

Sign in to add a comment