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

Issue 780364 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Mar 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

ec: charger/rt946x: Investigate if the 200ms ADC timeout in charger_get_vbus_voltage() has side effect

Project Member Reported by philipchen@chromium.org, Nov 1 2017

Issue description

In charger_get_vbus_voltage() in rt946x.c, we'll use ADC to measure VBUS.
But according to rt946x datasheet, the ADC conversion time can take up to 200ms.
So far we only use charger_get_vbus_voltage() for info. host commands and charge ramp.
But we still need to investigate if the 200ms ADC timeout would break anything.

See more discussion here:
https://chromium-review.googlesource.com/#/c/chromiumos/platform/ec/+/732084/
 
Description: Show this description
Labels: -Pri-3 Proj-Scarlet OS-Chrome Pri-2
So this probably *is* important? 200ms delays are causing things to time out?

https://issuetracker.google.com/70641844
Project Member

Comment 3 by bugdroid1@chromium.org, Mar 9 2018

Labels: merge-merged-firmware-scarlet-10388.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/ec/+/c864c5d569a77278a3decc31e15b83217521eaba

commit c864c5d569a77278a3decc31e15b83217521eaba
Author: Philip Chen <philipchen@google.com>
Date: Fri Mar 09 23:34:17 2018

charger/rt946x: Limit ADC timeout to 50ms

In practice, ADC conversion rarely takes more than 35ms.
However, according to the datasheet, ADC conversion may take
up to 200ms. But we can't wait for that long, otherwise
host command would time out. So here we set ADC timeout as
50ms. If ADC times out, we just return the last read vbus_mv.

BUG=b:70641844,  chromium:780364 
BRANCH=scarlet
TEST=test 'ectool usbpdpower' for 50k cycles
w/o seeing host command timeout

Change-Id: I09c3abf729e96b113f7a0f64a67cd35906da9e3e
Signed-off-by: Philip Chen <philipchen@google.com>
Reviewed-on: https://chromium-review.googlesource.com/956938
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/c864c5d569a77278a3decc31e15b83217521eaba/driver/charger/rt946x.c

Project Member

Comment 4 by bugdroid1@chromium.org, Mar 10 2018

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

commit a4621c5e6489042a606cc0d084c62e75e3667410
Author: Philip Chen <philipchen@google.com>
Date: Sat Mar 10 04:05:18 2018

charger/rt946x: Limit ADC timeout to 50ms

In practice, ADC conversion rarely takes more than 35ms.
However, according to the datasheet, ADC conversion may take
up to 200ms. But we can't wait for that long, otherwise
host command would time out. So here we set ADC timeout as
50ms. If ADC times out, we just return the last read vbus_mv.

BUG=b:70641844,  chromium:780364 
BRANCH=scarlet
TEST=test 'ectool usbpdpower' for 50k cycles
w/o seeing host command timeout

Change-Id: I09c3abf729e96b113f7a0f64a67cd35906da9e3e
Signed-off-by: Philip Chen <philipchen@google.com>
Reviewed-on: https://chromium-review.googlesource.com/956900
Commit-Ready: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-by: Brian Norris <briannorris@chromium.org>

[modify] https://crrev.com/a4621c5e6489042a606cc0d084c62e75e3667410/driver/charger/rt946x.c

Status: Fixed (was: Untriaged)

Sign in to add a comment