[PATCH 2/2] drm/tegra: Allow runtime suspend on system sleep

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Thierry Reding <treding@xxxxxxxxxx>

By default the PM core prevents devices from being runtime suspended
during system sleep. This is needed to avoid some common cases where
devices cannot be properly resumed because their parents are runtime
suspended at an unfortunate point in time.

However, there are cases where suspend/resume works in a way that it
becomes possible for devices to be runtime suspended at system sleep
time. In fact, for some devices runtime suspension can be equivalent
to their state in system sleep.

Typically this would be solved by making the runtime suspend/resume
callbacks the same as the system suspend/resume callbacks. For some
subsystems it isn't quite that simple, unfortunately.

For example, the DRM subsystem has subsystem-level suspend/resume
helpers that control how display pipelines are shut down on suspend
and brought up again on resume. This procedure is the same as their
operation under normal circumstances (when the user switches on/off
a subset of the displays in their configuration). These helpers are
carefully ordering the operations to make sure the right sequences
between connectors, encoders and display controllers are respected.

In order for suspend/resume to not get in the way of the sequencing
that's already happening at the subsystem level, allow the devices
involved in the display pipelines to runtime suspend during system
sleep.

Signed-off-by: Thierry Reding <treding@xxxxxxxxxx>
---
 drivers/gpu/drm/tegra/dc.c   | 1 +
 drivers/gpu/drm/tegra/dsi.c  | 1 +
 drivers/gpu/drm/tegra/hdmi.c | 1 +
 drivers/gpu/drm/tegra/hub.c  | 1 +
 drivers/gpu/drm/tegra/sor.c  | 1 +
 5 files changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index 2b9a25c977c0..386819b4662b 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -2506,6 +2506,7 @@ static int tegra_dc_probe(struct platform_device *pdev)
 	}
 
 	platform_set_drvdata(pdev, dc);
+	pm_runtime_always_allow(&pdev->dev);
 	pm_runtime_enable(&pdev->dev);
 
 	INIT_LIST_HEAD(&dc->client.list);
diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c
index a5d47e301c5f..683a27f9ba52 100644
--- a/drivers/gpu/drm/tegra/dsi.c
+++ b/drivers/gpu/drm/tegra/dsi.c
@@ -1552,6 +1552,7 @@ static int tegra_dsi_probe(struct platform_device *pdev)
 	}
 
 	platform_set_drvdata(pdev, dsi);
+	pm_runtime_always_allow(&pdev->dev);
 	pm_runtime_enable(&pdev->dev);
 
 	INIT_LIST_HEAD(&dsi->client.list);
diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c
index 50269ffbcb6b..2562bf607be1 100644
--- a/drivers/gpu/drm/tegra/hdmi.c
+++ b/drivers/gpu/drm/tegra/hdmi.c
@@ -1664,6 +1664,7 @@ static int tegra_hdmi_probe(struct platform_device *pdev)
 	}
 
 	platform_set_drvdata(pdev, hdmi);
+	pm_runtime_always_allow(&pdev->dev);
 	pm_runtime_enable(&pdev->dev);
 
 	INIT_LIST_HEAD(&hdmi->client.list);
diff --git a/drivers/gpu/drm/tegra/hub.c b/drivers/gpu/drm/tegra/hub.c
index e56c0f7d3a13..aced537ac990 100644
--- a/drivers/gpu/drm/tegra/hub.c
+++ b/drivers/gpu/drm/tegra/hub.c
@@ -844,6 +844,7 @@ static int tegra_display_hub_probe(struct platform_device *pdev)
 		return err;
 
 	platform_set_drvdata(pdev, hub);
+	pm_runtime_always_allow(&pdev->dev);
 	pm_runtime_enable(&pdev->dev);
 
 	INIT_LIST_HEAD(&hub->client.list);
diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c
index a68d3b36b972..20058f11bf81 100644
--- a/drivers/gpu/drm/tegra/sor.c
+++ b/drivers/gpu/drm/tegra/sor.c
@@ -3833,6 +3833,7 @@ static int tegra_sor_probe(struct platform_device *pdev)
 	}
 
 	platform_set_drvdata(pdev, sor);
+	pm_runtime_always_allow(&pdev->dev);
 	pm_runtime_enable(&pdev->dev);
 
 	/*
-- 
2.23.0




[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux