From: Faisal Hassan <faisal.hassan@oss.qualcomm.com>
To: Peter Chen <peter.chen@oss.qualcomm.com>
Cc: linux-usb@vger.kernel.org,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 7/7] usb: dwc3: qcom: Enable VBUS override at probe for default peripheral role
Date: Wed, 4 Nov 2026 11:28:40 +0530 [thread overview]
Message-ID: <f8327c0e-ff47-4e67-a37c-9b636758f83b@oss.qualcomm.com> (raw)
In-Reply-To: <augvX4NwBcJot_AF@hu-petche-lv.qualcomm.com>
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@oss.qualcomm.com>
>> ---
>> 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
prev parent reply other threads:[~2026-11-04 5:58 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1793212717.git.faisal.hassan@oss.qualcomm.com>
2026-10-28 18:59 ` [PATCH v4 1/7] usb: dwc3: qcom: Keep wakeup IRQ enable/disable balanced on failed resume Faisal Hassan
2026-10-30 9:24 ` Peter Chen
2026-10-30 11:24 ` Faisal Hassan
2026-11-02 2:21 ` Peter Chen
2026-11-04 5:59 ` Faisal Hassan
2026-10-28 18:59 ` [PATCH v4 2/7] usb: dwc3: qcom: Distinguish PM and runtime suspend/resume paths Faisal Hassan
2026-11-02 4:47 ` Krishna Kurapati
2026-10-28 18:59 ` [PATCH v4 3/7] dt-bindings: usb: Add qcom,sa8255p-dwc3 for firmware-managed resources Faisal Hassan
2026-10-29 8:02 ` Krzysztof Kozlowski
2026-10-28 18:59 ` [PATCH v4 4/7] usb: host: xhci-plat: Support XHCI_RESET_ON_RESUME via device property Faisal Hassan
2026-10-30 9:29 ` Peter Chen
2026-10-28 18:59 ` [PATCH v4 5/7] usb: dwc3: qcom: Support broken suspend for SA8255P Faisal Hassan
2026-11-02 3:32 ` Peter Chen
2026-11-04 5:59 ` Faisal Hassan
2026-10-28 18:59 ` [PATCH v4 6/7] usb: dwc3: qcom: Support firmware-managed resource states for power management Faisal Hassan
2026-11-02 6:20 ` Peter Chen
2026-11-04 5:59 ` Faisal Hassan
2026-10-28 18:59 ` [PATCH v4 7/7] usb: dwc3: qcom: Enable VBUS override at probe for default peripheral role Faisal Hassan
2026-11-02 6:36 ` Peter Chen
2026-11-04 5:58 ` Faisal Hassan [this message]
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=f8327c0e-ff47-4e67-a37c-9b636758f83b@oss.qualcomm.com \
--to=faisal.hassan@oss.qualcomm.com \
--cc=Thinh.Nguyen@synopsys.com \
--cc=gregkh@linuxfoundation.org \
--cc=krishna.kurapati@oss.qualcomm.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=peter.chen@oss.qualcomm.com \
/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
all inboxes | Powered by JetHome®