diff options
author | Mayuresh Kulkarni <mkulkarni@nvidia.com> | 2012-03-27 17:46:07 +0530 |
---|---|---|
committer | Simone Willett <swillett@nvidia.com> | 2012-04-03 17:51:57 -0700 |
commit | 0081e1a9946ad6d98feabfab4fcba8e657248606 (patch) | |
tree | 3ed052251d67037d23fd5aee5b5201d16a21c41d /drivers/video | |
parent | 938f317d012e2ce25f86c046c620f269aec1410a (diff) |
video: tegra: host: api clean-up
- remove redundant 2nd argument to nvhost_module_suspend()
- also remove the debug_not_idle() as it redundant after
refactor of host1x code
- debug_not_idle() iterates through host1x's private instance
of channels to find out which client module is active (along
with host1x itself). we are going to remove these instances of
channels from host1x's device private data
- reduce the prints during suspend
Bug 871237
Change-Id: I66c7c4d8f35c157b1626784a6a27166442a50557
Signed-off-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
Reviewed-on: http://git-master/r/92550
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/tegra/host/bus_client.c | 2 | ||||
-rw-r--r-- | drivers/video/tegra/host/dev.c | 3 | ||||
-rw-r--r-- | drivers/video/tegra/host/nvhost_acm.c | 39 | ||||
-rw-r--r-- | drivers/video/tegra/host/nvhost_acm.h | 2 | ||||
-rw-r--r-- | drivers/video/tegra/host/nvhost_channel.c | 4 |
5 files changed, 6 insertions, 44 deletions
diff --git a/drivers/video/tegra/host/bus_client.c b/drivers/video/tegra/host/bus_client.c index 940f04a40e89..ebf48f15622f 100644 --- a/drivers/video/tegra/host/bus_client.c +++ b/drivers/video/tegra/host/bus_client.c @@ -594,8 +594,6 @@ int nvhost_client_device_suspend(struct nvhost_device *dev) { int ret = 0; - dev_info(&dev->dev, "suspending\n"); - ret = nvhost_channel_suspend(dev->channel); if (ret) return ret; diff --git a/drivers/video/tegra/host/dev.c b/drivers/video/tegra/host/dev.c index 8f0c0393401b..0425368e6f81 100644 --- a/drivers/video/tegra/host/dev.c +++ b/drivers/video/tegra/host/dev.c @@ -583,8 +583,7 @@ static int nvhost_suspend(struct nvhost_device *dev, pm_message_t state) struct nvhost_master *host = nvhost_get_drvdata(dev); int ret = 0; - dev_info(&dev->dev, "suspending\n"); - ret = nvhost_module_suspend(host->dev, true); + ret = nvhost_module_suspend(host->dev); dev_info(&dev->dev, "suspend status: %d\n", ret); return ret; diff --git a/drivers/video/tegra/host/nvhost_acm.c b/drivers/video/tegra/host/nvhost_acm.c index 318f209651ac..f2a61a9547a0 100644 --- a/drivers/video/tegra/host/nvhost_acm.c +++ b/drivers/video/tegra/host/nvhost_acm.c @@ -394,41 +394,9 @@ static int is_module_idle(struct nvhost_device *dev) return (count == 0); } -static void debug_not_idle(struct nvhost_master *host) -{ - int i; - bool lock_released = true; - - for (i = 0; i < host->nb_channels; i++) { - struct nvhost_device *dev = host->channels[i].dev; - mutex_lock(&dev->lock); - if (dev->name) - dev_warn(&host->dev->dev, - "tegra_grhost: %s: refcnt %d\n", dev->name, - dev->refcount); - mutex_unlock(&dev->lock); - } - - for (i = 0; i < host->syncpt.nb_mlocks; i++) { - int c = atomic_read(&host->syncpt.lock_counts[i]); - if (c) { - dev_warn(&host->dev->dev, - "tegra_grhost: lock id %d: refcnt %d\n", - i, c); - lock_released = false; - } - } - if (lock_released) - dev_dbg(&host->dev->dev, "tegra_grhost: all locks released\n"); -} - -int nvhost_module_suspend(struct nvhost_device *dev, bool system_suspend) +int nvhost_module_suspend(struct nvhost_device *dev) { int ret; - struct nvhost_master *host = nvhost_get_host(dev); - - if (system_suspend && !is_module_idle(dev)) - debug_not_idle(host); ret = wait_event_timeout(dev->idle_wq, is_module_idle(dev), ACM_SUSPEND_WAIT_FOR_IDLE_TIMEOUT); @@ -438,9 +406,6 @@ int nvhost_module_suspend(struct nvhost_device *dev, bool system_suspend) return -EBUSY; } - if (system_suspend) - dev_dbg(&dev->dev, "tegra_grhost: entered idle\n"); - mutex_lock(&dev->lock); cancel_delayed_work(&dev->powerstate_down); to_state_powergated_locked(dev); @@ -459,7 +424,7 @@ void nvhost_module_deinit(struct nvhost_device *dev) if (dev->deinit) dev->deinit(dev); - nvhost_module_suspend(dev, false); + nvhost_module_suspend(dev); for (i = 0; i < dev->num_clks; i++) clk_put(dev->clk[i]); dev->powerstate = NVHOST_POWER_STATE_DEINIT; diff --git a/drivers/video/tegra/host/nvhost_acm.h b/drivers/video/tegra/host/nvhost_acm.h index a12c0c3fa324..d2562e9a369f 100644 --- a/drivers/video/tegra/host/nvhost_acm.h +++ b/drivers/video/tegra/host/nvhost_acm.h @@ -30,7 +30,7 @@ /* Sets clocks and powergating state for a module */ int nvhost_module_init(struct nvhost_device *ndev); void nvhost_module_deinit(struct nvhost_device *dev); -int nvhost_module_suspend(struct nvhost_device *dev, bool system_suspend); +int nvhost_module_suspend(struct nvhost_device *dev); void nvhost_module_reset(struct nvhost_device *dev); void nvhost_module_busy(struct nvhost_device *dev); diff --git a/drivers/video/tegra/host/nvhost_channel.c b/drivers/video/tegra/host/nvhost_channel.c index a7c033081341..a5a4bd42e368 100644 --- a/drivers/video/tegra/host/nvhost_channel.c +++ b/drivers/video/tegra/host/nvhost_channel.c @@ -134,7 +134,7 @@ void nvhost_putchannel(struct nvhost_channel *ch, struct nvhost_hwctx *ctx) if (ch->refcount == 1) { channel_cdma_op(ch).stop(&ch->cdma); nvhost_cdma_deinit(&ch->cdma); - nvhost_module_suspend(ch->dev, false); + nvhost_module_suspend(ch->dev); } ch->refcount--; mutex_unlock(&ch->reflock); @@ -148,7 +148,7 @@ int nvhost_channel_suspend(struct nvhost_channel *ch) BUG_ON(!channel_cdma_op(ch).stop); if (ch->refcount) { - ret = nvhost_module_suspend(ch->dev, false); + ret = nvhost_module_suspend(ch->dev); if (!ret) channel_cdma_op(ch).stop(&ch->cdma); } |