]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/exynos: mixer: Fix enabling of the runtime power management
authorMarek Szyprowski <m.szyprowski@samsung.com>
Thu, 14 May 2020 10:08:12 +0000 (12:08 +0200)
committerInki Dae <inki.dae@samsung.com>
Mon, 18 May 2020 02:37:26 +0000 (11:37 +0900)
Runtime power management is essential for the Exynos Mixer driver
operation. It should be enabled before adding its DRM component, because
in some cases (when deferred probe takes place due to the IOMMU
availability) the DRM driver might be initialized directly from the
Mixer's component_add() call, what results in starting the driver
operation without enabling the runtime power management.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
drivers/gpu/drm/exynos/exynos_mixer.c

index 21b726baedeaa625a975d45a37fe3ef834baa154..c7e2e2ebc327bcf9beef2069c15fb52983655800 100644 (file)
@@ -1244,9 +1244,11 @@ static int mixer_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, ctx);
 
+       pm_runtime_enable(dev);
+
        ret = component_add(&pdev->dev, &mixer_component_ops);
-       if (!ret)
-               pm_runtime_enable(dev);
+       if (ret)
+               pm_runtime_disable(dev);
 
        return ret;
 }