Hi,
v5.15.y commit cbf207b17111 ("drm/msm/dsi: Use pm_runtime_resume_and_get to prevent refcnt leaks"), which is commit 3d07a411b4fa upstream, broke display on Dragonboard 845c(sdm845). Cherry-picking commit 6ab502bc1cf3 ("drm/msm/dsi: Enable runtime PM") from the original patch series https://patchwork.freedesktop.org/series/119583/ and it's dependent runtime PM helper routines as suggested by Dmitry https://lore.kernel.org/stable/CAA8EJpo7q9qZbgXHWe7SuQFh0EWW0ZxGL5xYX4nckoFG... fixes that display regression on DB845c.
Douglas Anderson (1): PM: runtime: Have devm_pm_runtime_enable() handle pm_runtime_dont_use_autosuspend()
Konrad Dybcio (1): drm/msm/dsi: Enable runtime PM
drivers/base/power/runtime.c | 5 +++++ drivers/gpu/drm/msm/dsi/phy/dsi_phy.c | 4 ++++ include/linux/pm_runtime.h | 4 ++++ 3 files changed, 13 insertions(+)
From: Douglas Anderson dianders@chromium.org
[ Upstream commit b4060db9251f919506e4d672737c6b8ab9a84701 ]
The PM Runtime docs say:
Drivers in ->remove() callback should undo the runtime PM changes done in ->probe(). Usually this means calling pm_runtime_disable(), pm_runtime_dont_use_autosuspend() etc.
From grepping code, it's clear that many people aren't aware of the need to call pm_runtime_dont_use_autosuspend().
When brainstorming solutions, one idea that came up was to leverage the new-ish devm_pm_runtime_enable() function. The idea here is that:
* When the devm action is called we know that the driver is being removed. It's the perfect time to undo the use_autosuspend.
* The code of pm_runtime_dont_use_autosuspend() already handles the case of being called when autosuspend wasn't enabled.
Suggested-by: Laurent Pinchart laurent.pinchart@ideasonboard.com Signed-off-by: Douglas Anderson dianders@chromium.org Reviewed-by: Ulf Hansson ulf.hansson@linaro.org Signed-off-by: Rafael J. Wysocki rafael.j.wysocki@intel.com Stable-dep-of: 3d07a411b4fa ("drm/msm/dsi: Use pm_runtime_resume_and_get to prevent refcnt leaks") Signed-off-by: Amit Pundir amit.pundir@linaro.org --- drivers/base/power/runtime.c | 5 +++++ include/linux/pm_runtime.h | 4 ++++ 2 files changed, 9 insertions(+)
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c index 5824d41a0b74..6699096ff2fa 100644 --- a/drivers/base/power/runtime.c +++ b/drivers/base/power/runtime.c @@ -1479,11 +1479,16 @@ EXPORT_SYMBOL_GPL(pm_runtime_enable);
static void pm_runtime_disable_action(void *data) { + pm_runtime_dont_use_autosuspend(data); pm_runtime_disable(data); }
/** * devm_pm_runtime_enable - devres-enabled version of pm_runtime_enable. + * + * NOTE: this will also handle calling pm_runtime_dont_use_autosuspend() for + * you at driver exit time if needed. + * * @dev: Device to handle. */ int devm_pm_runtime_enable(struct device *dev) diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index 90eaff8b78fc..7efb10518313 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h @@ -542,6 +542,10 @@ static inline void pm_runtime_disable(struct device *dev) * Allow the runtime PM autosuspend mechanism to be used for @dev whenever * requested (or "autosuspend" will be handled as direct runtime-suspend for * it). + * + * NOTE: It's important to undo this with pm_runtime_dont_use_autosuspend() + * at driver exit time unless your driver initially enabled pm_runtime + * with devm_pm_runtime_enable() (which handles it for you). */ static inline void pm_runtime_use_autosuspend(struct device *dev) {
From: Konrad Dybcio konrad.dybcio@linaro.org
[ Upstream commit 6ab502bc1cf3147ea1d8540d04b83a7a4cb6d1f1 ]
Some devices power the DSI PHY/PLL through a power rail that we model as a GENPD. Enable runtime PM to make it suspendable.
Change-Id: I70b04b7fbf75ccf508ab2dcbe393dbb2be6e4eaa Signed-off-by: Konrad Dybcio konrad.dybcio@linaro.org Reviewed-by: Dmitry Baryshkov dmitry.baryshkov@linaro.org Patchwork: https://patchwork.freedesktop.org/patch/543352/ Link: https://lore.kernel.org/r/20230620-topic-dsiphy_rpm-v2-2-a11a751f34f0@linaro... Signed-off-by: Dmitry Baryshkov dmitry.baryshkov@linaro.org Stable-dep-of: 3d07a411b4fa ("drm/msm/dsi: Use pm_runtime_resume_and_get to prevent refcnt leaks") Signed-off-by: Amit Pundir amit.pundir@linaro.org --- drivers/gpu/drm/msm/dsi/phy/dsi_phy.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c index 4b5b0a4b051b..6b9a9e56df37 100644 --- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c +++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c @@ -752,6 +752,10 @@ static int dsi_phy_driver_probe(struct platform_device *pdev) goto fail; }
+ ret = devm_pm_runtime_enable(&pdev->dev); + if (ret) + return ret; + /* PLL init will call into clk_register which requires * register access, so we need to enable power and ahb clock. */
linux-stable-mirror@lists.linaro.org