lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 28 Aug 2023 17:52:02 +0300
From:   Nikolay Borisov <nik.borisov@...e.com>
To:     heikki.krogerus@...ux.intel.com,
        Greg KH <gregkh@...uxfoundation.org>,
        linux-usb@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>
Cc:     Anthony Iliopoulos <ailiopoulos@...e.com>
Subject: [RESEND] USB PD broken on Lenovo P15gen2


[Resending as I had initially attached  a full acpi dump and it got 
bounced from the usb mailing list]

Hello,

I'm not able to use usb PD on a Lenovo Thinkpad P15gen2 laptop. It's 
equipped with 2 thunderbolt ports and a usb 3.2 gen2 usb port, all of 
which are supposed to support PD 2.0:

cat /sys/class/typec/port*/usb_power_delivery_revision
2.0
2.0
2.0


Whenever I connect a pd-capable device (i.e a mobile phone or a tablet) 
with a known good cable i.e i'm able to achieve fast charging (~30w) on 
the device when using the same cable but connected to an external 
monitor and not the laptop, I'm not able to get fast charge to work. In 
dmesg I get the following:

[ 1262.933106] usb 3-12: new high-speed USB device number 8 using xhci_hcd
[ 1263.083343] usb 3-12: New USB device found, idVendor=22d9, 
idProduct=2046, bcdDevice= 2.23
[ 1263.083350] usb 3-12: New USB device strings: Mfr=1, Product=2, 
SerialNumber=3
[ 1263.083353] usb 3-12: Product: IV2201
[ 1263.083355] usb 3-12: Manufacturer: OnePlus
[ 1263.083356] usb 3-12: SerialNumber: xxxxxxx
[ 1263.116184] ucsi_acpi USBC000:00: UCSI_GET_PDOS failed (-95)
[ 1268.676590] ucsi_acpi USBC000:00: UCSI_GET_PDOS failed (-95)
[ 1273.816117] ucsi_acpi USBC000:00: UCSI_GET_PDOS failed (-95)
[ 1273.904187] ucsi_acpi USBC000:00: UCSI_GET_PDOS failed (-95)

When looking at the state of the partner device:
$ cat /sys/class/typec/port2-partner/supports_usb_power_delivery
yes

$ cat /sys/class/typec/port2-partner/usb_power_delivery_revision
0.0


After some debugging it seems this is because the lenovo is not 
supporting CCI which seems to be some sort of a communication mechanism. 
This was asserted with the following bpftrace script:

bpftrace -e 'kretprobe:ucsi_acpi_read { printf("ucsi_acpi_read returned: 
%d\n", retval); } kretprobe:ucsi_exec_command { 
printf("ucsi_exec_command returned: %d\n", retval); }'

Attaching 2 probes...
ucsi_acpi_read returned: 0
ucsi_acpi_read returned: 0
ucsi_exec_command returned: 9
ucsi_acpi_read returned: 0
ucsi_exec_command returned: 9
ucsi_acpi_read returned: 0
ucsi_acpi_read returned: 0
ucsi_acpi_read returned: 0
ucsi_acpi_read returned: 0
ucsi_acpi_read returned: 0
ucsi_exec_command returned: 9
ucsi_acpi_read returned: 0
ucsi_acpi_read returned: 0
ucsi_acpi_read returned: 0
ucsi_acpi_read returned: 0
ucsi_exec_command returned: -95
ucsi_exec_command returned: -110
ucsi_acpi_read returned: 0
ucsi_acpi_read returned: 0
ucsi_acpi_read returned: 0
ucsi_exec_command returned: -95
ucsi_acpi_read returned: 0
ucsi_acpi_read returned: 0
ucsi_exec_command returned: 0
ucsi_acpi_read returned: 0
ucsi_acpi_read returned: 0
ucsi_exec_command returned: -95
ucsi_acpi_read returned: 0
ucsi_acpi_read returned: 0
ucsi_exec_command returned: -95
ucsi_acpi_read returned: 0
ucsi_acpi_read returned: 0
ucsi_exec_command returned: 0
ucsi_acpi_read returned: 0
ucsi_acpi_read returned: 0

This would correspond to the following snippet in ucsi_exec_command:

if (cci & UCSI_CCI_NOT_SUPPORTED)
              return -EOPNOTSUPP;


I can provide a full acpidump if need be. And I'm also using the latest 
available firmware from Lenovo, installed via lvfs. This issue happens 
on kernel 6.2 based ubuntu kernel as well as on upstream 6.4.3 but it 
seems it's not dependent on the kernel version as it's somehow related 
to lenovo's firmware.

I'm wondering whether a similar quirk like the one for the zenbook is 
also required for lenovo ?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ