This is a note to let you know that I've just added the patch titled drm/msm/adreno: fix runtime PM imbalance at unbind to the 6.2-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: drm-msm-adreno-fix-runtime-pm-imbalance-at-unbind.patch and it can be found in the queue-6.2 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 6153c44392b04ff2da1e9aa82ba87da9ab9a0fc1 Mon Sep 17 00:00:00 2001 From: Johan Hovold <johan+linaro@xxxxxxxxxx> Date: Tue, 21 Feb 2023 11:14:27 +0100 Subject: drm/msm/adreno: fix runtime PM imbalance at unbind From: Johan Hovold <johan+linaro@xxxxxxxxxx> commit 6153c44392b04ff2da1e9aa82ba87da9ab9a0fc1 upstream. A recent commit moved enabling of runtime PM from adreno_gpu_init() to adreno_load_gpu() (called on first open()), which means that unbind() may now be called with runtime PM disabled in case the device was never opened in between. Make sure to only forcibly suspend and disable runtime PM at unbind() in case runtime PM has been enabled to prevent a disable count imbalance. This specifically avoids leaving runtime PM disabled when the device is later opened after a successful bind: msm_dpu ae01000.display-controller: [drm:adreno_load_gpu [msm]] *ERROR* Couldn't power up the GPU: -13 Fixes: 4b18299b3365 ("drm/msm/adreno: Defer enabling runpm until hw_init()") Reported-by: Bjorn Andersson <quic_bjorande@xxxxxxxxxxx> Link: https://lore.kernel.org/lkml/20230203181245.3523937-1-quic_bjorande@xxxxxxxxxxx Cc: stable@xxxxxxxxxxxxxxx # 6.0 Signed-off-by: Johan Hovold <johan+linaro@xxxxxxxxxx> Patchwork: https://patchwork.freedesktop.org/patch/523549/ Link: https://lore.kernel.org/r/20230221101430.14546-2-johan+linaro@xxxxxxxxxx Signed-off-by: Rob Clark <robdclark@xxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/gpu/drm/msm/adreno/adreno_device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/gpu/drm/msm/adreno/adreno_device.c +++ b/drivers/gpu/drm/msm/adreno/adreno_device.c @@ -558,7 +558,8 @@ static void adreno_unbind(struct device struct msm_drm_private *priv = dev_get_drvdata(master); struct msm_gpu *gpu = dev_to_gpu(dev); - WARN_ON_ONCE(adreno_system_suspend(dev)); + if (pm_runtime_enabled(dev)) + WARN_ON_ONCE(adreno_system_suspend(dev)); gpu->funcs->destroy(gpu); priv->gpu_pdev = NULL; Patches currently in stable-queue which might be from johan+linaro@xxxxxxxxxx are queue-6.2/drm-msm-adreno-fix-runtime-pm-imbalance-at-unbind.patch