mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
To: Faisal Hassan <faisal.hassan@oss.qualcomm.com>,
	Thinh.Nguyen@synopsys.com, gregkh@linuxfoundation.org
Cc: linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	peter.chen@oss.qualcomm.com,
	krzysztof.kozlowski@oss.qualcomm.com
Subject: Re: [PATCH v5 11/11] usb: dwc3: qcom: Enable VBUS override at probe for default peripheral role
Date: Thu, 26 Nov 2026 23:04:20 +0530	[thread overview]
Message-ID: <3c0a98e5-0696-45eb-a0c2-83f429f6c76b@oss.qualcomm.com> (raw)
In-Reply-To: <20261123104727.1539149-12-faisal.hassan@oss.qualcomm.com>



On 11/23/2026 4:17 PM, 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 once at probe, after the initial role has been
> determined, whenever that role is USB_ROLE_DEVICE. This also covers the
> dr_mode = "peripheral" case, which previously programmed the override on
> its own.
> 
> 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>

Reviewed-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>

Regards,
Krishna,

> ---
>   drivers/usb/dwc3/dwc3-qcom.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
> index 559de5172e61..22b6c7ca0297 100644
> --- a/drivers/usb/dwc3/dwc3-qcom.c
> +++ b/drivers/usb/dwc3/dwc3-qcom.c
> @@ -964,7 +964,6 @@ static int dwc3_qcom_probe(struct platform_device *pdev)
>   		qcom->current_role = USB_ROLE_HOST;
>   	} else if (qcom->mode == USB_DR_MODE_PERIPHERAL) {
>   		qcom->current_role = USB_ROLE_DEVICE;
> -		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))
> @@ -973,6 +972,10 @@ static int dwc3_qcom_probe(struct platform_device *pdev)
>   			qcom->current_role = USB_ROLE_DEVICE;
>   	}
>   
> +	/* Force the VBUS valid indication to the PHYs in device mode */
> +	if (qcom->current_role == USB_ROLE_DEVICE)
> +		dwc3_qcom_vbus_override_enable(qcom, true);
> +
>   	qcom->dwc.glue_ops = &dwc3_qcom_glue_ops;
>   
>   	qcom->dwc.dev = dev;


      parent reply	other threads:[~2026-11-26 17:34 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 10:47 [PATCH v5 00/11] usb: dwc3: qcom: Add firmware-managed resource support for SA8255P Faisal Hassan
2026-11-23 10:47 ` [PATCH v5 01/11] usb: dwc3: qcom: Distinguish PM and runtime suspend/resume paths Faisal Hassan
2026-11-26  7:40   ` Peter Chen
2026-11-23 10:47 ` [PATCH v5 02/11] usb: dwc3: qcom: Disarm wakeup IRQs on system suspend without wakeup Faisal Hassan
2026-11-26  7:44   ` Peter Chen
2026-11-23 10:47 ` [PATCH v5 03/11] usb: dwc3: qcom: Keep wakeup IRQ enable/disable balanced on failed resume Faisal Hassan
2026-11-26  8:37   ` Peter Chen
2026-11-26 17:31   ` Krishna Kurapati
2026-11-23 10:47 ` [PATCH v5 04/11] dt-bindings: usb: Add qcom,sa8255p-dwc3 for firmware-managed resources Faisal Hassan
2026-11-23 10:47 ` [PATCH v5 05/11] usb: host: xhci-plat: Support XHCI_RESET_ON_RESUME via device property Faisal Hassan
2026-11-23 10:47 ` [PATCH v5 06/11] usb: dwc3: Support resetting the xHCI host on system resume Faisal Hassan
2026-11-23 10:47 ` [PATCH v5 07/11] usb: dwc3: qcom: Recover controller state after power loss in system suspend Faisal Hassan
2026-11-26  9:52   ` Peter Chen
2026-11-23 10:47 ` [PATCH v5 08/11] usb: dwc3: qcom: Restore VBUS override after system resume Faisal Hassan
2026-11-26  9:54   ` Peter Chen
2026-11-26 17:32   ` Krishna Kurapati
2026-11-23 10:47 ` [PATCH v5 09/11] usb: dwc3: qcom: Assert controller reset on remove and probe failure Faisal Hassan
2026-11-26  9:56   ` Peter Chen
2026-11-23 10:47 ` [PATCH v5 10/11] usb: dwc3: qcom: Support firmware-managed resource states for power management Faisal Hassan
2026-11-26 10:09   ` Peter Chen
2026-11-23 10:47 ` [PATCH v5 11/11] usb: dwc3: qcom: Enable VBUS override at probe for default peripheral role Faisal Hassan
2026-11-26 10:12   ` Peter Chen
2026-11-26 17:34   ` Krishna Kurapati [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=3c0a98e5-0696-45eb-a0c2-83f429f6c76b@oss.qualcomm.com \
    --to=krishna.kurapati@oss.qualcomm.com \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=devicetree@vger.kernel.org \
    --cc=faisal.hassan@oss.qualcomm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=krzysztof.kozlowski@oss.qualcomm.com \
    --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®