diff options
author | Erik Gilling <konkers@android.com> | 2011-02-14 18:07:02 -0800 |
---|---|---|
committer | Erik Gilling <konkers@android.com> | 2011-02-14 18:07:02 -0800 |
commit | 21cc82b575b16307184369646e98afc1116f6db9 (patch) | |
tree | da8ae2d7d75131778e912e4596c881f22212dfb8 /drivers | |
parent | 852af15d6955402087821b2947f3a542ac836dda (diff) | |
parent | 7ee1f8c222d7a2ccb319050345b3181e0c80e9bf (diff) |
Merge branch 'linux-tegra' into android-tegra
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/tegra/host/nvhost_cdma.c | 16 | ||||
-rw-r--r-- | drivers/video/tegra/host/nvhost_channel.c | 3 |
2 files changed, 9 insertions, 10 deletions
diff --git a/drivers/video/tegra/host/nvhost_cdma.c b/drivers/video/tegra/host/nvhost_cdma.c index f27656bac07b..d2a91d117b52 100644 --- a/drivers/video/tegra/host/nvhost_cdma.c +++ b/drivers/video/tegra/host/nvhost_cdma.c @@ -522,16 +522,14 @@ void nvhost_cdma_stop(struct nvhost_cdma *cdma) { void __iomem *chan_regs = cdma_to_channel(cdma)->aperture; - if (!cdma->running) - return; - mutex_lock(&cdma->lock); - wait_cdma(cdma, CDMA_EVENT_SYNC_QUEUE_EMPTY); + if (cdma->running) { + wait_cdma(cdma, CDMA_EVENT_SYNC_QUEUE_EMPTY); + writel(nvhost_channel_dmactrl(true, false, false), + chan_regs + HOST1X_CHANNEL_DMACTRL); + cdma->running = false; + } mutex_unlock(&cdma->lock); - writel(nvhost_channel_dmactrl(true, false, false), - chan_regs + HOST1X_CHANNEL_DMACTRL); - - cdma->running = false; } /** @@ -539,9 +537,9 @@ void nvhost_cdma_stop(struct nvhost_cdma *cdma) */ void nvhost_cdma_begin(struct nvhost_cdma *cdma) { + mutex_lock(&cdma->lock); if (!cdma->running) start_cdma(cdma); - mutex_lock(&cdma->lock); cdma->slots_free = 0; cdma->slots_used = 0; } diff --git a/drivers/video/tegra/host/nvhost_channel.c b/drivers/video/tegra/host/nvhost_channel.c index 40b67181c33d..3a6998909ed5 100644 --- a/drivers/video/tegra/host/nvhost_channel.c +++ b/drivers/video/tegra/host/nvhost_channel.c @@ -163,7 +163,8 @@ void nvhost_channel_suspend(struct nvhost_channel *ch) { mutex_lock(&ch->reflock); BUG_ON(nvhost_module_powered(&ch->mod)); - nvhost_cdma_stop(&ch->cdma); + if (ch->refcount) + nvhost_cdma_stop(&ch->cdma); mutex_unlock(&ch->reflock); } |