Re: [PATCH v13 13/35] drm/tegra: gr2d: Support generic power domain and runtime PM

From
Dmitry Osipenko <digetx@gmail.com>
Date
2021-10-01 14:29:12
Also in
dri-devel, linux-clk, linux-devicetree, linux-mmc, linux-pm, linux-pwm, linux-staging, linux-tegra, lkml
Reply to
Ulf Hansson, 2021-10-01
01.10.2021 16:39, Ulf Hansson пишет:
On Mon, 27 Sept 2021 at 00:42, Dmitry Osipenko [off-list ref] wrote:
quoted
Add runtime power management and support generic power domains.

Tested-by: Peter Geis <redacted> # Ouya T30
Tested-by: Paul Fertser <fercerpav@gmail.com> # PAZ00 T20
Tested-by: Nicolas Chauvet <redacted> # PAZ00 T20 and TK1 T124
Tested-by: Matt Merhar <redacted> # Ouya T30
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 drivers/gpu/drm/tegra/gr2d.c | 155 +++++++++++++++++++++++++++++++++--
[...]
quoted
 static int gr2d_remove(struct platform_device *pdev)
@@ -259,15 +312,101 @@ static int gr2d_remove(struct platform_device *pdev)
                return err;
        }

+       pm_runtime_dont_use_autosuspend(&pdev->dev);
+       pm_runtime_disable(&pdev->dev);
There is no guarantee that the ->runtime_suspend() has been invoked
here, which means that clock may be left prepared/enabled beyond this
point.

I suggest you call pm_runtime_force_suspend(), instead of
pm_runtime_disable(), to make sure that gets done.
The pm_runtime_disable() performs the final synchronization, please see [1].

[1]
https://elixir.bootlin.com/linux/v5.15-rc3/source/drivers/base/power/runtime.c#L1412

Calling pm_runtime_force_suspend() isn't correct because each 'enable'
must have the corresponding 'disable'. Hence there is no problem here.
Thread (83 messages) 83 messages, 4 authors, last reply 2021-10-19
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help