mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stefan Wahren <wahrenst@gmx.net>
To: Fabrice Gasnier <fabrice.gasnier@foss.st.com>,
	Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Douglas Anderson <dianders@chromium.org>,
	Artur Petrosyan <Arthur.Petrosyan@synopsys.com>,
	Amelie Delaunay <amelie.delaunay@foss.st.com>,
	Jisheng Zhang <jszhang@kernel.org>,
	Felipe Balbi <balbi@kernel.org>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com, stable@vger.kernel.org
Subject: Re: [PATCH v5 1/7] usb: dwc2: fix recovery after PM domain off
Date: Tue, 24 Nov 2026 22:31:20 +0100	[thread overview]
Message-ID: <5c2bd597-a279-4523-b702-0af2c6d9d4f3@gmx.net> (raw)
In-Reply-To: <7ffe72c6-6204-43ab-bfb7-5df87341ce7b@foss.st.com>

Hi Fabrice,

Am 24.11.26 um 11:52 schrieb Fabrice Gasnier:
> On 11/21/26 21:38, Stefan Wahren wrote:
>> Hi Fabrice,
>>
>> Am 17.11.26 um 18:06 schrieb Fabrice Gasnier:
>>> When the power domain containing the DWC2 controller is disabled during
>>> suspend, its registers are lost. Reading registers to back them up from
>>> dwc2_suspend() after clock gating can hang STM32MP1 in both host and
>>> device mode. Host suspend enters clock gating directly; in device mode,
>>> this can happen if the host suspended the USB bus before system suspend.
> Hi Stefan,
>
>> sorry for breaking this platform, but I only had the Raspberry Pi for testing and I didn't get much
>> feedback last year.
> I saw your series, sorry about that, but unfortunately I haven't tested in time...
no worries
>
>> I'm not familiar with STM32MP1, could you please clarify based on the compatible which is affected?
> Yes, "st,stm32mp15-hsotg"
I think it would be helpful to have at least "stm32mp15" in the commit 
message
>
>> Could you please explain, why backing up the registers before clock gating isn't an option?
> Well, that can probably be an option, thanks on your suggestion!
>
> That's not the way I had in mind (power gating and clock gating are two things).
> This means: prepare for register loss each time the controller is put into clock gating mode (but
> drop the backup values when exiting clock gating without PM-wide platform suspend, as these are
> normally not lost).
>
> I can rework this in V6:
> - Add the registers backup call when entering clock gating. This will backup the registers when the
> bus gets suspended (either as device or host), then a later PM suspend request can skip the backup,
> if they are already backed-up.
> - Remains some stale states, as raised by Sashiko: when doing this, most of state flags have to be
> re-initialized. I'll try to split into separate patch to ease review.
>
> Is it basically what you're thinking of ?
Yes, I'm not an expert here and mostly followed Doug's suggestions. I 
consider my suggestion as a possible fix for my original approach.
There is a reference manual [1] for the EZR32WG ARM MCU, which also have 
a DWC2 IP. Even if it's not your SoC, the chapter 15.4.8.2 Suspend seems 
to have helpful information.

I hope this helps.

Best regards

[1] - 
https://www.silabs.com/documents/public/reference-manuals/EZR32WG-RM.pdf
>
> Best Regards,
> Fabrice
>
>> Best regards


  reply	other threads:[~2026-11-24 21:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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-21 20:38   ` Stefan Wahren
2026-11-24 10:52     ` Fabrice Gasnier
2026-11-24 21:31       ` Stefan Wahren [this message]
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:06 ` [PATCH v5 3/7] usb: dwc2: fix a possible interrupt storm on stm32mp1 Fabrice Gasnier
2026-11-17 17:06 ` [PATCH v5 4/7] usb: dwc2: hcd: fix possible successive vbus supply enables Fabrice Gasnier
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:06 ` [PATCH v5 6/7] usb: dwc2: restore peripheral mode on low-level enable Fabrice Gasnier
2026-11-17 17:06 ` [PATCH v5 7/7] usb: dwc2: platform: fix stm32mp15 detection logic power management Fabrice Gasnier

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=5c2bd597-a279-4523-b702-0af2c6d9d4f3@gmx.net \
    --to=wahrenst@gmx.net \
    --cc=Arthur.Petrosyan@synopsys.com \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=amelie.delaunay@foss.st.com \
    --cc=balbi@kernel.org \
    --cc=dianders@chromium.org \
    --cc=fabrice.gasnier@foss.st.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jszhang@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=stable@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

all inboxes | Powered by JetHome®