public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Sumit Garg <sumit.garg@kernel.org>
To: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Cc: trini@konsulko.com, casey.connolly@linaro.org,
	neil.armstrong@linaro.org, lukma@denx.de, seanga2@gmail.com,
	marex@denx.de, malysagreg@gmail.com,
	arturs.artamonovs@analog.com, utsav.agarwal@analog.com,
	vasileios.bimpikas@analog.com, ian.roberts@timesys.com,
	nathan.morrison@timesys.com, peng.fan@nxp.com,
	alif.zakuan.yuslaimi@altera.com, kory.maincent@bootlin.com,
	sjg@chromium.org, jerome.forissier@linaro.org, ziyao@disroot.org,
	stefan.roese@mailbox.org, mkorpershoek@kernel.org,
	rui.silva@linaro.org, ilias.apalodimas@linaro.org,
	luca.weiss@fairphone.com, quic_varada@quicinc.com,
	u-boot@lists.denx.de, u-boot-qcom@groups.io
Subject: Re: [PATCH v2 2/7] drivers: usb: dwc3: Add delay after core soft reset
Date: Tue, 23 Dec 2025 14:35:14 +0530	[thread overview]
Message-ID: <aUpbSgCIdKgtoSyT@sumit-xelite> (raw)
In-Reply-To: <20251124155503.2839766-3-balaji.selvanathan@oss.qualcomm.com>

On Mon, Nov 24, 2025 at 09:24:58PM +0530, Balaji Selvanathan wrote:
> Add a 100 ms delay after clearing the core soft reset bit to ensure
> the DWC3 controller has sufficient time to complete its reset
> sequence before subsequent register accesses.
> 
> Without this delay, USB initialization can fail on some Qualcomm
> platforms, particularly when using super-speed capable PHYs like
> the QMP USB3-DP Combo PHY on SC7280/QCM6490.
> 
> The change is taken from following upstream Linux implementation:
> https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/usb/dwc3/core.c?id=f88359e1588b85cf0e8209ab7d6620085f3441d9

If I understand correctly the kernel change here especially following
comment:

	/*
	 * Wait for internal clocks to synchronized. DWC_usb31 and
	 * DWC_usb32 may need at least 50ms (less for DWC_usb3). To
	 * keep it consistent across different IPs, let's wait up to
	 * 100ms before clearing GCTL.CORESOFTRESET.
	 */

the delay is required before clearing GCTL.CORESOFTRESET and not after
which your change seems to do. Also, here we aren't doing any role
switch too, right?

-Sumit

> 
> Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
> ---
> v2:
> - Gave correct commit id for linux implementation
> ---
>  drivers/usb/dwc3/core.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index 847fa1f82c3..ff0bca0dd8e 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -94,6 +94,8 @@ static int dwc3_core_soft_reset(struct dwc3 *dwc)
>  	reg &= ~DWC3_GCTL_CORESOFTRESET;
>  	dwc3_writel(dwc->regs, DWC3_GCTL, reg);
>  
> +	mdelay(100);
> +
>  	return 0;
>  }
>  
> -- 
> 2.34.1
> 

  reply	other threads:[~2025-12-23  9:05 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-24 15:54 [PATCH v2 0/7] Enable USB3 Super-Speed support for QCM6490/SC7280 Balaji Selvanathan
2025-11-24 15:54 ` [PATCH v2 1/7] drivers: clk: qcom: sc7280: Add USB3 PHY pipe clock Balaji Selvanathan
2025-11-26 14:30   ` Casey Connolly
2025-12-23  8:31   ` Sumit Garg
2025-11-24 15:54 ` [PATCH v2 2/7] drivers: usb: dwc3: Add delay after core soft reset Balaji Selvanathan
2025-12-23  9:05   ` Sumit Garg [this message]
2025-12-24  5:56     ` Balaji Selvanathan
2025-12-26  7:27       ` Sumit Garg
2025-11-24 15:54 ` [PATCH v2 3/7] drivers: phy: qcom: Add QMP USB3-DP Combo PHY driver Balaji Selvanathan
2025-11-24 19:51   ` Tom Rini
2025-11-25 10:33     ` Balaji Selvanathan
2025-11-26 14:46   ` Casey Connolly
2025-11-28  3:31     ` Balaji Selvanathan
2025-12-03 11:13     ` Balaji Selvanathan
2025-11-24 15:55 ` [PATCH v2 4/7] arch: arm: mach-snapdragon: Make USB speed fixup configurable Balaji Selvanathan
2025-11-26 14:24   ` Casey Connolly
2025-12-03 11:21     ` Balaji Selvanathan
2025-12-26 11:13       ` Sumit Garg
2025-11-24 15:55 ` [PATCH v2 5/7] arch: arm: dts: qcs6490-rb3gen2: Override USB3 PHY clocks Balaji Selvanathan
2025-11-26 14:26   ` Casey Connolly
2025-12-03 11:36     ` Balaji Selvanathan
2025-11-24 15:55 ` [PATCH v2 6/7] configs: qcm6490: Enable super-speed USB support Balaji Selvanathan
2025-11-24 15:55 ` [PATCH v2 7/7] MAINTAINERS: Add entry for Qualcomm PHY drivers Balaji Selvanathan

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=aUpbSgCIdKgtoSyT@sumit-xelite \
    --to=sumit.garg@kernel.org \
    --cc=alif.zakuan.yuslaimi@altera.com \
    --cc=arturs.artamonovs@analog.com \
    --cc=balaji.selvanathan@oss.qualcomm.com \
    --cc=casey.connolly@linaro.org \
    --cc=ian.roberts@timesys.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jerome.forissier@linaro.org \
    --cc=kory.maincent@bootlin.com \
    --cc=luca.weiss@fairphone.com \
    --cc=lukma@denx.de \
    --cc=malysagreg@gmail.com \
    --cc=marex@denx.de \
    --cc=mkorpershoek@kernel.org \
    --cc=nathan.morrison@timesys.com \
    --cc=neil.armstrong@linaro.org \
    --cc=peng.fan@nxp.com \
    --cc=quic_varada@quicinc.com \
    --cc=rui.silva@linaro.org \
    --cc=seanga2@gmail.com \
    --cc=sjg@chromium.org \
    --cc=stefan.roese@mailbox.org \
    --cc=trini@konsulko.com \
    --cc=u-boot-qcom@groups.io \
    --cc=u-boot@lists.denx.de \
    --cc=utsav.agarwal@analog.com \
    --cc=vasileios.bimpikas@analog.com \
    --cc=ziyao@disroot.org \
    /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