linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jisheng Zhang <jszhang@kernel.org>
To: Minas Harutyunyan <hminas@synopsys.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 0/2] usb: dwc2: fix hang during suspend or shutdown
Date: Tue,  4 Nov 2025 08:25:01 +0800	[thread overview]
Message-ID: <20251104002503.17158-1-jszhang@kernel.org> (raw)

dwc2 on most platforms needs phy controller, clock and power supply.
All of them must be enabled/activated to properly operate. If dwc2
is configured as peripheral mode, then all the above three hardware
resources are disabled at the end of the probe:

	/* Gadget code manages lowlevel hw on its own */
	if (hsotg->dr_mode == USB_DR_MODE_PERIPHERAL)
		dwc2_lowlevel_hw_disable(hsotg);

But both dwc2_driver_shutdown() and dwc2_suspend() tries to access
the dwc2 registers, this would result in hang during suspend or
shutdown if dwc2 is configured as peripheral mode.

This series tries to fix both issues.

Jisheng Zhang (2):
  usb: dwc2: fix hang during shutdown if set as peripheral
  usb: dwc2: fix hang during suspend if set as peripheral

 drivers/usb/dwc2/platform.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

-- 
2.50.0


             reply	other threads:[~2025-11-04  0:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-04  0:25 Jisheng Zhang [this message]
2025-11-04  0:25 ` [PATCH 1/2] usb: dwc2: fix hang during shutdown if set as peripheral Jisheng Zhang
2025-11-04  0:25 ` [PATCH 2/2] usb: dwc2: fix hang during suspend " Jisheng Zhang

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=20251104002503.17158-1-jszhang@kernel.org \
    --to=jszhang@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hminas@synopsys.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).