The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v5 0/3] usb: typec: ucsi: gaokun: Validate and defer port updates
@ 2026-12-05  0:29 Lee Youngjoon
  2026-12-05  0:29 ` [PATCH v5 1/3] usb: typec: ucsi: gaokun: Return connector numbers from refresh Lee Youngjoon
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Lee Youngjoon @ 2026-12-05  0:29 UTC (permalink / raw)
  To: Pengyu Luo, Heikki Krogerus, Greg Kroah-Hartman
  Cc: Hans de Goede, Ilpo Järvinen, Bryan O'Donoghue,
	platform-driver-x86, linux-usb, linux-kernel, stable

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@mail.gmail.com/
[2] https://lore.kernel.org/r/CA+m4KrC4-oEkg2_+_B=kn5ObqAd1ZB+f+hpe53Cmqx47LHnGDQ@mail.gmail.com/

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


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

end of thread, other threads:[~2026-12-05  1:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-05  0:29 [PATCH v5 0/3] usb: typec: ucsi: gaokun: Validate and defer port updates Lee Youngjoon
2026-12-05  0:29 ` [PATCH v5 1/3] usb: typec: ucsi: gaokun: Return connector numbers from refresh Lee Youngjoon
2026-12-05  0:29 ` [PATCH v5 2/3] usb: typec: ucsi: gaokun: Validate port updates before acknowledging them Lee Youngjoon
2026-12-05  0:29 ` [PATCH v5 3/3] usb: typec: ucsi: gaokun: Defer missing USB events per connector Lee Youngjoon

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