USB-C PD power charger behavior

I read here many issues with USB-C PD power supply, and I have here 2 PD 33W chargers (same model), that booted fine and run with the two boards with NVme 512GB and 1TB, no problem, so i think.

Let’s call PD1 and PD2.
The odd thing is:

PD1 boots and negotiate like this:

tcpm_source_psy_4_0022-i2c-4-22
Adapter: rk3x-i2c
in0:          20.00 V  (min = +20.00 V, max = +20.00 V)
curr1:         1.35 A  (max =  +1.35 A)

PD2 boots (same board) and negotiate like this:

tcpm_source_psy_4_0022-i2c-4-22
Adapter: rk3x-i2c
in0:           9.00 V  (min =  +9.00 V, max =  +9.00 V)
curr1:         3.00 A  (max =  +3.00 A)

PD2 after a few minutes, don’t know the reason, re-negotiate like this:

tcpm_source_psy_4_0022-i2c-4-22
Adapter: rk3x-i2c
in0:           9.00 V  (min =  +9.00 V, max =  +9.00 V)
curr1:         2.00 A  (max =  +2.00 A)

PD2 seems to take more time to boot.
PD1 and PD2 didn’t come from the same source.

Is this the expected behavior, i mean should it keep negotiating? I can see there is an event count and a wakeup event.

Can someone explain this, so i can try to monitor the thing in real-time?

i found out why, it immediately reboots on the first boot and then negotiates 9V 3A. The cables are a bit different.

For the drop in the curr1 i have no idea but looks very dangerous if it reset in the middle of a build…

1 Like

You can check pd log sudo cat /sys/kernel/debug/usb/tcpm-4-0022.

Here is the log. It happens after 5 mins…

PD1 - Xiaomi 33W (came with the phone)

tcpm_source_psy_4_0022-i2c-4-22
Adapter: rk3x-i2c
in0:          20.00 V  (min = +20.00 V, max = +20.00 V)
curr1:         1.35 A  (max =  +1.35 A)


[    1.646365] Setting usb_comm capable false
[    1.650980] Setting voltage/current limit 0 mV 0 mA
[    1.650984] polarity 0
[    1.651000] Requesting mux state 0, usb-role 0, orientation 0
[    1.651797] state change INVALID_STATE -> SNK_UNATTACHED [rev1 NONE_AMS]
[    1.651815] CC1: 0 -> 0, CC2: 0 -> 0 [state SNK_UNATTACHED, polarity 0, disconnected]
[    1.651819] Start toggling
[    1.668124] CC1: 0 -> 5, CC2: 0 -> 0 [state TOGGLING, polarity 0, connected]
[    1.668127] state change TOGGLING -> SNK_ATTACH_WAIT [rev1 NONE_AMS]
[    1.668132] pending state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED @ 100 ms [rev1 NONE_AMS]
[    1.768142] state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED [delayed 100 ms]
[    1.768148] state change SNK_DEBOUNCED -> SNK_ATTACHED [rev1 NONE_AMS]
[    1.768151] polarity 0
[    1.768154] Requesting mux state 1, usb-role 2, orientation 1
[    1.768954] state change SNK_ATTACHED -> SNK_STARTUP [rev1 NONE_AMS]
[    1.768962] state change SNK_STARTUP -> SNK_DISCOVERY [rev3 NONE_AMS]
[    1.768964] Setting voltage/current limit 5000 mV 3000 mA
[    1.768968] vbus=0 charge:=1
[    1.768971] state change SNK_DISCOVERY -> SNK_WAIT_CAPABILITIES [rev3 NONE_AMS]
[    1.774069] pending state change SNK_WAIT_CAPABILITIES -> SNK_SOFT_RESET @ 100 ms [rev3 NONE_AMS]
[    1.868192] PD RX, header: 0x41a1 [1]
[    1.868196]  PDO 0: type 0, 5000 mV, 3000 mA [DE]
[    1.868198]  PDO 1: type 0, 9000 mV, 3000 mA []
[    1.868199]  PDO 2: type 0, 15000 mV, 1800 mA []
[    1.868200]  PDO 3: type 0, 20000 mV, 1350 mA []
[    1.868202] state change SNK_WAIT_CAPABILITIES -> SNK_NEGOTIATE_CAPABILITIES [rev3 POWER_NEGOTIATION]
[    1.868204] Setting usb_comm capable false
[    1.868209] cc=0 cc1=5 cc2=0 vbus=0 vconn=sink polarity=0
[    1.868210] Requesting PDO 3: 20000 mV, 1350 mA
[    1.868211] PD TX, header: 0x1082
[    1.875975] PD TX complete, status: 0
[    1.876003] pending state change SNK_NEGOTIATE_CAPABILITIES -> HARD_RESET_SEND @ 60 ms [rev3 POWER_NEGOTIATION]
[    1.877720] PD RX, header: 0x3a3 [1]
[    1.877726] state change SNK_NEGOTIATE_CAPABILITIES -> SNK_TRANSITION_SINK [rev3 POWER_NEGOTIATION]
[    1.877732] Setting standby current 5000 mV @ 500 mA
[    1.877736] Setting voltage/current limit 5000 mV 500 mA
[    1.877744] pending state change SNK_TRANSITION_SINK -> HARD_RESET_SEND @ 500 ms [rev3 POWER_NEGOTIATION]
[    2.011866] PD RX, header: 0x5a6 [1]
[    2.011877] Setting voltage/current limit 20000 mV 1350 mA
[    2.011894] state change SNK_TRANSITION_SINK -> SNK_READY [rev3 POWER_NEGOTIATION]
[    2.012040] AMS POWER_NEGOTIATION finished

PD2 - Xiaomi 33W received apart (fake?)

tcpm_source_psy_4_0022-i2c-4-22
Adapter: rk3x-i2c
in0:           9.00 V  (min =  +9.00 V, max =  +9.00 V)
curr1:         3.00 A  (max =  +3.00 A)

tcpm_source_psy_4_0022-i2c-4-22
Adapter: rk3x-i2c
in0:           9.00 V  (min =  +9.00 V, max =  +9.00 V)
curr1:         2.00 A  (max =  +2.00 A)




[    1.645351] Setting usb_comm capable false
[    1.649967] Setting voltage/current limit 0 mV 0 mA
[    1.649971] polarity 0
[    1.649973] Requesting mux state 0, usb-role 0, orientation 0
[    1.650766] state change INVALID_STATE -> SNK_UNATTACHED [rev1 NONE_AMS]
[    1.650771] CC1: 0 -> 0, CC2: 0 -> 0 [state SNK_UNATTACHED, polarity 0, disconnected]
[    1.650776] Start toggling
[    1.667153] CC1: 0 -> 5, CC2: 0 -> 0 [state TOGGLING, polarity 0, connected]
[    1.667157] state change TOGGLING -> SNK_ATTACH_WAIT [rev1 NONE_AMS]
[    1.667161] pending state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED @ 100 ms [rev1 NONE_AMS]
[    1.767283] state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED [delayed 100 ms]
[    1.767296] state change SNK_DEBOUNCED -> SNK_ATTACHED [rev1 NONE_AMS]
[    1.767302] polarity 0
[    1.767307] Requesting mux state 1, usb-role 2, orientation 1
[    1.768398] state change SNK_ATTACHED -> SNK_STARTUP [rev1 NONE_AMS]
[    1.768434] state change SNK_STARTUP -> SNK_DISCOVERY [rev3 NONE_AMS]
[    1.768440] Setting voltage/current limit 5000 mV 3000 mA
[    1.768448] vbus=0 charge:=1
[    1.768456] state change SNK_DISCOVERY -> SNK_WAIT_CAPABILITIES [rev3 NONE_AMS]
[    1.774096] pending state change SNK_WAIT_CAPABILITIES -> SNK_SOFT_RESET @ 100 ms [rev3 NONE_AMS]
[    1.864177] PD RX, header: 0x2fa1 [1]
[    1.864192]  PDO 0: type 0, 5000 mV, 3000 mA [DE]
[    1.864199]  PDO 1: type 0, 9000 mV, 3000 mA []
[    1.864204] state change SNK_WAIT_CAPABILITIES -> SNK_NEGOTIATE_CAPABILITIES [rev3 POWER_NEGOTIATION]
[    1.864213] Setting usb_comm capable false
[    1.864227] cc=0 cc1=5 cc2=0 vbus=0 vconn=sink polarity=0
[    1.864232] Requesting PDO 1: 9000 mV, 3000 mA
[    1.864237] PD TX, header: 0x1082
[    1.874270] PD TX complete, status: 0
[    1.874285] pending state change SNK_NEGOTIATE_CAPABILITIES -> HARD_RESET_SEND @ 60 ms [rev3 POWER_NEGOTIATION]
[    1.876195] PD RX, header: 0x1a3 [1]
[    1.876200] state change SNK_NEGOTIATE_CAPABILITIES -> SNK_TRANSITION_SINK [rev3 POWER_NEGOTIATION]
[    1.876207] Setting standby current 5000 mV @ 500 mA
[    1.876211] Setting voltage/current limit 5000 mV 500 mA
[    1.876217] pending state change SNK_TRANSITION_SINK -> HARD_RESET_SEND @ 500 ms [rev3 POWER_NEGOTIATION]
[    2.032431] PD RX, header: 0x3a6 [1]
[    2.032436] Setting voltage/current limit 9000 mV 3000 mA
[    2.032445] state change SNK_TRANSITION_SINK -> SNK_READY [rev3 POWER_NEGOTIATION]
[    2.032521] AMS POWER_NEGOTIATION finished
[  425.831854] PD RX, header: 0x1ad [1]
[  425.831866] state change SNK_READY -> SOFT_RESET [rev3 SOFT_RESET_AMS]
[  425.831877] PD TX, header: 0x83
[  425.840245] PD TX complete, status: 0
[  425.840261] AMS SOFT_RESET_AMS finished
[  425.840266] state change SOFT_RESET -> SNK_WAIT_CAPABILITIES [rev3 NONE_AMS]
[  425.849397] pending state change SNK_WAIT_CAPABILITIES -> HARD_RESET_SEND @ 310 ms [rev3 NONE_AMS]
[  425.849407] PD RX, header: 0x23a1 [1]
[  425.849416]  PDO 0: type 0, 5000 mV, 3000 mA [DE]
[  425.849422]  PDO 1: type 0, 9000 mV, 2000 mA []
[  425.849427] state change SNK_WAIT_CAPABILITIES -> SNK_NEGOTIATE_CAPABILITIES [rev3 POWER_NEGOTIATION]
[  425.849437] Setting usb_comm capable false
[  425.849467] cc=0 cc1=5 cc2=0 vbus=0 vconn=sink polarity=0
[  425.849473] Requesting PDO 1: 9000 mV, 2000 mA
[  425.849482] PD TX, header: 0x1282
[  425.860603] PD TX complete, status: 0
[  425.860620] pending state change SNK_NEGOTIATE_CAPABILITIES -> HARD_RESET_SEND @ 60 ms [rev3 POWER_NEGOTIATION]
[  425.862342] PD RX, header: 0x5a3 [1]
[  425.862346] state change SNK_NEGOTIATE_CAPABILITIES -> SNK_TRANSITION_SINK [rev3 POWER_NEGOTIATION]
[  425.862354] pending state change SNK_TRANSITION_SINK -> HARD_RESET_SEND @ 500 ms [rev3 POWER_NEGOTIATION]
[  426.018443] PD RX, header: 0x7a6 [1]
[  426.018456] Setting voltage/current limit 9000 mV 2000 mA
[  426.018477] state change SNK_TRANSITION_SINK -> SNK_READY [rev3 POWER_NEGOTIATION]
[  426.018488] AMS POWER_NEGOTIATION finished

@amazingfate
Kernel is with your patch with lower values.

Your board received a softreset from the pd pd power, and renegotiated to 9V2A because the 9V3A capability was gone. I don’t know your pd power act like this. It’s hardcoded in the IC of the pd charger.