From b5522ebcd20fef9df78ded024e1baad9c349ca5c Mon Sep 17 00:00:00 2001 From: Abel Vesa Date: Wed, 5 Feb 2025 13:45:05 +0200 Subject: [PATCH] usb: typec: ucsi: Schedule connector worker on freezable workqueue Currently, the UCSI connector worker is scheduled on the non-freezable system workqueue. During system suspend, on a plug/unplug event, the worker can run before the devices have actually resumed. The UCSI instances can implement operations that might need to do some HW accesses while the devices are still suspended. Scheduling the USCI connector worker on the freezable system workqueue instead will ensure the devices are resumed by the time the worker is scheduled to run. Signed-off-by: Abel Vesa Link: https://patch.msgid.link/20250205-ucsi-schedule-conn-worker-on-freezable-wq-v1-1-107d1356b77b@linaro.org Signed-off-by: Abel Vesa --- drivers/usb/typec/ucsi/ucsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c index ecbda2a3783c..f74f44abe648 100644 --- a/drivers/usb/typec/ucsi/ucsi.c +++ b/drivers/usb/typec/ucsi/ucsi.c @@ -1574,7 +1574,7 @@ void ucsi_connector_change(struct ucsi *ucsi, u8 num) con = &ucsi->connector[num - 1]; if (!test_and_set_bit(EVENT_PENDING, &ucsi->flags)) - schedule_work(&con->work); + queue_work(system_freezable_wq, &con->work); } EXPORT_SYMBOL_GPL(ucsi_connector_change);