From: jaswinder.singh@linaro.org
To: tomi.valkeinen@ti.com, mythripk@ti.com
Cc: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org,
andy.green@linaro.org, n-dechesne@ti.com,
Jassi Brar <jaswinder.singh@linaro.org>
Subject: [PATCH] OMAPDSS: Check if RPM enabled before trying to change state
Date: Sat, 23 Jun 2012 08:18:11 +0000 [thread overview]
Message-ID: <1340438771-25587-1-git-send-email-jaswinder.singh@linaro.org> (raw)
From: Jassi Brar <jaswinder.singh@linaro.org>
If the runtime PM of the device is disabled (for example in resume from
suspend path), it doesn't make sense to attempt pm_runtime_get/put, esp
when their return values affect the control flow path.
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
---
Currenlty HDMI fails to come up in the suspend-resume path.
This patch helps that real-world scenario.
drivers/video/omap2/dss/dispc.c | 6 ++++++
drivers/video/omap2/dss/dsi.c | 6 ++++++
drivers/video/omap2/dss/dss.c | 6 ++++++
drivers/video/omap2/dss/hdmi.c | 6 ++++++
drivers/video/omap2/dss/rfbi.c | 6 ++++++
drivers/video/omap2/dss/venc.c | 6 ++++++
6 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 4749ac3..2c3266f 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -372,6 +372,9 @@ int dispc_runtime_get(void)
DSSDBG("dispc_runtime_get\n");
+ if (!pm_runtime_enabled(&dispc.pdev->dev))
+ return 0;
+
r = pm_runtime_get_sync(&dispc.pdev->dev);
WARN_ON(r < 0);
return r < 0 ? r : 0;
@@ -383,6 +386,9 @@ void dispc_runtime_put(void)
DSSDBG("dispc_runtime_put\n");
+ if (!pm_runtime_enabled(&dispc.pdev->dev))
+ return;
+
r = pm_runtime_put_sync(&dispc.pdev->dev);
WARN_ON(r < 0);
}
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index ca8382d..6db4cb1 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -1062,6 +1062,9 @@ int dsi_runtime_get(struct platform_device *dsidev)
DSSDBG("dsi_runtime_get\n");
+ if (!pm_runtime_enabled(&dsi->pdev->dev))
+ return 0;
+
r = pm_runtime_get_sync(&dsi->pdev->dev);
WARN_ON(r < 0);
return r < 0 ? r : 0;
@@ -1074,6 +1077,9 @@ void dsi_runtime_put(struct platform_device *dsidev)
DSSDBG("dsi_runtime_put\n");
+ if (!pm_runtime_enabled(&dsi->pdev->dev))
+ return;
+
r = pm_runtime_put_sync(&dsi->pdev->dev);
WARN_ON(r < 0);
}
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 7706323..5e52224 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -719,6 +719,9 @@ static int dss_runtime_get(void)
DSSDBG("dss_runtime_get\n");
+ if (!pm_runtime_enabled(&dss.pdev->dev))
+ return 0;
+
r = pm_runtime_get_sync(&dss.pdev->dev);
WARN_ON(r < 0);
return r < 0 ? r : 0;
@@ -730,6 +733,9 @@ static void dss_runtime_put(void)
DSSDBG("dss_runtime_put\n");
+ if (!pm_runtime_enabled(&dss.pdev->dev))
+ return;
+
r = pm_runtime_put_sync(&dss.pdev->dev);
WARN_ON(r < 0 && r != -EBUSY);
}
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index 0738090..900e621 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -123,6 +123,9 @@ static int hdmi_runtime_get(void)
DSSDBG("hdmi_runtime_get\n");
+ if (!pm_runtime_enabled(&hdmi.pdev->dev))
+ return 0;
+
r = pm_runtime_get_sync(&hdmi.pdev->dev);
WARN_ON(r < 0);
if (r < 0)
@@ -137,6 +140,9 @@ static void hdmi_runtime_put(void)
DSSDBG("hdmi_runtime_put\n");
+ if (!pm_runtime_enabled(&hdmi.pdev->dev))
+ return;
+
r = pm_runtime_put_sync(&hdmi.pdev->dev);
WARN_ON(r < 0);
}
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c
index 3d8c206..401384a 100644
--- a/drivers/video/omap2/dss/rfbi.c
+++ b/drivers/video/omap2/dss/rfbi.c
@@ -129,6 +129,9 @@ static int rfbi_runtime_get(void)
DSSDBG("rfbi_runtime_get\n");
+ if (!pm_runtime_enabled(&rfbi.pdev->dev))
+ return 0;
+
r = pm_runtime_get_sync(&rfbi.pdev->dev);
WARN_ON(r < 0);
return r < 0 ? r : 0;
@@ -140,6 +143,9 @@ static void rfbi_runtime_put(void)
DSSDBG("rfbi_runtime_put\n");
+ if (!pm_runtime_enabled(&rfbi.pdev->dev))
+ return;
+
r = pm_runtime_put_sync(&rfbi.pdev->dev);
WARN_ON(r < 0);
}
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
index 2b89739..edd8710 100644
--- a/drivers/video/omap2/dss/venc.c
+++ b/drivers/video/omap2/dss/venc.c
@@ -390,6 +390,9 @@ static int venc_runtime_get(void)
DSSDBG("venc_runtime_get\n");
+ if (!pm_runtime_enabled(&venc.pdev->dev))
+ return 0;
+
r = pm_runtime_get_sync(&venc.pdev->dev);
WARN_ON(r < 0);
return r < 0 ? r : 0;
@@ -401,6 +404,9 @@ static void venc_runtime_put(void)
DSSDBG("venc_runtime_put\n");
+ if (!pm_runtime_enabled(&venc.pdev->dev))
+ return;
+
r = pm_runtime_put_sync(&venc.pdev->dev);
WARN_ON(r < 0);
}
--
1.7.4.1
next reply other threads:[~2012-06-23 8:18 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-23 8:18 jaswinder.singh [this message]
2012-06-25 6:20 ` [PATCH] OMAPDSS: Check if RPM enabled before trying to change state Tomi Valkeinen
2012-06-25 8:53 ` Jassi Brar
2012-06-25 9:30 ` Tomi Valkeinen
2012-06-25 12:39 ` Jassi Brar
2012-06-25 12:41 ` Tomi Valkeinen
2012-06-25 13:43 ` Jassi Brar
2012-06-25 13:49 ` Tomi Valkeinen
2012-06-25 17:18 ` Jassi Brar
2012-06-26 7:19 ` Tomi Valkeinen
2012-06-26 8:44 ` Jassi Brar
2012-06-26 8:40 ` Andy Green
2012-06-26 9:07 ` Tomi Valkeinen
2012-06-26 10:09 ` Jassi Brar
2012-06-26 12:03 ` Tomi Valkeinen
2012-06-26 14:52 ` Jassi Brar
2012-06-26 15:08 ` Tomi Valkeinen
2012-06-26 15:21 ` Jassi Brar
2012-06-26 15:11 ` Tomi Valkeinen
2012-06-26 17:13 ` Jassi Brar
2012-06-26 18:44 ` Tomi Valkeinen
2012-06-27 4:54 ` Jassi Brar
2012-06-27 5:58 ` Tomi Valkeinen
2012-06-27 7:53 ` Jassi Brar
2012-06-27 8:13 ` Tomi Valkeinen
2012-06-27 14:56 ` Jassi Brar
2012-06-28 6:41 ` Tomi Valkeinen
2012-06-28 7:58 ` Jassi Brar
2012-06-28 7:58 ` Tomi Valkeinen
2012-06-25 12:05 ` Grazvydas Ignotas
2012-06-25 12:30 ` Tomi Valkeinen
2012-06-25 12:54 ` Rajendra Nayak
2012-06-25 12:50 ` Tomi Valkeinen
2012-06-26 4:55 ` Rajendra Nayak
2012-06-26 13:02 ` Grazvydas Ignotas
2012-06-26 14:34 ` Alan Stern
2012-06-26 15:01 ` Tomi Valkeinen
2012-06-26 15:11 ` Alan Stern
2012-06-25 12:45 ` Jassi Brar
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=1340438771-25587-1-git-send-email-jaswinder.singh@linaro.org \
--to=jaswinder.singh@linaro.org \
--cc=andy.green@linaro.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=mythripk@ti.com \
--cc=n-dechesne@ti.com \
--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).