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

Issue 870365 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Aug 7
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

chgstate_set_manual_current incorrectly handles `disable` commands

Project Member Reported by jbrandmeyer@chromium.org, Aug 2

Issue description

Found during a review of charger state machine commands in the EC.

common/charge_state_v2.c:chgstate_set_manual_current() does not correctly handle an argument of -1 (disable manual override).  When the charger driver picks the closest current limit, it clamps the value to zero instead of passing along the -1.  Thus, attempting to clear the manual current limit by just setting this single parameter to -1 fails.


Workaround: `ectool chargecontrol normal` from the AP clears manual current and voltage overrides in a way that bypasses this bug.
 
Status: Started (was: Untriaged)
Project Member

Comment 2 by bugdroid1@chromium.org, Aug 7

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

commit 7216341f4be4202df6f0dab493bb51848ed249d5
Author: Jonathan Brandmeyer <jbrandmeyer@chromium.org>
Date: Tue Aug 07 08:51:19 2018

charger: Correctly clear manual current limit override

The official way to clear the manual current limit is to set the
override value to -1.  However, paths through the host command
CHARGE_STATE_CMD_SET_PARAM that attempt to set -1 instead select the
"nearest" current of zero.  This disables the charger instead of
disabling the manual current limit override.

BUG= chromium:870365 , b:111943872
BRANCH=none
TEST=Use ectool to set and clear the current limit via
`ectool chargestate param 1 0xffffffff` on Careena clears the limit.
Signed-off-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org>

Change-Id: Icfd1162300dedc2d8b7bca1c95f1ff0da6aa72a3
Reviewed-on: https://chromium-review.googlesource.com/1163983
Commit-Ready: Jonathan Brandmeyer <jbrandmeyer@chromium.org>
Tested-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org>
Reviewed-by: Edward Hill <ecgh@chromium.org>

[modify] https://crrev.com/7216341f4be4202df6f0dab493bb51848ed249d5/common/charge_state_v2.c

Status: Fixed (was: Started)

Sign in to add a comment