[PATCH v1 0/2] platform: arm64: huawei-gaokun-ec: Fix short transfers and PAN ACK masks
From: Lee Youngjoon
Date: Thu Nov 26 2026 - 02:06:22 EST
Hi,
These two independent fixes address the host side of the Huawei MateBook
E Go EC protocol. A short I2C transfer can be reported as success, and
the normal no-port-update case evaluates a negative shift before sending
its acknowledgement. Both issues are present in the pdx86 fixes tree.
For patch 1, a host-side test fed the actual request helper adapter
returns of 0, 1, -EREMOTEIO and 2. The first two now return -EIO.
A complete transfer still returns the EC status byte, including a
nonzero status. For patch 2, UBSan reproduced the negative shift on
the base commit. With the fix, -1 sends a zero mask; ports 0 through 7
set their respective bits, and out-of-range indices return -EINVAL
without a transfer. Both patches were built individually and together
as an arm64 Image and EC module.
For reviewers interested in firmware inputs, the PAN write can also be
checked with a fixed cable configuration on a Gaokun. In an earlier
instrumented run, the left charger was online and the right port empty.
After a normal left ACK, D3 still reported update mask 01 and port
records 05/00 and 02/00. A test-only driver hook rechecked D3 and pending
work, then issued one empty PAN ACK while both ports were left untouched.
The I2C trace captured the following exchange:
host -> EC 03 d2 01 00
EC -> host 00 44
D3 payload 02 01 05 00 02 00 40 (before, after, +2 s, +5 s)
This observation documents the existing empty ACK encoding. The EC
accepted the command and the update mask stayed set. The series preserves
that input and makes no change to firmware recovery or hotplug policy.
The host-side cases above can be exercised without a board by stubbing
i2c_transfer() and recording the request bytes and return code.
OpenAI Codex assisted with source inspection, the fixes, regression
tests and drafting this series.
Thanks,
Lee Youngjoon
Lee Youngjoon (2):
platform: arm64: huawei-gaokun-ec: Reject short I2C transfers
platform: arm64: huawei-gaokun-ec: Validate the PAN ACK bit index
drivers/platform/arm64/huawei-gaokun-ec.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
base-commit: d4000e7b99e06e92f21a3c92098a0476d316e9d6