[PATCH v5 0/3] usb: typec: ucsi: gaokun: Validate and defer port updates
From: Lee Youngjoon
Date: Fri Dec 04 2026 - 20:37:04 EST
Hi,
On the Huawei MateBook E Go, the EC delivers connector changes (0x21)
and USB port updates (0x22) on the same threaded IRQ. Waiting for the
USB event inside the connector callback holds up its delivery. A failed
read of the EC port status (UCSI_REG_READ, 0xd3) can also trigger a PAN
acknowledgment for an update the driver never read.
The first patch gives gaokun_ucsi_refresh() distinct results for an
updated connector, an empty mask and a read error. The second checks
the port against the allocated array and passes an explicit mask to
the EC for acknowledgment. The third moves the two-second fallback to
per-connector delayed work so the IRQ thread can handle the USB event.
Changes since v4 [1]:
- Split the refresh return-value conversion and its caller into patch 1.
- Include <linux/compiler.h> directly for READ_ONCE() in patch 3.
- Regenerate the series with git format-patch and prepare the messages
with git send-email. The v4 messages on linux-usb had line breaks in
their diff headers.
Patch 2 supersedes the PAN ACK patch (2/2) in the earlier platform
series [2]. The short I2C transfer fix (1/2) applies independently.
Each commit cross-built as an arm64 Image and modules. Host tests with
mock I2C exercised EC read errors, empty and matching updates, PAN ACK
bytes and per-connector fallbacks. The final series also passed with
the short I2C transfer fix applied. Hardware testing is pending for v5.
OpenAI Codex assisted with the changes, testing and drafting.
[1] https://lore.kernel.org/r/CA+m4KrD==FhrmtZtu+U9bjRX2ySxCVu3C43eRbHQ2a=5RC0vTg@xxxxxxxxxxxxxx/
[2] https://lore.kernel.org/r/CA+m4KrC4-oEkg2_+_B=kn5ObqAd1ZB+f+hpe53Cmqx47LHnGDQ@xxxxxxxxxxxxxx/
Thanks,
Lee Youngjoon
Lee Youngjoon (3):
usb: typec: ucsi: gaokun: Return connector numbers from refresh
usb: typec: ucsi: gaokun: Validate port updates before acknowledging
them
usb: typec: ucsi: gaokun: Defer missing USB events per connector
drivers/platform/arm64/huawei-gaokun-ec.c | 16 +--
drivers/usb/typec/ucsi/ucsi_huawei_gaokun.c | 136 +++++++++++-------
.../linux/platform_data/huawei-gaokun-ec.h | 4 +-
3 files changed, 90 insertions(+), 66 deletions(-)
base-commit: 9357829ac604c28510b71b154cb6630af81226ff
--
2.53.0