[PATCH v1 0/2] usb: typec: ucsi: gaokun: Fix DP detach and orientation ordering
From: Lee Youngjoon
Date: Thu Nov 26 2026 - 02:53:11 EST
Hi,
On the Huawei MateBook E Go we observed two cases where the display
driver got an incomplete or premature hotplug indication.
On unplug, the EC can report no CC orientation, no mux and HPD low in
one update. The DP SVID is already gone when the driver checks whether
to notify the bridge. Patch 1 remembers a previously forwarded high and
delivers low once for this physical detach.
On attach, a UCSI connector-status notification can precede the EC
report containing the new DP orientation. On the right port we saw EC
REVERSE with the QMP PHY still at NORMAL and channel equalization timing
out. On a successful reconnect in the same physical orientation, both
reported REVERSE and both lanes trained. Patch 2 sets the orientation
switch from the fresh EC report before programming the mux. It withholds
high if setup fails and preserves the detach notification.
This is based on usb-next plus the two patches in the Gaokun port-update
series [1]. Its per-port event path serializes EC mode updates. Both
prerequisite patch IDs follow the diffstat. The separate HPD_IRQ work
[2] touches the same bridge call and handles sink interrupts. If it
lands first I can rebase, preserving its IRQ indication for DP reports.
I built an arm64 Image and modules after each patch. For a cable-free
host test, replay right-port bytes 09/19 followed by 02/00 twice, with
the right update bit set. Observe switch, mux, bridge and PAN calls.
Expect high on the DP report, one low across the two empty reports and
one ACK per processed frame. A switch or mux failure on a high frame
should withhold high; a fresh valid report should succeed. A host-side
test also held a status write in flight while delivering the fresh DP
frame and checked the final hardware-facing orientation.
The earlier hardware build had the left charger connected throughout.
The monitor showed video on the first attach and reconnect in one plug
orientation, and on reconnect in the other. The first flipped attach
showed no video and no right Type-C partner was observed in the samples.
EDID cleared on all three removals that began with a populated EDID.
Those hardware results are from the prototype. This posting obtains
its own switch handle and selects ports with a DP bridge and DP report.
The Type-C status callback continues to publish the class orientation;
a separate switch write from the EC event can precede that publication.
The exact posted series has been built and replay-tested, and still
needs a board run.
OpenAI Codex assisted with source inspection, implementation, tests and
drafting this series.
Thanks,
Lee Youngjoon
[1] https://lore.kernel.org/r/CA+m4KrA14J-3ovbau1EGjvwc1R4Maya3wzqD+n-_khotDhcRFQ@xxxxxxxxxxxxxx
[2] https://lore.kernel.org/r/20261024-hpd-irq-events-v8-9-6ee949e7a384@xxxxxxxxxxxxxxxx
Lee Youngjoon (2):
usb: typec: ucsi: gaokun: Forward HPD low on physical detach
usb: typec: ucsi: gaokun: Set orientation before switching to DP
drivers/usb/typec/ucsi/ucsi_huawei_gaokun.c | 68 +++++++++++++++++++--
1 file changed, 62 insertions(+), 6 deletions(-)
base-commit: 90d6263e867be7089b3d3323bef8d2accd327c77
prerequisite-patch-id: cfd37d1c2c80a677a55355503949110e2a427bef
prerequisite-patch-id: dae17ae41b9e4a6710e956900347d5d637ae39fd