Bug 2223185

Summary: USBC Port stops charging on some un/plug action
Product: [Fedora] Fedora Reporter: 9Lukas5 <lukas.wiest-fedoraproject>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: CLOSED CANTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 38CC: acaringi, adscvr, airlied, alciregi, bskeggs, hdegoede, hpa, jarodwilson, josef, kernel-maint, lgoncalv, linville, masami256, mchehab, ptalbert, steved
Target Milestone: ---Keywords: Desktop
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-12-07 11:45:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
dmesg log with USBC0 ucsi_acpi lines in it
none
dmesg log with GET_CONNECTOR_STATUS failed none

Description 9Lukas5 2023-07-16 10:27:21 UTC
I'm really sorry, not being able to provide a definite way to guranteed reproduce it, as I sometimes get it, and sometimes don't.

I have one USB-C Port, capable of Data transfer charging through and USB-PD (Power Delivery). Often when I use a Hub with USB-PD passthrough capabalities I get the situation that my Port locks charging completely on some point when dis-/reconncting the Hub from the laptop, or the power brick from the Hub, leaving the USB-connection between Hub and laptop plugged in.

If the port locks down, nothing brings it back until I reboot into the BIOS and disable the built-in battery. This mode is thought to be enabled before opening the device, so this seems to reset the USB-controller on the board I guess?

I tried to narrow down a specific kernel version, but as I can't find a guaranteed way to reproduce it, I can't really say if the problem exists or doesn't for sure.

What I found in some, but not all, dmesg-outputs during the un-/plug trials is this:

`ucsi_acpi USBC000:00: UCSI_GET_PDOS failed (-5)`
and sometimes also this:
`ucsi_acpi USBC000:00: con1: failed to register partner alt modes (-5)`

The second one is interesting, as my Port doesn't support display alternate mode^^

Reproducible: Sometimes

Steps to Reproduce:
1. start laptop without Hub attached
2. connect power-brick and Hub
3. connect hub and laptop, it charges
4. disconnect and reconnect Hub<->laptop
5. disconnect and reconnect Hub<->power brick
6. disconnect Hub<->laptop, disconnect Hub<->power brick, connect Hub<->laptop, connect Hub<->power brick
Actual Results:  
Sometimes along the way it didn't start charging anymore.

Expected Results:  
It should always start charging again

Device:
Lenovo Ideapad Flex5 14ARE05
AMD Ryzen 7 4700U
Firmware/BIOS: EECN41WW
Kernel 6.3.12-200.fc38.x86_64

Comment 1 9Lukas5 2023-07-16 10:33:14 UTC
Created attachment 1976057 [details]
dmesg log with USBC0 ucsi_acpi lines in it

Comment 2 9Lukas5 2023-07-16 10:34:03 UTC
Created attachment 1976058 [details]
dmesg log with GET_CONNECTOR_STATUS failed

Comment 3 9Lukas5 2023-08-26 09:45:32 UTC
Hey, anyone even had a look at this?

Comment 4 9Lukas5 2023-12-07 09:56:24 UTC
Guys, I get it that there are maybe lots of issues flying around, but could at least anyone give any sign, that I'm not talking into the void here?

Comment 5 Hans de Goede 2023-12-07 10:09:38 UTC
Going by your original description this sounds like either your PD-controller itself, or the part of the embedded-controller  (EC) which talks to the PD-controller is hanging and needs a power-cycle to be reset.

Both the PD-controller and the EC are custom micro-controllers running their own firmware outside control of Linux, so there is nothing we can do here. First step would be to check with your laptop vendor for a firmware / BIOS update.

The UCSI errors are Linux trying to ask the EC / PD-controller about what charge settings have been negotiated through the standard ACPI UCSI interface and failing to do so, presumably because they are not responding.

You could also consider borrowing another USB-PD pass-through capable hub and try that. It might be that this one just happens to tickle your laptop in the wrong way.

On some laptops you can also reset the EC by pressing the power-button for more then 30 seconds, so you could try that next time as an alternative to removing the battery.

Comment 6 9Lukas5 2023-12-07 11:45:40 UTC
Hey thanks (y)

So, as I already installed the newest BOIS and the problem persists and there is nothing you could do, I have to assume it is a hardware defect?
Meaning, the most useful workaround would be a way to powercycle the USB-controller from the os, in order to prevent rebooting the machine?

Then there's no reason to keep it open I guess :/, thanks for the response.