linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Archit Taneja <archit@ti.com>
To: tomi.valkeinen@ti.com
Cc: lajos@ti.com, linux-omap@vger.kernel.org, Archit Taneja <archit@ti.com>
Subject: [PATCH 3/3] OMAPDSS: DSS: Add runtime_pm protection around wait_for_vsync.
Date: Tue, 21 Feb 2012 19:36:32 +0530	[thread overview]
Message-ID: <1329833192-16529-4-git-send-email-archit@ti.com> (raw)
In-Reply-To: <1329833192-16529-1-git-send-email-archit@ti.com>

From: Lajos Molnar <lajos@ti.com>

If DSS is suspended during a wait_for_vsync operation, it may loose its clock.
Request runtime_pm around wait_for_vsync.

Signed-off-by: Lajos Molnar <lajos@ti.com>
Signed-off-by: Archit Taneja <archit@ti.com>
---
 drivers/video/omap2/dss/dispc.c |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index df6259e..dd08356 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -3228,11 +3228,15 @@ int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask,
 	int r;
 	DECLARE_COMPLETION_ONSTACK(completion);
 
+	r = dispc_runtime_get();
+	if (r)
+		return r;
+
 	r = omap_dispc_register_isr(dispc_irq_wait_handler, &completion,
 			irqmask);
 
 	if (r)
-		return r;
+		goto done;
 
 	timeout = wait_for_completion_interruptible_timeout(&completion,
 			timeout);
@@ -3240,12 +3244,14 @@ int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask,
 	omap_dispc_unregister_isr(dispc_irq_wait_handler, &completion, irqmask);
 
 	if (timeout == 0)
-		return -ETIMEDOUT;
+		r = -ETIMEDOUT;
+	else if (timeout == -ERESTARTSYS)
+		r = timeout;
 
-	if (timeout == -ERESTARTSYS)
-		return -ERESTARTSYS;
+done:
+	dispc_runtime_put();
 
-	return 0;
+	return r;
 }
 
 #ifdef CONFIG_OMAP2_DSS_FAKE_VSYNC
-- 
1.7.5.4


  parent reply	other threads:[~2012-02-21 14:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-21 14:06 [PATCH 0/3] OMAPDSS: Miscellaneous DISPC Fixes Archit Taneja
2012-02-21 14:06 ` [PATCH 1/3] OMAPDSS: DISPC: Fix OMAP4 supported color formats Archit Taneja
2012-02-21 14:06 ` [PATCH 2/3] OMAPDSS: DISPC: Fix FIR coefficients Archit Taneja
2012-02-21 14:06 ` Archit Taneja [this message]
2012-02-21 16:08   ` [PATCH 3/3] OMAPDSS: DSS: Add runtime_pm protection around wait_for_vsync Tomi Valkeinen
2012-02-22  5:45     ` Archit Taneja
2012-02-22  6:49       ` Tomi Valkeinen
2012-02-22  9:46         ` Archit Taneja
2012-02-22  8:29 ` [PATCH 0/3] OMAPDSS: Miscellaneous DISPC Fixes Tomi Valkeinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1329833192-16529-4-git-send-email-archit@ti.com \
    --to=archit@ti.com \
    --cc=lajos@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=tomi.valkeinen@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).