All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Youngjoon <getfeus@gmail.com>
To: Pengyu Luo <mitltlatltl@gmail.com>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Hans de Goede" <hansg@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Bryan O'Donoghue" <bryan.odonoghue@linaro.org>,
	platform-driver-x86@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: [PATCH v5 0/3] usb: typec: ucsi: gaokun: Validate and defer port updates
Date: Sat,  5 Dec 2026 09:29:20 +0900	[thread overview]
Message-ID: <20261205002923.1370-1-getfeus@gmail.com> (raw)

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


             reply	other threads:[~2026-12-05  1:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-05  0:29 Lee Youngjoon [this message]
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
2026-12-05  1:49 ` [PATCH v5 0/3] usb: typec: ucsi: gaokun: Validate and defer port updates sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261205002923.1370-1-getfeus@gmail.com \
    --to=getfeus@gmail.com \
    --cc=bryan.odonoghue@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hansg@kernel.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mitltlatltl@gmail.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.