diff options
author | Kirill Artamonov <kartamonov@nvidia.com> | 2011-02-15 01:07:20 +0200 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:44:52 -0800 |
commit | 040f2be385a9f8049c26835d823f15727a5a257a (patch) | |
tree | 9ea06fdc020406d1f93569f04665e2710f6c4df0 /drivers/video/tegra/nvmap/nvmap_handle.c | |
parent | 4e01c4c6f3399b59ae263b434c43e5c366cf1d35 (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_handle.c')
-rw-r--r-- | drivers/video/tegra/nvmap/nvmap_handle.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/video/tegra/nvmap/nvmap_handle.c b/drivers/video/tegra/nvmap/nvmap_handle.c index f01149dfabe4..c8a2c1fc9c79 100644 --- a/drivers/video/tegra/nvmap/nvmap_handle.c +++ b/drivers/video/tegra/nvmap/nvmap_handle.c @@ -371,11 +371,11 @@ void nvmap_free_handle_id(struct nvmap_client *client, unsigned long id) atomic_sub(h->size, &client->iovm_commit); if (h->alloc && !h->heap_pgalloc) { - mutex_lock(&h->lock); + spin_lock(&h->lock); nvmap_carveout_commit_subtract(client, nvmap_heap_to_arg(nvmap_block_to_heap(h->carveout)), h->size); - mutex_unlock(&h->lock); + spin_unlock(&h->lock); } nvmap_ref_unlock(client); @@ -387,10 +387,10 @@ void nvmap_free_handle_id(struct nvmap_client *client, unsigned long id) while (pins--) nvmap_unpin_handles(client, &ref->handle, 1); - mutex_lock(&h->lock); + spin_lock(&h->lock); if (h->owner == client) h->owner = NULL; - mutex_unlock(&h->lock); + spin_unlock(&h->lock); kfree(ref); @@ -446,7 +446,7 @@ struct nvmap_handle_ref *nvmap_create_handle(struct nvmap_client *client, BUG_ON(!h->owner); h->size = h->orig_size = size; h->flags = NVMAP_HANDLE_WRITE_COMBINE; - mutex_init(&h->lock); + spin_lock_init(&h->lock); nvmap_handle_add(client->dev, h); @@ -516,11 +516,11 @@ struct nvmap_handle_ref *nvmap_duplicate_handle_id(struct nvmap_client *client, } if (!h->heap_pgalloc) { - mutex_lock(&h->lock); + spin_lock(&h->lock); nvmap_carveout_commit_add(client, nvmap_heap_to_arg(nvmap_block_to_heap(h->carveout)), h->size); - mutex_unlock(&h->lock); + spin_unlock(&h->lock); } atomic_set(&ref->dupes, 1); |