06.10.2021 15:38, Ulf Hansson пишет:
I'm also wondering if we could add some 'was_enabled' flag to GENPDs, setting it by genpd_suspend_noirq() for the enabled domains, and then powering-on GENPDs from genpd_resume_noirq() only if they were in the enabled state during genpd_suspend_noirq() time. It actually puzzled me for a quite long time why GENPD core enables domains unconditionally during early resume. This should solve a part of the problem and it makes suspend/resume a bit safer because there is a smaller chance to crash hardware during suspend, at least it's easier to debug.
Just because the PM domain was already off at genpd_suspend_noirq(), doesn't mean that it can stay powered off at genpd_resume_noirq(). At least as is today.
The main reason why genpd_resume_noirq() powers on the PM domain, is because it's not possible for the consumer drivers to rely on runtime PM to do it (because runtime PM has been disabled by the PM core).
At least Tegra doesn't need to have domains force-resumed. This should be a platform-specific behaviour. We may add a new flag for that, I suppose. I'll try to keep this in mind for a future improvement. Thank you for the clarification.