linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/rockchip: vop: Add timeout for DSP hold
@ 2021-10-08 22:31 Brian Norris
  2021-10-17 21:52 ` Heiko Stuebner
  0 siblings, 1 reply; 2+ messages in thread
From: Brian Norris @ 2021-10-08 22:31 UTC (permalink / raw)
  To: Heiko Stübner
  Cc: linux-rockchip, Sandy Huang, dri-devel, linux-kernel, Brian Norris

If hardware is malfunctioning (e.g., misconfigured clocks?), we can get
stuck here forever, holding various DRM locks and eventually locking up
the entire system. It's better to complain loudly and move on, than to
lock up the system.

In local tests, this operation takes less than 20ms.

Signed-off-by: Brian Norris <briannorris@chromium.org>
---

 drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
index ba9e14da41b4..b28ea5d6a3e2 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -726,7 +726,9 @@ static void vop_crtc_atomic_disable(struct drm_crtc *crtc,
 
 	spin_unlock(&vop->reg_lock);
 
-	wait_for_completion(&vop->dsp_hold_completion);
+	if (!wait_for_completion_timeout(&vop->dsp_hold_completion,
+					 msecs_to_jiffies(200)))
+		WARN(1, "%s: timed out waiting for DSP hold", crtc->name);
 
 	vop_dsp_hold_valid_irq_disable(vop);
 
-- 
2.33.0.882.g93a45727a2-goog


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

* Re: [PATCH] drm/rockchip: vop: Add timeout for DSP hold
  2021-10-08 22:31 [PATCH] drm/rockchip: vop: Add timeout for DSP hold Brian Norris
@ 2021-10-17 21:52 ` Heiko Stuebner
  0 siblings, 0 replies; 2+ messages in thread
From: Heiko Stuebner @ 2021-10-17 21:52 UTC (permalink / raw)
  To: Brian Norris
  Cc: Heiko Stuebner, dri-devel, linux-rockchip, Sandy Huang, linux-kernel

On Fri, 8 Oct 2021 15:31:04 -0700, Brian Norris wrote:
> If hardware is malfunctioning (e.g., misconfigured clocks?), we can get
> stuck here forever, holding various DRM locks and eventually locking up
> the entire system. It's better to complain loudly and move on, than to
> lock up the system.
> 
> In local tests, this operation takes less than 20ms.

Applied, thanks!

[1/1] drm/rockchip: vop: Add timeout for DSP hold
      commit: 085af7d28897deb08a4f64a29e55525f963cc041

Best regards,
-- 
Heiko Stuebner <heiko@sntech.de>

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

end of thread, other threads:[~2021-10-17 21:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-08 22:31 [PATCH] drm/rockchip: vop: Add timeout for DSP hold Brian Norris
2021-10-17 21:52 ` Heiko Stuebner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).