video: tegra: host: Init actmon with host1x on
Terje Bergstrom [Mon, 17 Dec 2012 14:02:11 +0000 (16:02 +0200)]
Turn on host1x when initializing actmon. Also do not suspend host1x
before deinitializing actmon.

Bug 1195805

Change-Id: I1656634734da91400d8805dbe49fb5e7da3513d1
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/172723
Reviewed-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>

drivers/video/tegra/host/host1x/host1x_actmon.c
drivers/video/tegra/host/nvhost_channel.c

index fbec131..a0f768d 100644 (file)
@@ -98,6 +98,8 @@ static int host1x_actmon_init(struct nvhost_master *host)
        if (actmon_status.init == ACTMON_READY)
                return 0;
 
+       nvhost_module_busy(host->dev);
+
        if (actmon_status.init == ACTMON_OFF) {
                actmon_status.usecs_per_sample = 160;
                actmon_status.above_wmark = 0;
@@ -135,6 +137,7 @@ static int host1x_actmon_init(struct nvhost_master *host)
        writel(val, sync_regs + host1x_sync_actmon_ctrl_r());
 
        actmon_status.init = ACTMON_READY;
+       nvhost_module_idle(host->dev);
        return 0;
 }
 
@@ -146,6 +149,8 @@ static void host1x_actmon_deinit(struct nvhost_master *host)
        if (actmon_status.init != ACTMON_READY)
                return;
 
+       nvhost_module_busy(host->dev);
+
        /* Disable actmon */
        val = readl(sync_regs + host1x_sync_actmon_ctrl_r());
        val &= ~host1x_sync_actmon_ctrl_enb_m();
@@ -163,6 +168,7 @@ static void host1x_actmon_deinit(struct nvhost_master *host)
        writel(0xffffffff, sync_regs + host1x_sync_actmon_intr_status_r());
 
        actmon_status.init = ACTMON_SLEEP;
+       nvhost_module_idle(host->dev);
 }
 
 static int host1x_actmon_avg(struct nvhost_master *host, u32 *val)
index 62515f1..a4c1b29 100644 (file)
@@ -121,8 +121,6 @@ void nvhost_putchannel(struct nvhost_channel *ch, struct nvhost_hwctx *ctx)
        if (ch->refcount == 1) {
                channel_cdma_op().stop(&ch->cdma);
                nvhost_cdma_deinit(&ch->cdma);
-               nvhost_module_suspend(ch->dev);
-
                if (pdata->deinit)
                        pdata->deinit(ch->dev);
        }