linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/7] usb: dwc2: fix low power issues found on stm32mp1
@ 2026-11-17 17:06 Fabrice Gasnier
  2026-11-17 17:06 ` [PATCH v5 1/7] usb: dwc2: fix recovery after PM domain off Fabrice Gasnier
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: Fabrice Gasnier @ 2026-11-17 17:06 UTC (permalink / raw)
  To: Thinh Nguyen, Greg Kroah-Hartman, Douglas Anderson, Stefan Wahren,
	Artur Petrosyan, Amelie Delaunay, Fabrice Gasnier, Jisheng Zhang,
	Felipe Balbi
  Cc: linux-usb, linux-kernel, linux-stm32, stable

This series addresses several hang, bad_irq or re-initialisation issues
found on stm32mp1 when going to system low power (stop mode):
- First three fixes can be reproduced on stm32mp13 DK board, stm32mp15 DK
  and EVAL boards.
- Subsequent fixes can be reproduced on stm32mp15 EVAL board that uses
  an external Vbus regulator and stm32 dedicated detection logic.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
---
Changes in v5:
- Address Sashiko comments on first and last patch
- Added one separate patch as last issue raised by Sashiko appears in
  current patchset but pre-exists.
- Link to v4: https://patch.msgid.link/20261113-dwc2-low-power-fixes-stm32-v4-0-08a8c962a09e@foss.st.com

Changes in v4:
- Address Sashiko feedback on register-loss recovery: add
  dwc2_hcd_restore() to reinitialize the host and clear stale state;
  disconnect the gadget and clear stale endpoint and low-power state.
- Fix the HCD resume race by holding hsotg->lock with interrupts disabled
  across global interrupt enable and dwc2_hcd_reinit().
- Rework VBUS handling: track the regulator enable reference with
  vbus_supply_enabled and a mutex, keep external VBUS enabled across
  system suspend, and drop dwc2_vbus_supply_restore().
- Track STM32 ID/VBUS detection enablement with
  stm32_id_vb_detection_enabled.
- Link to v3: https://patch.msgid.link/20261106-dwc2-low-power-fixes-stm32-v3-0-68d2a0e9bab6@foss.st.com

Changes in v3:
- Update since Sashiko comments
- Add a paramter (need_restore) to gadget resume function based on
  canary detection to avoir possible race on lx_state as raised by
  Sashiko
- Add a dwc2_vbus_supply_restore() to check regulator enable state
  during hcd resume, to enforce it gets restored along with PWR bit
  if it has been turned off earlier.
- Introduced a new patch for a possible race in hcd resume, with
  HCD_FLAG_HW_ACCESSIBLE not being set, but host interrupts are active.
- Refactor stm32 vb/id detection, to rool back in case of regulator
  disable fails.
- Link to v2: https://patch.msgid.link/20261013-dwc2-low-power-fixes-stm32-v2-0-79865a4f1b63@foss.st.com

Changes in v2:
- Several fixes or commit messages updates since Sashiko review (see
  changelog in each patch).
- Add Thinh instead of Minas to the recipients
- Link to v1: https://patch.msgid.link/20261008-dwc2-low-power-fixes-stm32-v1-0-5b303df762e6@foss.st.com

---
Fabrice Gasnier (7):
      usb: dwc2: fix recovery after PM domain off
      usb: dwc2: fix a possible interrupt storm in hcd resume
      usb: dwc2: fix a possible interrupt storm on stm32mp1
      usb: dwc2: hcd: fix possible successive vbus supply enables
      usb: dwc2: hcd: don't disable external vbus in system suspend
      usb: dwc2: restore peripheral mode on low-level enable
      usb: dwc2: platform: fix stm32mp15 detection logic power management

 drivers/usb/dwc2/core.c      |   1 -
 drivers/usb/dwc2/core.h      |  17 ++-
 drivers/usb/dwc2/core_intr.c |   9 +-
 drivers/usb/dwc2/gadget.c    |  37 ++++++-
 drivers/usb/dwc2/hcd.c       | 101 ++++++++++++-----
 drivers/usb/dwc2/platform.c  | 257 ++++++++++++++++++++++++-------------------
 6 files changed, 269 insertions(+), 153 deletions(-)
---
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
change-id: 20261007-dwc2-low-power-fixes-stm32-0c1e5e68b252

Best regards,
--  
Fabrice Gasnier <fabrice.gasnier@foss.st.com>


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2026-11-17 17:42 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-17 17:06 [PATCH v5 0/7] usb: dwc2: fix low power issues found on stm32mp1 Fabrice Gasnier
2026-11-17 17:06 ` [PATCH v5 1/7] usb: dwc2: fix recovery after PM domain off Fabrice Gasnier
2026-11-17 17:42   ` sashiko-bot
2026-11-17 17:06 ` [PATCH v5 2/7] usb: dwc2: fix a possible interrupt storm in hcd resume Fabrice Gasnier
2026-11-17 17:14   ` sashiko-bot
2026-11-17 17:06 ` [PATCH v5 3/7] usb: dwc2: fix a possible interrupt storm on stm32mp1 Fabrice Gasnier
2026-11-17 17:15   ` sashiko-bot
2026-11-17 17:06 ` [PATCH v5 4/7] usb: dwc2: hcd: fix possible successive vbus supply enables Fabrice Gasnier
2026-11-17 17:15   ` sashiko-bot
2026-11-17 17:06 ` [PATCH v5 5/7] usb: dwc2: hcd: don't disable external vbus in system suspend Fabrice Gasnier
2026-11-17 17:15   ` sashiko-bot
2026-11-17 17:06 ` [PATCH v5 6/7] usb: dwc2: restore peripheral mode on low-level enable Fabrice Gasnier
2026-11-17 17:31   ` sashiko-bot
2026-11-17 17:06 ` [PATCH v5 7/7] usb: dwc2: platform: fix stm32mp15 detection logic power management Fabrice Gasnier
2026-11-17 17:32   ` sashiko-bot

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).