]> git.hungrycats.org Git - linux/commitdiff
drm/msm/dpu: Drop sneaky dev_pm_opp_set_rate(0)
authorKonrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Tue, 28 Jul 2026 13:20:45 +0000 (15:20 +0200)
committerDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Fri, 31 Jul 2026 14:08:01 +0000 (17:08 +0300)
dev_pm_opp_set_rate(0) removes the vote specified in required-opps but
does not actually park the clock, making it run without the necessary
power backing. Prevent that from happening when
_dpu_core_perf_get_core_clk_rate() returns 0.

Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support")
Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/742779/
Link: https://lore.kernel.org/r/20260728-topic-dpu_power-v1-1-e7783b859a70@oss.qualcomm.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c

index 2ff255d7795e56565986bdc89b430f679f256ab3..fea173e374648e35b085e51a99661151709d00bf 100644 (file)
@@ -394,6 +394,10 @@ int dpu_core_perf_crtc_update(struct drm_crtc *crtc,
 
                trace_dpu_core_perf_update_clk(kms->dev, !crtc->enabled, clk_rate);
 
+               /* If we're going offline, PM callbacks will disable the clocks instead */
+               if (!clk_rate)
+                       return 0;
+
                clk_rate = min(clk_rate, kms->perf.max_core_clk_rate);
                ret = dev_pm_opp_set_rate(&kms->pdev->dev, clk_rate);
                if (ret) {