* [PATCH] soc: qcom: pmic_glink_altmode: use a freezable workqueue
@ 2026-07-28 1:25 Daniel J Blueman
2026-07-29 0:08 ` Val Packett
0 siblings, 1 reply; 2+ messages in thread
From: Daniel J Blueman @ 2026-07-28 1:25 UTC (permalink / raw)
To: Bjorn Andersson
Cc: Konrad Dybcio, Neil Armstrong, linux-arm-msm, linux-kernel,
Daniel J Blueman, stable
On suspend wake, the DisplayPort altmode setup often executes
before devices have compeleted resuming; this triggers a legitimate
warning:
i2c i2c-2: Transfer while suspended
WARNING: drivers/i2c/i2c-core.h:57 at __i2c_transfer+0xc0/0x9a8
Workqueue: events pmic_glink_altmode_worker
Call trace:
__i2c_transfer
i2c_transfer
regmap_i2c_read
...
ps883x_sw_set
typec_switch_set
pmic_glink_altmode_worker
The setup doesn't succeed, leaving the DP-alt monitor non-working.
Fix this by queuing the work on the freezable workqueue instead,
deferring the setup until devices have resumed.
Observed and validated on a Lenovo Yoga Slim 7x X1E80100 when waking
from suspend with a USB-C DisplayPort monitor.
Fixes: 080b4e24852b ("soc: qcom: pmic_glink: Introduce altmode support")
Cc: stable@vger.kernel.org
Signed-off-by: Daniel J Blueman <daniel@quora.org>
---
drivers/soc/qcom/pmic_glink_altmode.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/soc/qcom/pmic_glink_altmode.c b/drivers/soc/qcom/pmic_glink_altmode.c
index 619bad2c27ee..939a444ebe6e 100644
--- a/drivers/soc/qcom/pmic_glink_altmode.c
+++ b/drivers/soc/qcom/pmic_glink_altmode.c
@@ -450,7 +450,7 @@ static void pmic_glink_altmode_sc8180xp_notify(struct pmic_glink_altmode *altmod
alt_port->mode = mode;
alt_port->hpd_state = hpd_state;
alt_port->hpd_irq = hpd_irq;
- schedule_work(&alt_port->work);
+ queue_work(system_freezable_wq, &alt_port->work);
}
#define SC8280XP_DPAM_MASK 0x3f
@@ -501,7 +501,7 @@ static void pmic_glink_altmode_sc8280xp_notify(struct pmic_glink_altmode *altmod
alt_port->tbt_data = *tbt;
}
- schedule_work(&alt_port->work);
+ queue_work(system_freezable_wq, &alt_port->work);
}
static void pmic_glink_altmode_callback(const void *data, size_t len, void *priv)
--
2.53.0
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] soc: qcom: pmic_glink_altmode: use a freezable workqueue
2026-07-28 1:25 [PATCH] soc: qcom: pmic_glink_altmode: use a freezable workqueue Daniel J Blueman
@ 2026-07-29 0:08 ` Val Packett
0 siblings, 0 replies; 2+ messages in thread
From: Val Packett @ 2026-07-29 0:08 UTC (permalink / raw)
To: Daniel J Blueman, Bjorn Andersson
Cc: Konrad Dybcio, Neil Armstrong, linux-arm-msm, linux-kernel,
stable, Johan Hovold
On 7/27/26 10:25 PM, Daniel J Blueman wrote:
> On suspend wake, the DisplayPort altmode setup often executes
> before devices have compeleted resuming; this triggers a legitimate
> warning:
> i2c i2c-2: Transfer while suspended
> WARNING: drivers/i2c/i2c-core.h:57 at __i2c_transfer+0xc0/0x9a8
> Workqueue: events pmic_glink_altmode_worker
> Call trace:
> __i2c_transfer
> i2c_transfer
> regmap_i2c_read
> ...
> ps883x_sw_set
> typec_switch_set
> pmic_glink_altmode_worker
>
> The setup doesn't succeed, leaving the DP-alt monitor non-working.
>
> Fix this by queuing the work on the freezable workqueue instead,
> deferring the setup until devices have resumed.
>
> Observed and validated on a Lenovo Yoga Slim 7x X1E80100 when waking
> from suspend with a USB-C DisplayPort monitor.
>
> Fixes: 080b4e24852b ("soc: qcom: pmic_glink: Introduce altmode support")
> Cc: stable@vger.kernel.org
> Signed-off-by: Daniel J Blueman <daniel@quora.org>
> ---
> drivers/soc/qcom/pmic_glink_altmode.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/soc/qcom/pmic_glink_altmode.c b/drivers/soc/qcom/pmic_glink_altmode.c
> index 619bad2c27ee..939a444ebe6e 100644
> --- a/drivers/soc/qcom/pmic_glink_altmode.c
> +++ b/drivers/soc/qcom/pmic_glink_altmode.c
> @@ -450,7 +450,7 @@ static void pmic_glink_altmode_sc8180xp_notify(struct pmic_glink_altmode *altmod
> alt_port->mode = mode;
> alt_port->hpd_state = hpd_state;
> alt_port->hpd_irq = hpd_irq;
> - schedule_work(&alt_port->work);
> + queue_work(system_freezable_wq, &alt_port->work);
> }
>
> #define SC8280XP_DPAM_MASK 0x3f
> @@ -501,7 +501,7 @@ static void pmic_glink_altmode_sc8280xp_notify(struct pmic_glink_altmode *altmod
> alt_port->tbt_data = *tbt;
> }
>
> - schedule_work(&alt_port->work);
> + queue_work(system_freezable_wq, &alt_port->work);
> }
>
> static void pmic_glink_altmode_callback(const void *data, size_t len, void *priv)
BTW exactly this has been proposed previously:
https://lore.kernel.org/all/20250110-soc-qcom-pmic-glink-fix-device-access-on-worker-while-suspended-v1-1-e32fd6bf322e@linaro.org/
It was concluded that this is a stop-gap solution until the
notifications are fixed to not be sent at all while suspended… and of
course neither the "real fix" nor this has landed :(
~val
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-07-29 0:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-28 1:25 [PATCH] soc: qcom: pmic_glink_altmode: use a freezable workqueue Daniel J Blueman
2026-07-29 0:08 ` Val Packett
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®