From: sashiko-bot@kernel.org
To: "Fabrice Gasnier" <fabrice.gasnier@foss.st.com>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH v4 4/6] usb: dwc2: hcd: fix possible successive vbus supply enables
Date: Fri, 13 Nov 2026 19:49:27 +0000 [thread overview]
Message-ID: <sashiko-outbox-213572@kernel.org> (raw)
In-Reply-To: <20261113-dwc2-low-power-fixes-stm32-v4-4-08a8c962a09e@foss.st.com>
> Relying on HPRT0_PWR value to call dwc2_vbus_supply_init() shows some
> corner case resulting in vbus enable count to increase.
> As consequence, dwc2_vbus_supply_exit call done when clearing
> PWR bit won't disable vbus (for example upon suspend request).
>
> Address two case that has been seen:
> - In _dwc2_hcd_start(), external VBUS supply may have already been enabled,
> before entering dwc2_hcd_reinit (e.g. the controller is in host mode,
> without any device plugged).
> - Upon resume from low power in case registers have been lost. In clock
> gating mode PM suspend flow doesn't disable vbus while in host mode:
> - dwc2_port_suspend() enters clock gating (it sets lx_state to DWC2_L2)
> - _dwc2_hcd_suspend() nothing more to do as already in L2.
> - _dwc2_hcd_resume() - checks HPRT0_CONNSTS. If it's not set (register
> loss) it sets HPRT0_PWR and call dwc2_vbus_supply_init().
>
> Fix this by adding a boolean flag to balance vbus enable/disable calls
> instead of relying on HPRT0_PWR value. Clean the existing checks on pwr
> bit. A mutex is added as dwc2_vbus_supply_init/_exit calls can run
> concurrently from hub_control and dwc2_conn_id_status_change.
>
> Fixes: cd7cd0e6cedf ("usb: dwc2: fix unbalanced use of external vbus-supply")
> Cc: stable@vger.kernel.org
> Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261113-dwc2-low-power-fixes-stm32-v4-0-08a8c962a09e@foss.st.com?part=4
next prev parent reply other threads:[~2026-11-13 19:49 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 18:47 [PATCH v4 0/6] usb: dwc2: fix low power issues found on stm32mp1 Fabrice Gasnier
2026-11-13 18:47 ` [PATCH v4 1/6] usb: dwc2: fix recovery after PM domain off Fabrice Gasnier
2026-11-13 19:30 ` sashiko-bot
2026-11-13 18:47 ` [PATCH v4 2/6] usb: dwc2: fix a possible interrupt storm in hcd resume Fabrice Gasnier
2026-11-13 19:34 ` sashiko-bot
2026-11-13 18:48 ` [PATCH v4 3/6] usb: dwc2: fix a possible interrupt storm on stm32mp1 Fabrice Gasnier
2026-11-13 19:43 ` sashiko-bot
2026-11-13 18:48 ` [PATCH v4 4/6] usb: dwc2: hcd: fix possible successive vbus supply enables Fabrice Gasnier
2026-11-13 19:49 ` sashiko-bot [this message]
2026-11-13 18:48 ` [PATCH v4 5/6] usb: dwc2: hcd: don't disable external vbus in system suspend Fabrice Gasnier
2026-11-13 20:00 ` sashiko-bot
2026-11-13 18:48 ` [PATCH v4 6/6] usb: dwc2: platform: fix stm32mp15 detection logic power management Fabrice Gasnier
2026-11-13 20:41 ` sashiko-bot
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=sashiko-outbox-213572@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=fabrice.gasnier@foss.st.com \
--cc=linux-usb@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.