Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird charging bugs/bahaviour with FW16 #28

Open
2 of 8 tasks
tacsist opened this issue Dec 22, 2024 · 2 comments
Open
2 of 8 tasks

Weird charging bugs/bahaviour with FW16 #28

tacsist opened this issue Dec 22, 2024 · 2 comments

Comments

@tacsist
Copy link

tacsist commented Dec 22, 2024

Device Information

System Model or SKU

Please select one of the following

  • Framework Laptop 13 (11th Gen Intel® Core™)
  • Framework Laptop 13 (12th Gen Intel® Core™)
  • Framework Laptop 13 (13th Gen Intel® Core™)
  • Framework Laptop 13 (AMD Ryzen™ 7040 Series)
  • Framework Laptop 13 (Intel® Core™ Ultra Series 1)
  • Framework Laptop 16 (AMD Ryzen™ 7040 Series)

BIOS VERSION

3.05

DIY Edition information

Memory: FW 2x16gb
Storage: Samsung 970 EVO Plus

Port/Peripheral information

Affects all charge capable ports with usb-c expansions (if I remember correctly, i tested with direct connection as well)

  • HP Thunderbolt Dock 120W G4
  • ISY IAC-5140-WT (PD 140W single port max power adapter)

Standalone Operation

Are you running your mainboard as a standalone device. Is standalone mode enabled in the BIOS?

  • Yes
  • No

Describe the bug

In reality this could be 2 separate issues that interact with each other.

Bug A: HP dock does not provide full 100W PD supply, instead it is set to 20V, 3.25A (as reported by linux) and never switches up to 5A.

Bug B: 140W charger makes linux confused. Sensors report 0V 5A while the battery charging seems to work at full power. Running games in this state results in worse performance than 100W chargers, with dgpu clocks constantly jump between power states (mid to high?) and makes FPS jump as well.

Where it becomes weird is with the charger from bug B. Bug A I had for a long time and at some point chucked it off to HP sucking ass (it had other bugs not related). When I would connect a 2nd cable to 140w charger with nothing on the other end, the bug B would stop and instead turns into bug A.

I do posses other 100w bricks that behave correctly and do not experience this. As I remember testing, bug A happens on my thinkpad e4 running fedora with the HP dock as well. I have not tested bug B with it. The cables do not seem to matter (i have not tested many, but I did some, most cables are USB4 spec)

Steps To Reproduce

  1. Get unlucky with your charger.
  2. Connect it to FW.
  3. Suffer. (look at lm_sensors)

Expected behavior

Get expected PD power (20V 5A or 28V 5A). Have no silly stuff happen with dGPU performance.

Operating System (please complete the following information):

Linux 6.12.6-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 19 Dec 2024 21:29:01 +0000 x86_64 GNU/Linux

Logs

Bug A with HP dock (not full output):

ucsi_source_psy_USBC000:004-isa-0000
Adapter: ISA adapter
Voltage   Back Left:  20.00 V  (min =  +5.00 V, max = +20.00 V)
Current:               3.75 A  (max =  +3.75 A)

PMF: SPL 60000mW, sPPT 60000mW, fPPT 60000mW, p3T 118000mW, ao_sppt 30000mW

[192303.037800 CL: p3 s0 i3750 v20000]
[192302.912500 CCG_RESPONSE_ACCEPT_MSG_RX 3]
[192302.969600 event set 0x0400000000000000]
[192302.978900 CYPD_RESPONSE_PD_CONTRACT_NEGOTIATION_COMPLETE 3]
[192302.984100 board_set_active_charge_port port 3, prev:-1]
[192302.992800 event set 0x0400000000000000]
[192303.016500 Updating charger with EPR correction: ma 3300]
[192303.020200 event set 0x0400000000000000]
[192303.037800 CL: p3 s0 i3750 v20000]

Bug A with 140w charger:

ucsi_source_psy_USBC000:004-isa-0000
Adapter: ISA adapter
Voltage   Back Left:  20.00 V  (min =  +5.00 V, max = +13.20 V)
Current:               3.25 A  (max =  +3.16 A)

cat /sys/class/power_supply/ucsi-source-psy-USBC000:004/uevent
DEVTYPE=power_supply
POWER_SUPPLY_NAME=ucsi-source-psy-USBC000:004
POWER_SUPPLY_TYPE=USB
POWER_SUPPLY_CHARGE_TYPE=Standard
POWER_SUPPLY_USB_TYPE=C [PD] PD_PPS
POWER_SUPPLY_ONLINE=1
POWER_SUPPLY_VOLTAGE_MIN=5000000
POWER_SUPPLY_VOLTAGE_MAX=13200000
POWER_SUPPLY_VOLTAGE_NOW=20000000
POWER_SUPPLY_CURRENT_MAX=3160000
POWER_SUPPLY_CURRENT_NOW=3250000
POWER_SUPPLY_SCOPE=System

[31030.006000 CYPD_RESPONSE_PORT_CONNECT 3]
[31030.010600 board_set_active_charge_port port 3, prev:-1]
[31030.015200 event set 0x0400000000000000]
[31030.032400 cypd_write_reg8_wait_ack C:0 0x2032 response 0x0]
[31030.036100 cypd_cfet_vbus_control:1 fail:5]
[31030.037600 event set 0x0400000000000000]
[31030.048400 cypd_write_reg8_wait_ack C:1 0x1032 response 0x0]
[31030.050200 cypd_cfet_vbus_control:2 fail:5]
[31030.056200 cypd_write_reg8_wait_ack C:1 0x2032 response 0x0]
[31030.059400 cypd_cfet_vbus_control:3 fail:5]
[31030.061100 event set 0x0400000000000000]
[31030.060700 Updating charger with EPR correction: ma 2640]
[31030.075500 CL: p3 s1 i3000 v5000]
[31030.079700 update charger!!]
[31030.087900 AC on]
[31030.089400 event set 0x0000000000000008]
[31030.091200 AC BALANCED]
[31030.092000 event set 0x0100000000000000]
[31030.100000 TODO Implement pd_set_new_power_request port 3]
PORT80: 0020
[31030.141500 Battery 28% (Display 27.5 %) / 1h:28 to empty]
PORT80: AA8F
[31030.171400 cypd_update_power_status:0=0xe]
[31030.174900 cypd_update_power_status:1=0xe]
PORT80: AA8F
[31030.204500 CCG_RESPONSE_ACCEPT_MSG_RX 3]
[31030.205500 Updating charger with EPR correction: ma 440]
[31030.210900 CL: p3 s0 i500 v5000 (forced)]
[31030.335500 event set 0x0400000000000000]
[31030.344100 CYPD_RESPONSE_PD_CONTRACT_NEGOTIATION_COMPLETE 3]
[31030.351700 CCG_RESPONSE_ACCEPT_MSG_RX 3]
[31030.348400 board_set_active_charge_port port 3, prev:3]
[31030.355200 cypd_write_reg8_wait_ack pre 0x84 ]
[31030.358800 event set 0x0400000000000000]
[31030.368300 event set 0x0100000000000000]
[31030.382900 event set 0x0400000000000000]
[31030.412200 event set 0x0400000000000000]
[31030.440200 event set 0x0400000000000000]
[31030.450900 PMF: SPL 40000mW, sPPT 40000mW, fPPT 40000mW, p3T 100000mW, ao_sppt 20000mW]
[31030.453000 Updating charger with EPR correction: ma 2860]
[31030.457800 CL: p3 s0 i3250 v20000]
[31030.460200 TODO Implement pd_set_new_power_request port 3]

Bug B with 140w charger:

ucsi_source_psy_USBC000:004-isa-0000
Adapter: ISA adapter
Voltage   Back Left:   0.00 V  (min =  +5.00 V, max =  +9.00 V)
Current:               5.00 A  (max =  +3.00 A)

cat /sys/class/power_supply/ucsi-source-psy-USBC000:004/uevent
DEVTYPE=power_supply
POWER_SUPPLY_NAME=ucsi-source-psy-USBC000:004
POWER_SUPPLY_TYPE=USB
POWER_SUPPLY_CHARGE_TYPE=Standard
POWER_SUPPLY_USB_TYPE=C [PD] PD_PPS
POWER_SUPPLY_ONLINE=1
POWER_SUPPLY_VOLTAGE_MIN=5000000
POWER_SUPPLY_VOLTAGE_MAX=9000000
POWER_SUPPLY_VOLTAGE_NOW=0
POWER_SUPPLY_CURRENT_MAX=3000000
POWER_SUPPLY_CURRENT_NOW=5000000
POWER_SUPPLY_SCOPE=System

800 CL: p3 s0 i500 v5000 (forced)]
PORT80: 0000
[31211.650400 event set 0x0400000000000000]
[31211.659300 CYPD_RESPONSE_PD_CONTRACT_NEGOTIATION_COMPLETE 3]
[31211.668300 CCG_RESPONSE_ACCEPT_MSG_RX 3]
[31211.663900 board_set_active_charge_port port 3, prev:3]
[31211.672100 cypd_write_reg8_wait_ack pre 0x84 ]
[31211.674700 event set 0x0400000000000000]
[31211.685000 AC BALANCED]
[31211.686800 event set 0x0100000000000000]
[31211.697800 event set 0x0400000000000000]
[31211.727700 event set 0x0400000000000000]
[31211.755500 event set 0x0400000000000000]
[31211.768600 PMF: SPL 40000mW, sPPT 40000mW, fPPT 40000mW, p3T 61800mW, ao_sppt 20000mW]
[31211.770300 Updating charger with EPR correction: ma 4400]
[31211.773700 CL: p3 s0 i5000 v20000]
[31211.774900 TODO Implement pd_set_new_power_request port 3]
[31211.784000 event set 0x0400000000000000]
PORT80: 0020
[31211.794900 events = 4, pre_events = 0]
[31211.796100 set AP throttling type 1 to on (0x00000010)]
[31211.822800 event set 0x0400000000000000]
[31211.834100 CCG_RESPONSE_EPR_EVENT 3]
[31211.835500 Entered EPR]
[31211.846400 Battery 29% (Display 28.8 %) / 1h:18 to empty]
[31211.851200 CCG_RESPONSE_ACCEPT_MSG_RX 3]
[31211.877800 PMF: SPL 40000mW, sPPT 40000mW, fPPT 40000mW, p3T 61800mW, ao_sppt 30000mW]
PORT80: 003B
PORT80: 0000
[31212.153500 event set 0x0400000000000000]
[31212.162000 CYPD_RESPONSE_PD_CONTRACT_NEGOTIATION_COMPLETE 3]
[31212.166300 TODO Implement pd_set_new_power_request port 3]
PORT80: 003B
[31212.193700 event set 0x0400000000000000]
PORT80: 003B
[31212.222500 ISL9241 nvdc_chrg -> nvdc]
[31212.224500 ISL9241 nvdc -> bypass]
[31212.225400 Updating charger with EPR correction: ma 5985]
[31212.231800 event set 0x0400000000000000]
PORT80: 0000
PORT80: 0000
[31212.271300 event set 0x0400000000000000]
PORT80: 0020
PORT80: 003B
[31212.309100 ISL9241 Bypass -> RTB]
[31212.320000 event set 0x0400000000000000]
PORT80: 003B
PORT80: 0020
[31212.429900 event set 0x0400000000000000]
PORT80: 003B
[31212.468100 event set 0x0400000000000000]
PORT80: 003B
[31212.511200 event set 0x0400000000000000]
PORT80: 003B
[31212.552300 event set 0x0400000000000000]
PORT80: 003B
[31212.580800 event set 0x0400000000000000]
PORT80: 003B
PORT80: 0000
[31212.629000 event set 0x0400000000000000]
PORT80: 003B
[31212.668100 event set 0x0400000000000000]
PORT80: 003B
[31212.716300 event set 0x0400000000000000]
PORT80: 003B
[31212.765300 event set 0x0400000000000000]
PORT80: 003B
[31212.823700 event set 0x0400000000000000]
PORT80: 003B
[31212.872600 event set 0x0400000000000000]
[31212.885500 event set 0x0400000000000000]
PORT80: 003B
[31212.909600 event set 0x0400000000000000]
PORT80: 003B
[31212.920700 event set 0x0100000000000000]
[31212.932500 event set 0x0400000000000000]
[31212.985400 PMF: SPL 85000mW, sPPT 85000mW, fPPT 85000mW, p3T 88520mW, ao_sppt 40000mW]
[31212.987200 events = 0, pre_events = 4]
[31212.988200 set AP throttling type 1 to off (0x00000000)]


--------------------------------------------
and here i am trying to stress the system, but no matter what i do i cannot make it start using the battery as well -> shitty performance
--------------------------------------------

PORT80: 0000
PORT80: 0000
PORT80: 0000
PORT80: 0000
PORT80: 0000
PORT80: 0000
PORT80: 3F80
PORT80: 3D01
PORT80: 3F40
PORT80: 3F44
PORT80: 3F48
PORT80: 3F70
PORT80: 0000
PORT80: 3D01
PORT80: 3F40
PORT80: 3F44
PORT80: 3F48
PORT80: 3F74
PORT80: 3F78
PORT80: 0000
PORT80: 3F80
PORT80: 3D01
PORT80: 3F40
PORT80: 3F44
PORT80: 3F70
PORT80: 0000
PORT80: 3F84
PORT80: 3F88
PORT80: 3F78
PORT80: 0000
PORT80: 0000
PORT80: 0000
PORT80: 0000
PORT80: 0000
PORT80: 0000
PORT80: 0000
PORT80: 0000
PORT80: 0000
PORT80: 0000
PORT80: 0000
PORT80: 0000
PORT80: 0000
PORT80: 0000
PORT80: 0000
PORT80: 0000
PORT80: 0000
[31511.256600 Battery 37% (Display 36.2 %) / 2h:18 to full]

Additional context

I have decided to finally stop sitting on my, at this point hardboiled, eggs and document my problems here and not just share my ramblings with @DHowett (thank you for listening <3). I do not think the dGPU could be a cause, i think it also gets confused by 0V reported. I do get the classical usci_acpi errors. I'll try to test further, but I could be AWOL. Maybe Howett can fill in some blind spots.

@tacsist tacsist changed the title Wierd charging bugs/bahaviour with FW16 Weird charging bugs/bahaviour with FW16 Dec 22, 2024
@tacsist
Copy link
Author

tacsist commented Dec 27, 2024

Just noticed that the dock and the charger are not the same for bug A (3.25 vs 3.75). Here are extended logs for the dock.

DEVTYPE=power_supply
POWER_SUPPLY_NAME=ucsi-source-psy-USBC000:001
POWER_SUPPLY_TYPE=USB
POWER_SUPPLY_CHARGE_TYPE=Standard
POWER_SUPPLY_USB_TYPE=C [PD] PD_PPS
POWER_SUPPLY_ONLINE=1
POWER_SUPPLY_VOLTAGE_MIN=5000000
POWER_SUPPLY_VOLTAGE_MAX=20000000
POWER_SUPPLY_VOLTAGE_NOW=20000000
POWER_SUPPLY_CURRENT_MAX=3750000
POWER_SUPPLY_CURRENT_NOW=3750000
POWER_SUPPLY_SCOPE=System


[120546.225600 Battery 67% (Display 66.5 %) / 1h:1 to empty]
T80: 003B
[120552.549000 event set 0x0400000000000000]
[120552.559000 CCG_RESPONSE_VDM_RX]
PORT80: 0002
[120552.592800 CYPD_RESPONSE_PD_CONTRACT_NEGOTIATION_COMPLETE 0]
[120552.600600 event set 0x0400000000000000]
[120552.611300 CCG_RESPONSE_VDM_RX]
[120552.619500 CCG_RESPONSE_ACCEPT_MSG_RX 0]
PORT80: 003B
[120552.630000 event set 0x0400000000000000]
[120552.654600 event set 0x0400000000000000]
PORT80: 003B
PORT80: 003B
[120552.676200 event set 0x0400000000000000]
PORT80: 003B
[120552.701500 event set 0x0400000000000000]
[120552.711100 CCG_RESPONSE_VDM_RX]
[120552.716200 CCG_RESPONSE_VDM_RX]
[120552.724700 event set 0x0400000000000000]
PORT80: 003B
[120552.734400 CCG_RESPONSE_VDM_RX]
PORT80: 003B
[120552.754700 event set 0x0400000000000000]
PORT80: 003B
[120552.779500 event set 0x0400000000000000]
PORT80: 003B
[120552.804700 event set 0x0400000000000000]
PORT80: 0002
[120553.142500 Battery 67% (Display 66.4 %) / 1h:3 to empty]
[120553.174000 CCG_RESPONSE_ACCEPT_MSG_RX 0]
[120553.229500 CYPD_RESPONSE_PD_CONTRACT_NEGOTIATION_COMPLETE 0]
[120553.234200 board_set_active_charge_port port 0, prev:-1]
[120553.237500 event set 0x0400000000000000]
[120553.246000 cypd_write_reg8_wait_ack pre 0x82 ]
[120553.255300 cypd_write_reg8_wait_ack pre 0x80 ]
[120553.261300 event set 0x0400000000000000]
[120553.284800 event set 0x0400000000000000]
[120553.297800 update charger!!]
[120553.299800 AC BALANCED]
[120553.300600 event set 0x0100000000000000]
[120553.316000 event set 0x0400000000000000]
[120553.315500 AC on]
[120553.325800 event set 0x0000000000000008]
[120553.328800 Updating charger with EPR correction: ma 3300]
[120553.344600 event set 0x0400000000000000]
[120553.356100 CL: p0 s0 i3750 v20000]
[120553.358100 TODO Implement pd_set_new_power_request port 0]
[120553.373800 event set 0x0400000000000000]
PORT80: 003B
[120553.398100 cypd_update_power_status:0=0xe]
[120553.401600 cypd_update_power_status:1=0xe]
[120553.405100 Battery 67% (Display 66.4 %) / 1h:3 to empty]
[120553.411700 event set 0x0400000000000000]
PORT80: 0020
[120553.441900 CCG_RESPONSE_VDM_RX]
[120553.563800 event set 0x0400000000000000]
PORT80: 003B
[120553.591900 event set 0x0400000000000000]
PORT80: 003B
[120553.620500 event set 0x0400000000000000]
[120553.638500 event set 0x0400000000000000]
PORT80: 003B
PORT80: 003B
[120553.665700 event set 0x0400000000000000]
[120553.683500 event set 0x0400000000000000]
PORT80: 003B
[120553.709500 event set 0x0400000000000000]
PORT80: 003B
PORT80: 003B
[120553.737700 event set 0x0400000000000000]
PORT80: 003B
[120553.766900 event set 0x0400000000000000]
[120553.784800 event set 0x0400000000000000]
PORT80: 003B
PORT80: 003B
[120553.814000 event set 0x0400000000000000]
PORT80: 003B
[120553.842000 event set 0x0400000000000000]
PORT80: 003B
[120553.871100 event set 0x0400000000000000]
[120553.888900 event set 0x0400000000000000]
PORT80: 003B
PORT80: 003B
[120553.917600 event set 0x0400000000000000]
[120553.931700 event set 0x0400000000000000]
[120553.947300 event set 0x0400000000000000]
PORT80: 003B
PORT80: 003B
[120553.976800 event set 0x0400000000000000]
PORT80: 003B
[120554.004800 event set 0x0400000000000000]
PORT80: 003B
[120554.033700 event set 0x0400000000000000]
PORT80: 003B
[120554.061500 event set 0x0400000000000000]
PORT80: 003B
[120554.089400 event set 0x0400000000000000]
PORT80: 003B
[120554.117600 event set 0x0400000000000000]
[120554.146700 event set 0x0400000000000000]
[120554.175100 event set 0x0400000000000000]
[120554.202100 event set 0x0400000000000000]
[120554.201100 PMF: SPL 60000mW, sPPT 60000mW, fPPT 60000mW, p3T 118000mW, ao_sppt 30000mW]
[120554.230900 event set 0x0400000000000000]
PORT80: 003B
[120554.260100 event set 0x0400000000000000]
PORT80: 003B
PORT80: 003B
[120554.288400 event set 0x0400000000000000]
PORT80: 0020
[120554.317400 event set 0x0400000000000000]
PORT80: 3F30
[120554.342200 event set 0x0400000000000000]
PORT80: 003B
PORT80: 3F70
PORT80: 3F74
[120554.818000 event set 0x0400000000000000]
PORT80: 003B
[120554.842400 event set 0x0400000000000000]
PORT80: 003B
[120555.918700 HC 0x0115 err 1]
[120563.042900 Battery 67% (Display 66.5 %) / 3h:53 to full]

@tacsist
Copy link
Author

tacsist commented Dec 30, 2024

With the dock, the framework-systems seems to be confused with current V, idk if it's a tool bug or actual ec bug.

 sudo framework_tool --driver cros-ec --pdports
USB-C Port 0 (Right Back):
  Role:          Sink
  Charging Type: PD
  Voltage Now:   0.0 V, Max: 20.0 V
  Current Lim:   3750 mA, Max: 3750 mA
  Dual Role:     Charger
  Max Power:     75.0 W

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant