Skip to contentSkip to conversation

drm/fsl-dcu: avoid disabling pixel clock twice on suspend

PATCH Superseded Stefan Agner 2 participants 4 messages Nov 10, 2017

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Stefan Agner

author maintainer
#0 lore raw

PATCH 1/2 drm/fsl-dcu: avoid disabling pixel clock twice on suspend

With commit 0a70c998d0c5 ("drm/fsl-dcu: enable pixel clock when enabling CRTC") the pixel clock is controlled by the CRTC code. Disabling the pixel clock in suspend leads to a warning due to the second clk_disable_unprepare call:

  WARNING: CPU: 0 PID: 359 at drivers/clk/clk.c:594 clk_core_disable+0x8c/0x90

Remove clk_disable_unprepare call for pixel clock to avoid unbalanced clock disable on suspend.

Fixes 0a70c998d0c5 ("drm/fsl-dcu: enable pixel clock when enabling CRTC")
---
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +0 -1
index 1a9ee657bbac..24f234902646 100644
@@ -202,7 +202,6 @@ static int fsl_dcu_drm_pm_suspend(struct device *dev)
 		return ret;
 	}
 
-	clk_disable_unprepare(fsl_dev->pix_clk);
 	clk_disable_unprepare(fsl_dev->clk);
 
 	return 0;
Signature · 6 lines
2.14.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author maintainer
#1 lore raw

PATCH 2/2 drm/fsl-dcu: enable IRQ before drm_atomic_helper_resume()

The resume helpers wait for a vblank to occurre hence IRQ need to be enabled. This avoids a warning as follows during resume:

  WARNING: CPU: 0 PID: 314 at drivers/gpu/drm/drm_atomic_helper.c:1249 drm_atomic_helper_wait_for_vblanks.part.1+0x284/0x288
  [CRTC:28:crtc-0] vblank wait timed out
---
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +1 -2
index 24f234902646..aeeaf0bcf646 100644
@@ -225,9 +225,8 @@ static int fsl_dcu_drm_pm_resume(struct device *dev)
 		fsl_tcon_bypass_enable(fsl_dev->tcon);
 	fsl_dcu_drm_init_planes(fsl_dev->drm);
 
-	drm_mode_config_helper_resume(fsl_dev->drm);
-
 	enable_irq(fsl_dev->irq);
+	drm_mode_config_helper_resume(fsl_dev->drm);
 
 	return 0;
 }
Signature · 6 lines
2.14.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by on v1 1/2
#3 lore raw
In reply to Stefan Agner

Den 10.11.2017 17.25, skrev Stefan Agner:

Quoted 20 lines

With commit 0a70c998d0c5 ("drm/fsl-dcu: enable pixel clock when enabling CRTC") the pixel clock is controlled by the CRTC code. Disabling the pixel clock in suspend leads to a warning due to the second clk_disable_unprepare call:

   WARNING: CPU: 0 PID: 359 at drivers/clk/clk.c:594 clk_core_disable+0x8c/0x90

Remove clk_disable_unprepare call for pixel clock to avoid unbalanced clock disable on suspend.

Fixes 0a70c998d0c5 ("drm/fsl-dcu: enable pixel clock when enabling CRTC")
---
  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 1 -
  1 file changed, 1 deletion(-)
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +0 -0
index 1a9ee657bbac..24f234902646 100644

drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c static int fsl_dcu_drm_pm_suspend(struct device *dev) · line 207

Quoted 7 lines
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +0 -1
@@ -202,7 +202,6 @@ static int fsl_dcu_drm_pm_suspend(struct device *dev)
  		return ret;
  	}
 
-	clk_disable_unprepare(fsl_dev->pix_clk);
  	clk_disable_unprepare(fsl_dev->clk);
 
  	return 0;

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Acked-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] drm/fsl-dcu: enable IRQ before drm_atomic_helper_resume()

In reply to Stefan Agner

Den 10.11.2017 17.25, skrev Stefan Agner:

Quoted 15 lines

The resume helpers wait for a vblank to occurre hence IRQ need to be enabled. This avoids a warning as follows during resume:

   WARNING: CPU: 0 PID: 314 at drivers/gpu/drm/drm_atomic_helper.c:1249 drm_atomic_helper_wait_for_vblanks.part.1+0x284/0x288
   [CRTC:28:crtc-0] vblank wait timed out
---
  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +0 -0
index 24f234902646..aeeaf0bcf646 100644

drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c static int fsl_dcu_drm_pm_resume(struct device *dev) · line 232

Quoted 10 lines
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +1 -2
@@ -225,9 +225,8 @@ static int fsl_dcu_drm_pm_resume(struct device *dev)
  		fsl_tcon_bypass_enable(fsl_dev->tcon);
  	fsl_dcu_drm_init_planes(fsl_dev->drm);
 
-	drm_mode_config_helper_resume(fsl_dev->drm);
-
  	enable_irq(fsl_dev->irq);
+	drm_mode_config_helper_resume(fsl_dev->drm);
 
  	return 0;
  }

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel