]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/msm/dpu: handle pm_runtime_get_sync() errors in bind path
authorAbhinav Kumar <quic_abhinavk@quicinc.com>
Wed, 18 May 2022 22:34:07 +0000 (15:34 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:30:17 +0000 (10:30 +0200)
[ Upstream commit 64b22a0da12adb571c01edd671ee43634ebd7e41 ]

If there are errors while trying to enable the pm in the
bind path, it will lead to unclocked access of hw revision
register thereby crashing the device.

This will not address why the pm_runtime_get_sync() fails
but at the very least we should be able to prevent the
crash by handling the error and bailing out earlier.

changes in v2:
- use pm_runtime_resume_and_get() instead of
  pm_runtime_get_sync()

Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support")
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Patchwork: https://patchwork.freedesktop.org/patch/486721/
Link: https://lore.kernel.org/r/20220518223407.26147-1-quic_abhinavk@quicinc.com
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c

index ad13a94236015237d5b7b497af19bc8173641ceb..c8089678f733369dd7b0e6b4d989a3c62c0e471c 100644 (file)
@@ -1058,7 +1058,9 @@ static int dpu_kms_hw_init(struct msm_kms *kms)
 
        dpu_kms_parse_data_bus_icc_path(dpu_kms);
 
-       pm_runtime_get_sync(&dpu_kms->pdev->dev);
+       rc = pm_runtime_resume_and_get(&dpu_kms->pdev->dev);
+       if (rc < 0)
+               goto error;
 
        dpu_kms->core_rev = readl_relaxed(dpu_kms->mmio + 0x0);