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