video: tegra: host: api clean-up
Mayuresh Kulkarni [Tue, 27 Mar 2012 12:16:07 +0000 (17:16 +0530)]
- 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>

drivers/video/tegra/host/bus_client.c
drivers/video/tegra/host/dev.c
drivers/video/tegra/host/nvhost_acm.c
drivers/video/tegra/host/nvhost_acm.h
drivers/video/tegra/host/nvhost_channel.c

index 940f04a..ebf48f1 100644 (file)
@@ -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;
index 8f0c039..0425368 100644 (file)
@@ -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;
index 318f209..f2a61a9 100644 (file)
@@ -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;
index a12c0c3..d2562e9 100644 (file)
@@ -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);
index a7c0330..a5a4bd4 100644 (file)
@@ -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);
        }