Re: [PATCH v4 7/7] usb: dwc3: qcom: Enable VBUS override at probe for default peripheral role

From: Faisal Hassan

Date: Wed Nov 04 2026 - 01:00:26 EST


On 02-11-2026 12:06 pm, Peter Chen wrote:
On 26-10-29 00:29:37, Faisal Hassan wrote:
When the controller is in OTG mode with usb-role-switch and
role-switch-default-mode set to peripheral, the role notifier never sees
a transition at probe, so the QSCRATCH VBUS override is not programmed
and the device never gets a session-valid indication.

Enable the VBUS override at probe whenever the initial role is
USB_ROLE_DEVICE.

Validated on SA8255P with an HS host attached: 20 unbind/bind and 20
suspend/resume iterations completed with no failures.

Signed-off-by: Faisal Hassan <faisal.hassan@xxxxxxxxxxxxxxxx>
---
drivers/usb/dwc3/dwc3-qcom.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
index 0896a323bdda..92f1223f7b21 100644
--- a/drivers/usb/dwc3/dwc3-qcom.c
+++ b/drivers/usb/dwc3/dwc3-qcom.c
@@ -953,10 +953,12 @@ static int dwc3_qcom_probe(struct platform_device *pdev)
dwc3_qcom_vbus_override_enable(qcom, true);

....

} else {
if ((device_property_read_bool(dev, "usb-role-switch")) &&
- (usb_get_role_switch_default_mode(dev) == USB_DR_MODE_HOST))
+ (usb_get_role_switch_default_mode(dev) == USB_DR_MODE_HOST)) {
qcom->current_role = USB_ROLE_HOST;
- else
+ } else {
qcom->current_role = USB_ROLE_DEVICE;
+ dwc3_qcom_vbus_override_enable(qcom, true);
+ }

Hi Peter,

Thanks for the review.

How about move it and above [....] under device role, let above code purely determine current_role:
if (qcom->current_role == USB_ROLE_DEVICE)
dwc3_qcom_vbus_override_enable(qcom, true);

Peter


Ok, I will make the mode and role-switch code only determine current_role, and enable the VBUS override once afterwards when current_role is USB_ROLE_DEVICE.

Thanks,
Faisal