From: Vladyslav Tymoshchuk <tvlad744@gmail.com>
To: Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Sebastian Reichel <sre@kernel.org>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Neil Armstrong <neil.armstrong@linaro.org>,
Abel Vesa <abel.vesa@oss.qualcomm.com>,
Jishnu Prakash <jishnu.prakash@oss.qualcomm.com>,
Joonhoe Kim <26rote@gmail.com>,
linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 0/5] soc: qcom: pmic_glink: Deliver notifications from a freezable workqueue
Date: Sun, 29 Nov 2026 15:44:36 +0200 [thread overview]
Message-ID: <20261129134442.579-1-tvlad744@gmail.com> (raw)
The GLINK interrupt is not suspended, so PMIC GLINK clients get
notifications while devices are suspended, and the work they schedule
can use those devices. This was hit on X Elite with a PS8830 retimer
[1], on SM8850 with an FSA4480 switch [2] and on SM8750, where dwc3-qcom
accesses registers with the clocks off and the SoC resets [3]. Commit
c7c56b6ec077 ("soc: qcom: pmic_glink: Fix device access from worker
during suspend") fixed the altmode client as a stop-gap, and left the
queueing and filtering of the notifications in pmic_glink for later.
- Patch 1 makes ucsi_glink notice a restart of the remote that happened
before its work ran; with patch 2, DOWN and UP can arrive back to back.
- Patch 2 passes the notifications and the changes of the service state
on from system_freezable_wq, which is frozen while devices are
suspended. RFC v1 queued them from ->prepare() to ->complete().
- Patch 3 reports wakeup events, for the clients whose device may
wake up the system.
- Patch 4 enables wakeup for ucsi_glink, as proposed in [4].
- Patch 5 makes qcom_battmgr wakeup capable for charger changes,
with wakeup disabled by default.
Patches 4 and 5 depend on patch 3, so the series would best go through
the Qualcomm SoC tree. It is based on next-20261127.
Not covered: pmic_glink does not wait for the work that a client queues
for a notification, so work queued right before a suspend can still
overlap the suspend of devices.
Two observations of Joonhoe Kim on RFC v1 are not addressed, as they are
the same without the series: a DisplayPort plug wakes up the system only
after 26 s, and the DP controller resumes before the held back altmode
notification reaches it.
The PMIC GIO [5] and RTC [6] series also touch pmic_glink.c. With
this series, notifications for their clients are held back as well.
Tested on the OnePlus Pad 3 (SM8750), with the patches ported to a 7.3-rc5
based tree, debug prints added and the dwc3 fix [3] left out, pulling or
plugging the cable while in s2idle:
- with the series: unplug 6 times, plug 4 times, no reset. No notification
was passed on before the tasks were restarted. One of the unplugs was
done with the UCSI wakeup disabled, and did not wake up the system.
- without it: unplug 3 times, plug 2 times, reset every time. No reset in
3 sleeps with the cable left alone.
A restart of the remote was only simulated, by queueing DOWN and UP back
to back while awake: ucsi_glink registered anew 15 times out of 15, and
missed 4 of 5 without patch 1. A real one could not be tested, stopping
the ADSP resets the SoC in this setup, without the series as well.
Joonhoe, I dropped your Tested-by, as the queueing is new. Could you
check this version?
Changes since RFC v1:
- Drop RFC, shorten the descriptions (Sebastian)
- Always deliver from system_freezable_wq, with the service state in the
same queue, instead of switching the queueing on and off from the pm
callbacks, which also covers the Sashiko findings on that patch
- New patch 1, for ucsi_glink
- Drop the Tested-by of Joonhoe Kim, as the queueing changed
- Report wakeup events through a wakeup source of pmic_glink, kept active
until the queue has been passed on (Sashiko)
- qcom_battmgr: only for the SM8350 and SM8550 firmware (Sashiko)
- Rebase on the qcom_battmgr use-after-free fix
- Link to RFC v1: https://lore.kernel.org/all/20261022164151.592-1-tvlad744@gmail.com/
An AI assistant (Claude) helped with the analysis, the patches and the
descriptions.
[1] https://lore.kernel.org/all/20250205-ucsi-schedule-conn-worker-on-freezable-wq-v1-1-107d1356b77b@linaro.org/
[2] https://lore.kernel.org/all/20261020132432.998-1-26rote@gmail.com/
[3] https://lore.kernel.org/all/20261111090122.134-1-tvlad744@gmail.com/
[4] https://lore.kernel.org/all/20260722-ucsi_glink_wakeup-v2-1-b43dee56df24@oss.qualcomm.com/
[5] https://lore.kernel.org/all/20261118-gio-framework-rtc-driver-2026-10-12-v3-0-52d78a8f43ee@oss.qualcomm.com/
[6] https://lore.kernel.org/all/20261103-rtc-glink-cleanup-v2-0-895eb6e8d890@qti.qualcomm.com/
Vladyslav Tymoshchuk (5):
usb: typec: ucsi: glink: Handle a restart of the remote before the
work runs
soc: qcom: pmic_glink: Deliver notifications from a freezable
workqueue
soc: qcom: pmic_glink: Report wakeup events on behalf of clients
usb: typec: ucsi: glink: Wake up the system on connector changes
power: supply: qcom_battmgr: Allow charger changes to wake up the
system
drivers/power/supply/qcom_battmgr.c | 22 +++
drivers/soc/qcom/pmic_glink.c | 272 +++++++++++++++++++++++++---
drivers/usb/typec/ucsi/ucsi_glink.c | 21 ++-
include/linux/soc/qcom/pmic_glink.h | 2 +
4 files changed, 290 insertions(+), 27 deletions(-)
base-commit: e5aad2bdbbee783611d32599f89cea3f12f9593d
next reply other threads:[~2026-11-29 13:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-29 13:44 Vladyslav Tymoshchuk [this message]
2026-11-29 13:44 ` [PATCH v2 1/5] usb: typec: ucsi: glink: Handle a restart of the remote before the work runs Vladyslav Tymoshchuk
2026-11-29 14:01 ` sashiko-bot
2026-11-29 13:44 ` [PATCH v2 2/5] soc: qcom: pmic_glink: Deliver notifications from a freezable workqueue Vladyslav Tymoshchuk
2026-11-29 13:44 ` [PATCH v2 3/5] soc: qcom: pmic_glink: Report wakeup events on behalf of clients Vladyslav Tymoshchuk
2026-11-29 13:44 ` [PATCH v2 4/5] usb: typec: ucsi: glink: Wake up the system on connector changes Vladyslav Tymoshchuk
2026-11-29 13:44 ` [PATCH v2 5/5] power: supply: qcom_battmgr: Allow charger changes to wake up the system Vladyslav Tymoshchuk
2026-11-29 14:00 ` sashiko-bot
2026-11-29 14:01 ` [PATCH v2 0/5] soc: qcom: pmic_glink: Deliver notifications from a freezable workqueue 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=20261129134442.579-1-tvlad744@gmail.com \
--to=tvlad744@gmail.com \
--cc=26rote@gmail.com \
--cc=abel.vesa@oss.qualcomm.com \
--cc=andersson@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=jishnu.prakash@oss.qualcomm.com \
--cc=konradybcio@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=sre@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox