public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Roger Quadros <rogerq@kernel.org>
To: "Théo Lebrun" <theo.lebrun@bootlin.com>,
	"Peter Chen" <peter.chen@kernel.org>,
	"Pawel Laszczak" <pawell@cadence.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Mathias Nyman" <mathias.nyman@intel.com>
Cc: "Grégory Clement" <gregory.clement@bootlin.com>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 2/5] usb: cdns3-ti: run HW init at resume() if HW was reset
Date: Tue, 17 Dec 2024 23:13:34 +0200	[thread overview]
Message-ID: <8a1ed4be-c41c-46b6-ae25-33a6035b8c8d@kernel.org> (raw)
In-Reply-To: <D6AOGW7IXUEK.1AKKZZT0LAF0Q@bootlin.com>



On 13/12/2024 17:28, Théo Lebrun wrote:
> On Thu Dec 12, 2024 at 1:18 PM CET, Roger Quadros wrote:
>> On 10/12/2024 19:13, Théo Lebrun wrote:
>>> At runtime_resume(), read the W1 (Wrapper Register 1) register to detect
>>> if an hardware reset occurred. If it did, run the hardware init sequence.
>>>
>>> This callback will be called at system-wide resume. Previously, if a
>>> reset occurred during suspend, we would crash. The wrapper config had
>>> not been written, leading to invalid register accesses inside cdns3.
>>>
>>
>> Did I understand right that the Controller reset can happen only at
>> system suspend and never at runtime suspend?
> 
> J7200 + upstream kernel => if the power domain is cut off (it is
> implicitly at runtime PM) then it resets. This is 100% board dependent.
> We just never let it go into runtime suspend, for the moment.
> 
>> If so do you really need the runtime suspend/resume hooks?
>> you should have different system suspend/resume hooks than runtime suspend/resume
>> hooks and deal with the re-initialization in system resume hook.
> 
> The patch series works in the current setup with the wrapper that is
> never shut off. But it would also work if someone decides to use RPM on
> the wrapper.

But will it work? if we let it runtime suspend and controller looses power,
even though we restore the wrapper, who is restoring XHCI controller on
runtime resume?

Also we would be interested in wakeup events at runtime suspend
and by loosing power it doesn't look like it will ever wake up with any USB
event.

> 
> Overall, the current kernel-wide strategy is to minimise
> suspend/resume-specific code. Having only the concept of "runtime PM"
> and triggering that at system-wide suspend/resume is easier to reason
> about. It unifies concepts and reduces the states a device can be in.

or we just focus on system suspend/resume if the driver can't do
meaningful runtime suspend/resume?

> 
> We could even imagine a future where ->suspend|resume() callbacks
> are pm_runtime_force_suspend|resume() by default.
> That'd be the dream, at least.
> 
> Thanks,
> 
> --
> Théo Lebrun, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
> 

-- 
cheers,
-roger


  reply	other threads:[~2024-12-17 21:13 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-10 17:13 [PATCH v6 0/5] Fix USB suspend on TI J7200 (cdns3-ti, cdns3, xhci) Théo Lebrun
2024-12-10 17:13 ` [PATCH v6 1/5] usb: cdns3-ti: move reg writes to separate function Théo Lebrun
2024-12-12 12:12   ` Roger Quadros
2024-12-10 17:13 ` [PATCH v6 2/5] usb: cdns3-ti: run HW init at resume() if HW was reset Théo Lebrun
2024-12-12 12:18   ` Roger Quadros
2024-12-13 15:28     ` Théo Lebrun
2024-12-17 21:13       ` Roger Quadros [this message]
2024-12-14  8:49   ` Peter Chen
2024-12-16 14:02     ` Théo Lebrun
2024-12-17  6:12       ` Peter Chen
2024-12-10 17:13 ` [PATCH v6 3/5] usb: cdns3: rename hibernated argument of role->resume() to lost_power Théo Lebrun
2024-12-14  8:51   ` Peter Chen
2024-12-10 17:13 ` [PATCH v6 4/5] xhci: introduce xhci->lost_power flag Théo Lebrun
2024-12-12 12:37   ` Roger Quadros
2024-12-13 16:03     ` Théo Lebrun
2024-12-17 21:00       ` Roger Quadros
2024-12-18 17:49         ` Théo Lebrun
2025-01-08 10:59           ` Théo Lebrun
2025-01-08 18:43             ` Mathias Nyman
2025-01-29 10:45               ` Théo Lebrun
2025-01-29 10:56                 ` [PATCH 1/9] usb: host: xhci-plat: mvebu: use ->quirks instead of ->init_quirk() func Théo Lebrun
2025-01-29 10:56                 ` [PATCH 2/9] usb: xhci: tegra: rename `runtime` boolean to `is_auto_runtime` Théo Lebrun
2025-01-29 10:56                 ` [PATCH 3/9] usb: cdns3-ti: move reg writes to separate function Théo Lebrun
2025-01-29 10:56                 ` [PATCH 4/9] usb: cdns3-ti: run HW init at resume() if HW was reset Théo Lebrun
2025-01-29 10:56                 ` [PATCH 5/9] usb: cdns3: rename hibernated argument of role->resume() to lost_power Théo Lebrun
2025-01-29 10:56                 ` [PATCH 6/9] usb: cdns3: call cdns_power_is_lost() only once in cdns_resume() Théo Lebrun
2025-01-29 10:56                 ` [PATCH 7/9] usb: xhci: change xhci_resume() parameters to explicit the desired info Théo Lebrun
2025-01-29 10:56                 ` [PATCH 8/9] usb: host: xhci-plat: allow upper layers to signal power loss Théo Lebrun
2025-01-29 10:56                 ` [PATCH 9/9] usb: host: cdns3: forward lost power information to xhci Théo Lebrun
2024-12-10 17:13 ` [PATCH v6 5/5] usb: cdns3: host: transmit lost_power signal from wrapper to XHCI Théo Lebrun
2024-12-14  9:06 ` [PATCH v6 0/5] Fix USB suspend on TI J7200 (cdns3-ti, cdns3, xhci) Peter Chen
2024-12-16 14:09   ` Théo Lebrun
2024-12-17  6:17     ` Peter Chen

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=8a1ed4be-c41c-46b6-ae25-33a6035b8c8d@kernel.org \
    --to=rogerq@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=gregory.clement@bootlin.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=pawell@cadence.com \
    --cc=peter.chen@kernel.org \
    --cc=theo.lebrun@bootlin.com \
    --cc=thomas.petazzoni@bootlin.com \
    /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