mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/3] Remove brownout risks from DPU
@ 2026-07-28 13:20 Konrad Dybcio
  2026-07-28 13:20 ` [PATCH 1/3] drm/msm/dpu: Drop sneaky dev_pm_opp_set_rate(0) Konrad Dybcio
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Konrad Dybcio @ 2026-07-28 13:20 UTC (permalink / raw)
  To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
	Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
	Rajendra Nayak, Matthias Kaehlcke, Sravanthi Kollukuduru,
	Rajesh Yadav, Chandan Uddaraju, Jeykumar Sankaran, Vara Reddy,
	Stephen Boyd, Guenter Roeck, Kuogee Hsieh, Archit Taneja
  Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Tanmay Shah,
	Konrad Dybcio

Things generally run better when plugged in. That also happens to hold
for clocks. To ensure that is the case, remove calls that drop the
performance state votes while the clocks are still running.

This helps Glymur devices not crash upon resume when a display
(incl. the internal one) is plugged in.

The DSI patch is compile-tested only.

Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
---
Konrad Dybcio (3):
      drm/msm/dpu: Drop sneaky dev_pm_opp_set_rate(0)
      drm/msm/dp: Drop dev_pm_opp_set_rate(0)
      drm/msm/dsi: Drop dev_pm_opp_set_rate(0)

 drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 4 ++++
 drivers/gpu/drm/msm/dp/dp_ctrl.c              | 6 +-----
 drivers/gpu/drm/msm/dsi/dsi_host.c            | 2 --
 3 files changed, 5 insertions(+), 7 deletions(-)
---
base-commit: 0d33d21e47d9dc66f91e44da3fc9220c74d93df7
change-id: 20260728-topic-dpu_power-23f5913b1194

Best regards,
--  
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/3] drm/msm/dpu: Drop sneaky dev_pm_opp_set_rate(0)
  2026-07-28 13:20 [PATCH 0/3] Remove brownout risks from DPU Konrad Dybcio
@ 2026-07-28 13:20 ` Konrad Dybcio
  2026-07-28 13:57   ` Dmitry Baryshkov
  2026-07-28 13:20 ` [PATCH 2/3] drm/msm/dp: Drop dev_pm_opp_set_rate(0) Konrad Dybcio
  2026-07-28 13:20 ` [PATCH 3/3] drm/msm/dsi: " Konrad Dybcio
  2 siblings, 1 reply; 8+ messages in thread
From: Konrad Dybcio @ 2026-07-28 13:20 UTC (permalink / raw)
  To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
	Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
	Rajendra Nayak, Matthias Kaehlcke, Sravanthi Kollukuduru,
	Rajesh Yadav, Chandan Uddaraju, Jeykumar Sankaran, Vara Reddy,
	Stephen Boyd, Guenter Roeck, Kuogee Hsieh, Archit Taneja
  Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Tanmay Shah,
	Konrad Dybcio

From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

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>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
index 2ff255d7795e..fea173e37464 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
@@ -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) {

-- 
2.55.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 2/3] drm/msm/dp: Drop dev_pm_opp_set_rate(0)
  2026-07-28 13:20 [PATCH 0/3] Remove brownout risks from DPU Konrad Dybcio
  2026-07-28 13:20 ` [PATCH 1/3] drm/msm/dpu: Drop sneaky dev_pm_opp_set_rate(0) Konrad Dybcio
@ 2026-07-28 13:20 ` Konrad Dybcio
  2026-07-28 13:56   ` Dmitry Baryshkov
  2026-07-28 13:20 ` [PATCH 3/3] drm/msm/dsi: " Konrad Dybcio
  2 siblings, 1 reply; 8+ messages in thread
From: Konrad Dybcio @ 2026-07-28 13:20 UTC (permalink / raw)
  To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
	Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
	Rajendra Nayak, Matthias Kaehlcke, Sravanthi Kollukuduru,
	Rajesh Yadav, Chandan Uddaraju, Jeykumar Sankaran, Vara Reddy,
	Stephen Boyd, Guenter Roeck, Kuogee Hsieh, Archit Taneja
  Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Tanmay Shah,
	Konrad Dybcio

From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

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. Drop the explicit calls to it.

Fixes: c943b4948b58 ("drm/msm/dp: add displayPort driver support")
Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
---
 drivers/gpu/drm/msm/dp/dp_ctrl.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/msm/dp/dp_ctrl.c b/drivers/gpu/drm/msm/dp/dp_ctrl.c
index 86ef8c89ad44..e09924eae5a7 100644
--- a/drivers/gpu/drm/msm/dp/dp_ctrl.c
+++ b/drivers/gpu/drm/msm/dp/dp_ctrl.c
@@ -1950,13 +1950,12 @@ static int msm_dp_ctrl_reinitialize_mainlink(struct msm_dp_ctrl_private *ctrl)
 	msm_dp_ctrl_mainlink_disable(ctrl);
 	ctrl->phy_opts.dp.lanes = ctrl->link->link_params.num_lanes;
 	phy_configure(phy, &ctrl->phy_opts);
+
 	/*
 	 * Disable and re-enable the mainlink clock since the
 	 * link clock might have been adjusted as part of the
 	 * link maintenance.
 	 */
-	dev_pm_opp_set_rate(ctrl->dev, 0);
-
 	msm_dp_ctrl_link_clk_disable(&ctrl->msm_dp_ctrl);
 
 	phy_power_off(phy);
@@ -1982,7 +1981,6 @@ static int msm_dp_ctrl_deinitialize_mainlink(struct msm_dp_ctrl_private *ctrl)
 
 	msm_dp_ctrl_reset(&ctrl->msm_dp_ctrl);
 
-	dev_pm_opp_set_rate(ctrl->dev, 0);
 	msm_dp_ctrl_link_clk_disable(&ctrl->msm_dp_ctrl);
 
 	phy_power_off(phy);
@@ -2573,7 +2571,6 @@ void msm_dp_ctrl_off_link_stream(struct msm_dp_ctrl *msm_dp_ctrl)
 		ctrl->stream_clks_on = false;
 	}
 
-	dev_pm_opp_set_rate(ctrl->dev, 0);
 	msm_dp_ctrl_link_clk_disable(&ctrl->msm_dp_ctrl);
 
 	phy_power_off(phy);
@@ -2602,7 +2599,6 @@ void msm_dp_ctrl_off(struct msm_dp_ctrl *msm_dp_ctrl)
 		ctrl->stream_clks_on = false;
 	}
 
-	dev_pm_opp_set_rate(ctrl->dev, 0);
 	msm_dp_ctrl_link_clk_disable(&ctrl->msm_dp_ctrl);
 
 	phy_power_off(phy);

-- 
2.55.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 3/3] drm/msm/dsi: Drop dev_pm_opp_set_rate(0)
  2026-07-28 13:20 [PATCH 0/3] Remove brownout risks from DPU Konrad Dybcio
  2026-07-28 13:20 ` [PATCH 1/3] drm/msm/dpu: Drop sneaky dev_pm_opp_set_rate(0) Konrad Dybcio
  2026-07-28 13:20 ` [PATCH 2/3] drm/msm/dp: Drop dev_pm_opp_set_rate(0) Konrad Dybcio
@ 2026-07-28 13:20 ` Konrad Dybcio
  2026-07-28 13:55   ` Dmitry Baryshkov
  2 siblings, 1 reply; 8+ messages in thread
From: Konrad Dybcio @ 2026-07-28 13:20 UTC (permalink / raw)
  To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
	Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
	Rajendra Nayak, Matthias Kaehlcke, Sravanthi Kollukuduru,
	Rajesh Yadav, Chandan Uddaraju, Jeykumar Sankaran, Vara Reddy,
	Stephen Boyd, Guenter Roeck, Kuogee Hsieh, Archit Taneja
  Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Tanmay Shah,
	Konrad Dybcio

From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

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. Drop the explicit call to it.

Every call site of ops->link_clk_disable() is followed by
pm_runtime_put(), so the power vote will be rescinded if deemed safe.

Fixes: 32d3e0feccfe ("drm/msm: dsi: Use OPP API to set clk/perf state")
Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
---
 drivers/gpu/drm/msm/dsi/dsi_host.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
index 59125d342fcb..7e4e3718b536 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -550,8 +550,6 @@ int dsi_link_clk_enable_v2(struct msm_dsi_host *msm_host)
 
 void dsi_link_clk_disable_6g(struct msm_dsi_host *msm_host)
 {
-	/* Drop the performance state vote */
-	dev_pm_opp_set_rate(&msm_host->pdev->dev, 0);
 	clk_disable_unprepare(msm_host->esc_clk);
 	clk_disable_unprepare(msm_host->pixel_clk);
 	clk_disable_unprepare(msm_host->byte_intf_clk);

-- 
2.55.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/3] drm/msm/dsi: Drop dev_pm_opp_set_rate(0)
  2026-07-28 13:20 ` [PATCH 3/3] drm/msm/dsi: " Konrad Dybcio
@ 2026-07-28 13:55   ` Dmitry Baryshkov
  0 siblings, 0 replies; 8+ messages in thread
From: Dmitry Baryshkov @ 2026-07-28 13:55 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
	Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
	Rajendra Nayak, Matthias Kaehlcke, Sravanthi Kollukuduru,
	Rajesh Yadav, Chandan Uddaraju, Jeykumar Sankaran, Vara Reddy,
	Stephen Boyd, Guenter Roeck, Kuogee Hsieh, Archit Taneja,
	linux-arm-msm, dri-devel, freedreno, linux-kernel, Tanmay Shah,
	Konrad Dybcio

On Tue, Jul 28, 2026 at 03:20:47PM +0200, Konrad Dybcio wrote:
> From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> 
> 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. Drop the explicit call to it.
> 
> Every call site of ops->link_clk_disable() is followed by
> pm_runtime_put(), so the power vote will be rescinded if deemed safe.
> 
> Fixes: 32d3e0feccfe ("drm/msm: dsi: Use OPP API to set clk/perf state")
> Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> ---
>  drivers/gpu/drm/msm/dsi/dsi_host.c | 2 --
>  1 file changed, 2 deletions(-)
> 

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>


-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/3] drm/msm/dp: Drop dev_pm_opp_set_rate(0)
  2026-07-28 13:20 ` [PATCH 2/3] drm/msm/dp: Drop dev_pm_opp_set_rate(0) Konrad Dybcio
@ 2026-07-28 13:56   ` Dmitry Baryshkov
  0 siblings, 0 replies; 8+ messages in thread
From: Dmitry Baryshkov @ 2026-07-28 13:56 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
	Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
	Rajendra Nayak, Matthias Kaehlcke, Sravanthi Kollukuduru,
	Rajesh Yadav, Chandan Uddaraju, Jeykumar Sankaran, Vara Reddy,
	Stephen Boyd, Guenter Roeck, Kuogee Hsieh, Archit Taneja,
	linux-arm-msm, dri-devel, freedreno, linux-kernel, Tanmay Shah,
	Konrad Dybcio

On Tue, Jul 28, 2026 at 03:20:46PM +0200, Konrad Dybcio wrote:
> From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> 
> 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. Drop the explicit calls to it.
> 
> Fixes: c943b4948b58 ("drm/msm/dp: add displayPort driver support")
> Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> ---
>  drivers/gpu/drm/msm/dp/dp_ctrl.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>


-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3] drm/msm/dpu: Drop sneaky dev_pm_opp_set_rate(0)
  2026-07-28 13:20 ` [PATCH 1/3] drm/msm/dpu: Drop sneaky dev_pm_opp_set_rate(0) Konrad Dybcio
@ 2026-07-28 13:57   ` Dmitry Baryshkov
  2026-07-28 16:40     ` Konrad Dybcio
  0 siblings, 1 reply; 8+ messages in thread
From: Dmitry Baryshkov @ 2026-07-28 13:57 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
	Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
	Rajendra Nayak, Matthias Kaehlcke, Sravanthi Kollukuduru,
	Rajesh Yadav, Chandan Uddaraju, Jeykumar Sankaran, Vara Reddy,
	Stephen Boyd, Guenter Roeck, Kuogee Hsieh, Archit Taneja,
	linux-arm-msm, dri-devel, freedreno, linux-kernel, Tanmay Shah,
	Konrad Dybcio

On Tue, Jul 28, 2026 at 03:20:45PM +0200, Konrad Dybcio wrote:
> From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> 
> 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>
> ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
> index 2ff255d7795e..fea173e37464 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
> @@ -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;

Is 0 here an actual case? If it is coming from the core_perf, then the
next line will handle it.

> +
>  		clk_rate = min(clk_rate, kms->perf.max_core_clk_rate);
>  		ret = dev_pm_opp_set_rate(&kms->pdev->dev, clk_rate);
>  		if (ret) {
> 
> -- 
> 2.55.0
> 

-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3] drm/msm/dpu: Drop sneaky dev_pm_opp_set_rate(0)
  2026-07-28 13:57   ` Dmitry Baryshkov
@ 2026-07-28 16:40     ` Konrad Dybcio
  0 siblings, 0 replies; 8+ messages in thread
From: Konrad Dybcio @ 2026-07-28 16:40 UTC (permalink / raw)
  To: Dmitry Baryshkov, Konrad Dybcio
  Cc: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
	Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
	Rajendra Nayak, Matthias Kaehlcke, Sravanthi Kollukuduru,
	Rajesh Yadav, Chandan Uddaraju, Jeykumar Sankaran, Vara Reddy,
	Stephen Boyd, Guenter Roeck, Kuogee Hsieh, Archit Taneja,
	linux-arm-msm, dri-devel, freedreno, linux-kernel, Tanmay Shah

On 7/28/26 3:57 PM, Dmitry Baryshkov wrote:
> On Tue, Jul 28, 2026 at 03:20:45PM +0200, Konrad Dybcio wrote:
>> From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
>>
>> 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>
>> ---
>>  drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
>> index 2ff255d7795e..fea173e37464 100644
>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
>> @@ -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;
> 
> Is 0 here an actual case? If it is coming from the core_perf, then the
> next line will handle it.

Yes it is (upon suspend) and it will not be handled because it's a min()
and not a max() below

Konrad

> 
>> +
>>  		clk_rate = min(clk_rate, kms->perf.max_core_clk_rate);
>>  		ret = dev_pm_opp_set_rate(&kms->pdev->dev, clk_rate);
>>  		if (ret) {
>>
>> -- 
>> 2.55.0
>>
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-07-28 16:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-28 13:20 [PATCH 0/3] Remove brownout risks from DPU Konrad Dybcio
2026-07-28 13:20 ` [PATCH 1/3] drm/msm/dpu: Drop sneaky dev_pm_opp_set_rate(0) Konrad Dybcio
2026-07-28 13:57   ` Dmitry Baryshkov
2026-07-28 16:40     ` Konrad Dybcio
2026-07-28 13:20 ` [PATCH 2/3] drm/msm/dp: Drop dev_pm_opp_set_rate(0) Konrad Dybcio
2026-07-28 13:56   ` Dmitry Baryshkov
2026-07-28 13:20 ` [PATCH 3/3] drm/msm/dsi: " Konrad Dybcio
2026-07-28 13:55   ` Dmitry Baryshkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®