public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Mattijs Korpershoek <mkorpershoek@kernel.org>
To: Chris Morgan <macroalpha82@gmail.com>, u-boot@lists.denx.de
Cc: thinhn@synopsys.com, neil.armstrong@linaro.org,
	quic_varada@quicinc.com, felipe.balbi@linux.intel.com,
	mkorpershoek@kernel.org, lukma@denx.de, trini@konsulko.com,
	marex@denx.de, Chris Morgan <macromorgan@hotmail.com>
Subject: Re: [PATCH 1/2] usb: dwc3: gadget: Don't send unintended link state change
Date: Wed, 14 Jan 2026 12:09:17 +0100	[thread overview]
Message-ID: <87jyxkfo2q.fsf@kernel.org> (raw)
In-Reply-To: <20251223231311.1983423-2-macroalpha82@gmail.com>

Hi Chris,

Thank you for the patch and sorry for the review delay. I was on
vacation and a bit swamped when coming back.

On Tue, Dec 23, 2025 at 17:13, Chris Morgan <macroalpha82@gmail.com> wrote:

> From: Chris Morgan <macromorgan@hotmail.com>
>
> DCTL.ULSTCHNGREQ is a write-only field. When doing a read-modify-write
> to DCTL, the driver must make sure that there's no unintended link state
> change request from whatever is read from DCTL.ULSTCHNGREQ. Set link
> state change to no-action when the driver writes to DCTL.
>
> Note that this patch was submitted upstream in Linux in 2020 [1],
> and I've confirmed I need it in U-Boot to enable gadget mode.
>
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/patch/drivers/usb/dwc3?id=5b738211fb59e114727381d07c647a77c0010996
>
> Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
> Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
> ---
>  drivers/usb/dwc3/gadget.c | 20 +++++++++-----------
>  drivers/usb/dwc3/gadget.h | 14 ++++++++++++++
>  2 files changed, 23 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
> index 2b01113d54c..24ae0c232f6 100644
> --- a/drivers/usb/dwc3/gadget.c
> +++ b/drivers/usb/dwc3/gadget.c
> @@ -62,7 +62,7 @@ int dwc3_gadget_set_test_mode(struct dwc3 *dwc, int mode)
>  		return -EINVAL;
>  	}
>  
> -	dwc3_writel(dwc->regs, DWC3_DCTL, reg);
> +	dwc3_gadget_dctl_write_safe(dwc, reg);
>  
>  	return 0;
>  }
> @@ -1396,7 +1396,7 @@ static int dwc3_gadget_set_selfpowered(struct usb_gadget *g,
>  static int dwc3_gadget_run_stop(struct dwc3 *dwc, int is_on, int suspend)
>  {
>  	u32			reg;
> -	u32			timeout = 500;
> +	u32			timeout = 2000;

This change (timeout increase) is not part of patch you linked in [1]

Can you either drop this or move this to a separate patch, explaining
why it's needed?

>  

  reply	other threads:[~2026-01-14 11:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-23 23:13 [PATCH 0/2] USB Fixes for Gadget Mode on DWC3 Chris Morgan
2025-12-23 23:13 ` [PATCH 1/2] usb: dwc3: gadget: Don't send unintended link state change Chris Morgan
2026-01-14 11:09   ` Mattijs Korpershoek [this message]
2025-12-23 23:13 ` [PATCH 2/2] usb: dwc3: core: improve reset sequence Chris Morgan
2026-01-14 11:15   ` Mattijs Korpershoek
2026-01-15 22:05     ` Chris Morgan
2026-01-16  8:12       ` Mattijs Korpershoek

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=87jyxkfo2q.fsf@kernel.org \
    --to=mkorpershoek@kernel.org \
    --cc=felipe.balbi@linux.intel.com \
    --cc=lukma@denx.de \
    --cc=macroalpha82@gmail.com \
    --cc=macromorgan@hotmail.com \
    --cc=marex@denx.de \
    --cc=neil.armstrong@linaro.org \
    --cc=quic_varada@quicinc.com \
    --cc=thinhn@synopsys.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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