summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/host/nvhost_acm.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2011-12-12 13:04:54 +0200
committerVarun Wadekar <vwadekar@nvidia.com>2011-12-15 12:09:05 +0530
commitae4284831e1535446766970dd0fc5a6ae02a3b16 (patch)
tree79642b13c16f059549bd86d7a9e0b0cbbcf7e6cf /drivers/video/tegra/host/nvhost_acm.c
parenta71055465ab8313f2a056603c0bf66110bb183d7 (diff)
video: tegra: host: Prevent suspend if module is busy
MPE is kept artificially busy if a channel is open. This is done to prevent power management during an encoding process. This patch prevents system suspend if any module is busy. Bug 911477 Change-Id: I943a7e29e473ac33e680281fcdce74618567facb Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/69457 Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com> Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Diffstat (limited to 'drivers/video/tegra/host/nvhost_acm.c')
-rw-r--r--drivers/video/tegra/host/nvhost_acm.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/video/tegra/host/nvhost_acm.c b/drivers/video/tegra/host/nvhost_acm.c
index 6ea1466f63ce..3d63dd62e2fa 100644
--- a/drivers/video/tegra/host/nvhost_acm.c
+++ b/drivers/video/tegra/host/nvhost_acm.c
@@ -450,7 +450,7 @@ static void debug_not_idle(struct nvhost_master *dev)
dev_dbg(&dev->pdev->dev, "tegra_grhost: all locks released\n");
}
-void nvhost_module_suspend(struct nvhost_module *mod, bool system_suspend)
+int nvhost_module_suspend(struct nvhost_module *mod, bool system_suspend)
{
int ret;
struct nvhost_master *dev;
@@ -465,8 +465,10 @@ void nvhost_module_suspend(struct nvhost_module *mod, bool system_suspend)
ret = wait_event_timeout(mod->idle, is_module_idle(mod),
ACM_SUSPEND_WAIT_FOR_IDLE_TIMEOUT);
- if (ret == 0)
- nvhost_debug_dump(dev);
+ if (ret == 0) {
+ dev_info(&dev->pdev->dev, "%s prevented suspend\n", mod->name);
+ return -EBUSY;
+ }
if (system_suspend)
dev_dbg(&dev->pdev->dev, "tegra_grhost: entered idle\n");
@@ -479,7 +481,7 @@ void nvhost_module_suspend(struct nvhost_module *mod, bool system_suspend)
if (mod->desc->suspend)
mod->desc->suspend(mod);
- BUG_ON(nvhost_module_powered(mod));
+ return 0;
}
void nvhost_module_deinit(struct device *dev, struct nvhost_module *mod)