public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
* [BUG] ucsi_acpi: Fails to bind on USBC000 devices, version=0 in NVS blocks probe
@ 2026-04-21 11:15 Daniel Dev
  2026-04-27  9:09 ` Heikki Krogerus
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Dev @ 2026-04-21 11:15 UTC (permalink / raw)
  To: linux-usb@vger.kernel.org
  Cc: heikki.krogerus@linux.intel.com, gregkh@linuxfoundation.org

Hello everyone,

I am reporting two related issues in ucsi_acpi that prevent it from binding on Lenovo ThinkPad T14 Gen 2a (AMD) platforms. The result is that /sys/class/typec/ is empty and USB-C display hotplug is non-functional unless a manual workaround is applied.

Hardware:
- Machine: Lenovo ThinkPad T14 Gen 2a (20XLS10M00)
- CPU: AMD Ryzen 7 PRO 5850U
- Kernel: 6.19.12-200.fc43.x86_64 (Reproduced on 6.19.12, 6.19.9, and 6.18.19)
- Distros tested: Fedora 43, CachyOS (Arch-based), Arch and Kubuntu (Debian-based)

---

### Bug 1: HID Mismatch (USBC000 vs PNP0CA0)
The ACPI device uses "USBC000" as its primary HID, with "PNP0CA0" as a Compatible ID (CID).
```bash
$ cat /sys/bus/platform/devices/USBC000:00/modalias
acpi:USBC000:PNP0CA0:
```
Because ucsi_acpi only matches on PNP0CA0, the ACPI bus does not automatically bind the driver. Adding USBC000 to the acpi_device_id table is required for automatic discovery on these platforms.

---

### Bug 2: UCSI NVS Version = 0x0000 blocks probe
Even when forced to bind (via driver_override), the probe fails because the BIOS does not populate the VERSION field in the UCSI ACPI NVS region at runtime.

Actual probe failure log:
```text
Apr 21 11:29:37 fedora kernel: platform USBC000:00: bus: 'platform': __driver_probe_device: matched device with driver ucsi_acpi
Apr 21 11:29:37 fedora kernel: platform USBC000:00: bus: 'platform': really_probe: probing driver ucsi_acpi with device
Apr 21 11:29:39 fedora kernel: ucsi_acpi USBC000:00: probe with driver ucsi_acpi rejects match -19
```

Actual Raw NVS Dump (from UCSI region 0xCBC37000):
```text
Apr 21 11:41:28 fedora kernel: ucsi_peek: version=0x0000 cci=0x00000002
Apr 21 11:41:28 fedora kernel: ucsi_peek: raw NVS dump:
                                 +00: 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00
                                 +10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                                 +20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
```

---

### Verification of Fix
Manually patching the NVS version field to 0x0100 before probing allows the driver to initialize correctly. This proves the EC firmware is functional and the version check is the only blocker.

Logs after patching VERSION to 0x0100:
```text
Apr 21 11:41:28 fedora kernel: ucsi_peek: patching VERSION 0x0000 -> 0x0100
Apr 21 11:41:28 fedora kernel: ucsi_peek: VERSION readback = 0x0100
...
Apr 21 11:42:02 fedora kernel: platform USBC000:00: bus: 'platform': really_probe: probing driver ucsi_acpi with device
Apr 21 11:42:03 fedora kernel: ucsi_acpi USBC000:00: Registered UCSI interface with version 1.0.0
Apr 21 11:42:03 fedora kernel: ucsi_acpi USBC000:00: driver: 'ucsi_acpi': driver_bound: bound to device
```

---

### Suggested Fixes
1. Add USBC000 to ucsi_acpi_match:
   ```c
   static const struct acpi_device_id ucsi_acpi_match[] = {
       { "PNP0CA0", 0 },
       { "USBC000", 0 },
       { },
   };
   ```
2. Handle Version 0 during Probe:
   Modify ucsi_acpi_probe to treat version == 0 as a trigger to send PPM_RESET (to wake the EC) rather than returning -ENODEV.

Thank you for your time,
Daniel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-04-27  9:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-21 11:15 [BUG] ucsi_acpi: Fails to bind on USBC000 devices, version=0 in NVS blocks probe Daniel Dev
2026-04-27  9:09 ` Heikki Krogerus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox