Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH v2 0/2] usb: typec: ucsi: gaokun: Validate and defer port updates
@ 2026-11-30 13:41 getfeus
  2026-11-30 13:42 ` [PATCH v2 1/2] usb: typec: ucsi: gaokun: Distinguish empty updates from EC errors getfeus
  2026-11-30 13:42 ` [PATCH v2 2/2] usb: typec: ucsi: gaokun: Defer missing USB events per connector getfeus
  0 siblings, 2 replies; 5+ messages in thread
From: getfeus @ 2026-11-30 13:41 UTC (permalink / raw)
  To: Pengyu Luo, Heikki Krogerus, Greg Kroah-Hartman
  Cc: linux-usb, linux-kernel, stable

Hi,

Changes in v2:
- Add Cc: stable@vger.kernel.org to both patches, as requested by
  Heikki Krogerus. No code changes.


On the Huawei MateBook E Go the EC reports UCSI connector changes (0x21)
and USB port updates (0x22) on the same threaded IRQ. The connector
callback currently waits up to two seconds for an event that this IRQ
thread would dispatch. Also, a failed port-register read is handled like
a valid empty mask and can generate a PAN acknowledgment.

Patch 1 validates the EC reply before selecting a port or sending an
acknowledgment. Patch 2 moves the missing-event recheck to per-connector
delayed work. A real USB update retires only the matching recheck. The
existing two-second interval and the first-set-bit policy for a real USB
event are preserved.

The IRQ wait and the mutable port-count bound were also raised in this
earlier review:
https://lore.kernel.org/r/20260607214621.9586A1F00893@smtp.kernel.org

Testing was done against usb-next, building an arm64 Image and modules
at each commit. To exercise the firmware-facing behavior without moving
cables, substitute the D3 register reply at gaokun_ec_ucsi_get_reg()
and capture the connector argument to gaokun_ec_ucsi_pan_ack(). For a
two-port reply, use update mask 01 and port data 04 00 02 00. Queue a
right-port connector change and let the timeout expire: there should be
one D3 read and no D2 write. Next deliver a real 0x22 with update mask
02 and port data 04 00 09 19: the driver should process the right port
and request an ACK for port index 1. A valid zero mask on a real 0x22
retains the no-port ACK. These cases replay EC outputs on the host and
observe the resulting firmware inputs. They do not emulate the EC's
decision to generate a new interrupt.

The two patches use the existing EC API. The separate EC transport fix
is needed for the parent to report all short I2C transfers reliably.
This series does not add speculative firmware ACKs or change DP training.
The isolated series has been tested in host-side replay. System suspend
and resume on hardware remain unverified.

OpenAI Codex assisted with source inspection, the fixes, regression tests
and drafting this series.

Thanks,
Lee Youngjoon

Lee Youngjoon (2):
  usb: typec: ucsi: gaokun: Distinguish empty updates from EC errors
  usb: typec: ucsi: gaokun: Defer missing USB events per connector

 drivers/usb/typec/ucsi/ucsi_huawei_gaokun.c | 138 ++++++++++++--------
 1 file changed, 85 insertions(+), 53 deletions(-)


base-commit: 90d6263e867be7089b3d3323bef8d2accd327c77

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

end of thread, other threads:[~2026-12-04  3:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30 13:41 [PATCH v2 0/2] usb: typec: ucsi: gaokun: Validate and defer port updates getfeus
2026-11-30 13:42 ` [PATCH v2 1/2] usb: typec: ucsi: gaokun: Distinguish empty updates from EC errors getfeus
2026-12-01  9:25   ` Pengyu Luo
2026-11-30 13:42 ` [PATCH v2 2/2] usb: typec: ucsi: gaokun: Defer missing USB events per connector getfeus
2026-12-03 19:08   ` Greg Kroah-Hartman

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