четверг

[Bug 2138192] Re: Got call trace when plug in device/AC in type-c port(both TBT5/TBT4)

This bug is awaiting verification that the linux-intel/6.17.0-1008.8
kernel in -proposed solves the problem. Please test the kernel and
update this bug with the results. If the problem is solved, change the
tag 'verification-needed-questing-linux-intel' to 'verification-done-
questing-linux-intel'. If the problem still exists, change the tag
'verification-needed-questing-linux-intel' to 'verification-failed-
questing-linux-intel'.


If verification is not done by 5 working days from today, this fix will
be dropped from the source code, and this bug will be closed.


See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how
to enable and use -proposed. Thank you!


** Tags added: kernel-spammed-questing-linux-intel-v2 verification-needed-questing-linux-intel

--
You received this bug notification because you are subscribed to linux
in Ubuntu.
Matching subscriptions: Bgg, Bmail, Nb
https://bugs.launchpad.net/bugs/2138192

Title:
Got call trace when plug in device/AC in type-c port(both TBT5/TBT4)

Status in HWE Next:
New
Status in linux package in Ubuntu:
Invalid
Status in linux-oem-6.17 package in Ubuntu:
Invalid
Status in linux source package in Noble:
Invalid
Status in linux-oem-6.17 source package in Noble:
Fix Released
Status in linux source package in Questing:
Fix Released
Status in linux-oem-6.17 source package in Questing:
Invalid

Bug description:
[Impact]
On systems with UCSI (USB Type-C Connector System Software Interface) version earlier than 2.1, the kernel generates warnings when handling USB Type-C connector changes. The kernel attempts to read power-related status bits that don't exist in older UCSI versions.

Error log:
[ 8.767836] Access to unsupported field at offset 0x59 (need version 0210)
[ 8.767891] WARNING: CPU: 10 PID: 133 at drivers/usb/typec/ucsi/ucsi.c:1419 ucsi_handle_connector_change+0x402/0x490 [typec_ucsi]

The code unconditionally checks the PWR_READING_READY_V2_1 bit in
connector status without verifying the UCSI version, leading to
accessing undefined bits on systems with UCSI versions older than 2.1.
This triggers a kernel warning every time a USB Type-C device is
connected or disconnected.

Affected hardware: Dell systems with USB Type-C ports using UCSI version < 2.1
Failure rate: 100% on affected hardware when USB Type-C devices are connected/disconnected

[Fix]
Add UCSI version check before reading power-related status bits. The "Power Reading" bit and associated fields were introduced in UCSI specification v2.1, so the code now limits the check for these bits only if the supported version is 2.1 or above.

Both patches are upstream in mainline kernel v6.18 and reviewed by
Intel maintainers.

Commit c851b71fd6cd ("usb: typec: ucsi: Add support for READ_POWER_LEVEL command")
- Adds support for UCSI v2.1 READ_POWER_LEVEL command to debugfs
- Exposes peak_current, avg_current, and vbus_voltage in debugfs
- Updates power values when READ_POWER_LEVEL command is sent or when device is connected

Commit 1bc28f015a19 ("usb: typec: ucsi: Add check for UCSI version")
- Fixes the above commit by adding version check
- Prevents accessing v2.1-specific bits on older UCSI versions

Links:
https://lore.kernel.org/r/20250814163028.18058-1-venkat.jayaraman@intel.com
https://lore.kernel.org/r/20250905184401.3222530-1-venkat.jayaraman@intel.com

[Test Plan]
On a system with UCSI version < 2.1:

1. Connect a USB Type-C device (e.g., USB-C to USB-A adapter, USB-C charger, or USB-C dock)
2. Check dmesg for kernel warnings related to UCSI:
$ dmesg | grep -E "Access to unsupported field|ucsi_handle_connector_change"

Without the patch: Kernel warning appears showing "Access to unsupported field at offset 0x59 (need version 0210)"
With the patch: No warnings, UCSI operates correctly on both v2.1 and earlier versions

[Where problems could occur]
The changes affect the USB Type-C UCSI driver, specifically the power reading functionality.

If the version check logic is incorrect, systems with UCSI v2.1 might
not read power levels even though they support the feature. This would
manifest as empty or stale values in the debugfs power reading files
(peak_current, avg_current, vbus_voltage) even when USB Type-C devices
are connected.

Conversely, if the version comparison is too strict, some systems with
v2.1 support might be incorrectly identified as older versions and
miss out on power reading capabilities.

The debugfs file creation could fail if there are issues with the file
operations structures, preventing users from accessing power readings
through debugfs, though this would only affect debugging functionality
and not normal USB Type-C operation.

To manage notifications about this bug go to:
https://bugs.launchpad.net/hwe-next/+bug/2138192/+subscriptions

Комментариев нет:

Отправить комментарий