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

Issue 902437 link

Starred by 3 users

Issue metadata

Status: Started
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

USB PD: Decouple low power mode from DRP auto toggle

Project Member Reported by aaboagye@google.com, Nov 6

Issue description

Currently our USB PD protocol stack has "low power mode" tightly coupled with PD_STATE_DRP_AUTO_TOGGLE. In addition, it has the side effect of us dual role toggling (and resolving as sources) even though we have no intention of being a source. (e.g. DRP toggle in S0, once we suspend we're still toggling, even after shutting down to S5, we're still toggling.

I think that we should not toggle in those lower power states, but instead behave properly as a sink and present only the Rd's.

Furthermore, once we're in the SNK_DISCONNECTED state, I think we should be able to go into low power mode and simply wait for a source to be detected.
 
Cc: mdhayter@chromium.org dnschn...@chromium.org
I uploaded an attempt here:  https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1320909 

Still need to update unit tests.
Cc: ecgh@chromium.org
Project Member

Comment 4 by bugdroid1@chromium.org, Nov 9

Labels: merge-merged-firmware-nocturne-10984.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/ec/+/96156f62636c772a7cbbd0ee581379cf31a81bd5

commit 96156f62636c772a7cbbd0ee581379cf31a81bd5
Author: Aseda Aboagye <aaboagye@google.com>
Date: Fri Nov 09 17:13:57 2018

pd_protocol: Don't DRP toggle lower than S0.

Currently our USB PD protocol stack has "low power mode" tightly coupled
with PD_STATE_DRP_AUTO_TOGGLE. In addition, it has the side effect of us
dual role toggling (and resolving as sources) even though we have no
intention of being a source. (e.g. DRP toggle in S0, once we suspend
we're still toggling, even after shutting down to S5, we're still
toggling.)

This commit makes it such that we not dual role toggle in those lower
power states, but instead behave properly as a sink and present only the
Rd's.

It also fixes a bug where if a port was previously sourcing in S0 and
remained sourcing in suspend, if the sink was unplugged the port would
be stuck presenting Rp's until a sink was plugged and unplugged again.

BUG=chromium:902437
BUG=b:119055792
BRANCH=firmware-nocturne-10984.B
TEST=Flash nocturne, use twinkie verify port does not dual role toggle
in suspend or off.
TEST=Verify that TCPC goes into low power mode in SNK_DISCONNECTED.
TEST=Verify that charging works in suspend and off.

Change-Id: Ie44581a1a1a82cf29a786b57a71ce70760862ca2
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/1320909
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>

[modify] https://crrev.com/96156f62636c772a7cbbd0ee581379cf31a81bd5/test/usb_pd.c
[modify] https://crrev.com/96156f62636c772a7cbbd0ee581379cf31a81bd5/common/usb_pd_protocol.c

Status: Started (was: Unconfirmed)

Sign in to add a comment