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

Issue 744673 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Last visit > 30 days ago
Closed: Jul 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

EC: Most cros-ec devices don't charge from dual role ports without the Unconstrained Power/Externally Powered bit set by default.

Project Member Reported by aaboagye@chromium.org, Jul 17 2017

Issue description

It seems that most cros-ec devices don't charge from dual role ports by default. The case that I saw was a battery pack that speaks PD which had a single Type-C port which you could either charge the battery or supply power from. The battery pack has a button on it that switches the roles. I was testing on a kevin, but I saw this behaviour on caroline as well.

I wrote a script to parse the src caps. When the battery pack switches to a source, these three caps are sent.

aaboagye@lithium:~$ ~/scripts/caps.py 0x2601912c 0x0002d12c 0x0003c0f0
0x2601912c
Fixed Supply
DRP
USB comms capable
DR data
Peak cur: 0mA
5000 mV
max cur: 3000mA
--------------------------------------------------------------------------------
0x2d12c
Fixed Supply
Peak cur: 0mA
9000 mV
max cur: 3000mA
--------------------------------------------------------------------------------
0x3c0f0
Fixed Supply
Peak cur: 0mA
12000 mV
max cur: 2400mA

# We end up picking the vSafe5V cap and transition to SNK_READY state, but we don't charge from the port. The src caps are sent again with a couple additional ones.

aaboagye@lithium:~$ ~/scripts/caps.py 0x0004b0d2 0x64096 0x26019005
0x4b0d2
Fixed Supply
Peak cur: 0mA
15000 mV
max cur: 2100mA
--------------------------------------------------------------------------------
0x64096
Fixed Supply
Peak cur: 0mA
20000 mV
max cur: 1500mA
--------------------------------------------------------------------------------

# Again, we request the vSafe5V cap, transition to SNK_READY, but still don't charge. Then the battery sends us one last cap.

0x26019005
Fixed Supply
DRP
USB comms capable
DR data
Peak cur: 0mA
5000 mV
max cur: 50mA

We report a mismatch and just remain in this not charging state indefinitely.

I believe the reason we end up not charging is because charge manager rejects this port because it's not a dedicated charger. (I think the externally powered bit isn't set in the src caps) See: https://chromium.googlesource.com/chromiumos/platform/ec/+/ba4a67558ae76c1fe3b864eb18a5c6da6fbba666/common/charge_manager.c#472.

As a test, I tried using the chgoverride command to force charging from the port and it worked just fine. I also tried defining CONFIG_CHARGE_MANAGER_DRP_CHARGING and that worked as well.


 

Comment 1 by sha...@chromium.org, Jul 17 2017

Cc: bleung@chromium.org dnschn...@chromium.org
If a battery supply PDO were used here (rather than fixed supply PDO) then I think things would just work. But, since they are using fixed supply + DRP capable, I don't see how we can distinguish the battery pack from (for example) another notebook. I don't know what we can do here, other than whitelist the VID/PID if this particular part is popular with users.

Benson, have you tested other USB-C / PD battery packs? Are they typically using a battery supply PDO?

Comment 2 by bleung@chromium.org, Jul 17 2017

Cc: bleung@google.com
I have this RAVPower battery pack, and I talked to Aseda about this in the microkitchen.

The issue with it is that it's not setting the Externaly Powered (now Unconstrained Power) bit, so our policy is not to charge from it by default. I would bet that it would work if you go to the chrome://power settings and select it explicitly.

I have this Anker battery pack, which does correctly set that bit, and it charges reliable when I plug it into our Chromebooks: 
https://bugs.chromium.org/p/chromium/issues/detail?id=744673#c1

Comment 3 by sha...@chromium.org, Jul 17 2017

Thanks, that sounds right.

"The Unconstrained Power bit Shall be set ... when the device’s primary function is to charge external devices." - That sounds like the primary function of this device.

Comment 4 by bleung@chromium.org, Jul 17 2017

Here's the Anker DRP power bank that does set the bit, that Chromebooks charge from by default: https://www.amazon.com/dp/B01MZ61PRW
Status: WontFix (was: Assigned)
Summary: EC: Most cros-ec devices don't charge from dual role ports without the Unconstrained Power/Externally Powered bit set by default. (was: EC: Most cros-ec devices don't charge from dual role ports by default.)
Thanks for the explanation. Updating summary to more accurately reflect the issue. Closing as is working as intended.

Sign in to add a comment