[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8bcbf37b-b70d-48e3-b435-a097d351f786@tuxon.dev>
Date: Wed, 28 May 2025 15:19:27 +0300
From: Claudiu Beznea <claudiu.beznea@...on.dev>
To: Ulf Hansson <ulf.hansson@...aro.org>,
Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc: gregkh@...uxfoundation.org, rafael@...nel.org, dakr@...nel.org,
len.brown@...el.com, pavel@...nel.org, jic23@...nel.org,
daniel.lezcano@...aro.org, linux-kernel@...r.kernel.org,
linux-pm@...r.kernel.org, linux-iio@...r.kernel.org,
linux-renesas-soc@...r.kernel.org, bhelgaas@...gle.com,
geert@...ux-m68k.org, Claudiu Beznea <claudiu.beznea.uj@...renesas.com>
Subject: Re: [PATCH v2 1/2] PM: domains: Add devres variant for
dev_pm_domain_attach()
Hi, Ulf,
On 28.05.2025 12:31, Ulf Hansson wrote:
>>> +
>>> +/**
>>> + * devm_pm_domain_attach - devres-enabled version of dev_pm_domain_attach()
>>> + * @dev: Device to attach.
>>> + * @attach_power_on: Use to indicate whether we should power on the device
>>> + * when attaching (true indicates the device is powered on
>>> + * when attaching).
>>> + * @detach_power_off: Used to indicate whether we should power off the device
>>> + * when detaching (true indicates the device is powered off
>>> + * when detaching).
>>> + *
>>> + * NOTE: this will also handle calling dev_pm_domain_detach() for
>>> + * you during remove phase.
>>> + *
>>> + * Returns 0 on successfully attached PM domain, or a negative error code in
>>> + * case of a failure.
>>> + */
>>> +int devm_pm_domain_attach(struct device *dev, bool attach_power_on,
>>> + bool detach_power_off)
>> Do we have examples where we power on a device and leave it powered on
>> (or do not power on device on attach but power off it on detach)? I
>> believe devm release should strictly mirror the acquisition, so separate
>> flag is not needed.
> This sounds reasonable for me too.
Then I'll drop the detach_power_off in the next version.
Thank you for your review,
Claudiu
>
> Note that, in most of the *special* cases for where
> dev_pm_domain_attach|detach() is used today, the corresponding PM
> domain is managed by genpd through a DT based configuration. And genpd
> via genpd_dev_pm_attach|detach() doesn't even take this as an
> in-parameter.
>
> So this is solely for the behaviour for the acpi PM domain, just to
> make sure that's clear.
>
> [...]
>
> Kind regards
> Uffe
Powered by blists - more mailing lists