summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/nvmap/nvmap_heap.c
diff options
context:
space:
mode:
authorKirill Artamonov <kartamonov@nvidia.com>2011-02-15 01:07:20 +0200
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:44:52 -0800
commit040f2be385a9f8049c26835d823f15727a5a257a (patch)
tree9ea06fdc020406d1f93569f04665e2710f6c4df0 /drivers/video/tegra/nvmap/nvmap_heap.c
parent4e01c4c6f3399b59ae263b434c43e5c366cf1d35 (diff)
video: tegra: nvmap: replace mutex with spinlock
There are places where nvmap_free_handle_id is called when interrupts are disabled and mutex cannot be used as nvmap handle lock. Original-Change-Id: Icc220fe627c08f21c677d936a54f70c818dc8e8c Reviewed-on: http://git-master/r/19489 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: Rb5a58e8226ad14340d1acae007d6b632960fae16
Diffstat (limited to 'drivers/video/tegra/nvmap/nvmap_heap.c')
-rw-r--r--drivers/video/tegra/nvmap/nvmap_heap.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/video/tegra/nvmap/nvmap_heap.c b/drivers/video/tegra/nvmap/nvmap_heap.c
index c8355684f1f9..0d7e1cd31bb8 100644
--- a/drivers/video/tegra/nvmap/nvmap_heap.c
+++ b/drivers/video/tegra/nvmap/nvmap_heap.c
@@ -702,10 +702,10 @@ static struct nvmap_heap_block *do_heap_relocate_listblock(
return NULL;
}
- mutex_lock(&handle->lock);
+ spin_lock(&handle->lock);
if (!handle->owner) {
- mutex_unlock(&handle->lock);
+ spin_unlock(&handle->lock);
return NULL;
}
@@ -756,7 +756,7 @@ static struct nvmap_heap_block *do_heap_relocate_listblock(
fail:
mutex_unlock(&handle->owner->share->pin_lock);
- mutex_unlock(&handle->lock);
+ spin_unlock(&handle->lock);
return heap_block_new;
}
@@ -829,9 +829,9 @@ static void nvmap_heap_compact(struct nvmap_heap *heap,
void nvmap_usecount_inc(struct nvmap_handle *h)
{
if (h->alloc && !h->heap_pgalloc) {
- mutex_lock(&h->lock);
+ spin_lock(&h->lock);
h->usecount++;
- mutex_unlock(&h->lock);
+ spin_unlock(&h->lock);
} else {
h->usecount++;
}