ec: charger/rt946x: Investigate if the 200ms ADC timeout in charger_get_vbus_voltage() has side effect |
||||
Issue descriptionIn 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/
,
Mar 8 2018
So this probably *is* important? 200ms delays are causing things to time out? https://issuetracker.google.com/70641844
,
Mar 9 2018
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
,
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
,
Mar 27 2018
|
||||
►
Sign in to add a comment |
||||
Comment 1 by philipchen@chromium.org
, Nov 1 2017