Re: [PATCH v2] usb: dwc3: qcom: Defer VBUS override update during system suspend
From: Prashanth K
Date: Tue Nov 03 2026 - 23:36:31 EST
On 11/4/2026 8:07 AM, Thinh Nguyen wrote:
> On Fri, Oct 23, 2026, Vladyslav Tymoshchuk wrote:
>> dwc3_qcom_set_role_notifier() updates the VBUS override in QSCRATCH
>> synchronously, from the context of the usb_role_switch_set_role()
>> caller. The glue assumes that role switches only happen from a
>> freezable workqueue, but that holds for the dwc3 core's mode switch,
>> not for this notifier: the UCSI connector work, for one, runs on the
>> non-freezable system workqueue.
>>
>
> ....
>
> Good catch. However, this should be fixed in the dwc3 core. The
> pre_set_role notifier can be called from the freezable __dwc3_set_mode()
> work instead of from the role switch caller. Then glue drivers won't be
> notified while suspended. This is simpler and applies to all glue
> drivers.
I think the problem with that is, dwc3_set_mode doesn't know USB_ROLE
(especially NONE mode).
It only knows the mode which is gadget/host/otg. Thats why vendor hooks
are used in drd.c instead. Perhaps we can cache USB_ROLE into dwc3
struct and use it later on __dwc3_set_mode.
Regards,
Prashanth K