summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/nvmap/nvmap.c
diff options
context:
space:
mode:
authorKirill Artamonov <kartamonov@nvidia.com>2011-02-18 14:58:41 +0200
committerDan Willemsen <dwillemsen@nvidia.com>2012-03-23 17:25:49 -0700
commitd6ffd4202e344b0c336145fc64779487988e39aa (patch)
tree58641a311b0710307132b5ba260e15ac30e00d47 /drivers/video/tegra/nvmap/nvmap.c
parentc7147458b99eccd2f976dd6e31104e2b2e864f1c (diff)
video: tegra: nvmap: fix potential deadlock
Enabled mutex debugging reavealed potential deadlocks introduced with compaction. Handle spin lock replaced with mutex. Heap functions cannot be protected with spinlock because they call kernel slab allocation functions which cannot be called from atomic context. nvmap_client ref_lock is also replaced with mutex. Otherwise we cannot access heap parameters protected by mutex nvmap_handle lock. Extra locking for handle->owner removed. bug 793364 Original-Change-Id: I635ce9ebf259dd7bf8802457567f93b7be5795ea Reviewed-on: http://git-master/r/19850 Reviewed-by: Kirill Artamonov <kartamonov@nvidia.com> Tested-by: Kirill Artamonov <kartamonov@nvidia.com> Reviewed-by: Daniel Willemsen <dwillemsen@nvidia.com> Rebase-Id: Reaa132703e278d75371d5e2b25426794aa8e0e4e
Diffstat (limited to 'drivers/video/tegra/nvmap/nvmap.c')
-rw-r--r--drivers/video/tegra/nvmap/nvmap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/video/tegra/nvmap/nvmap.c b/drivers/video/tegra/nvmap/nvmap.c
index f12eb0c02bf9..ecc3b49bf60e 100644
--- a/drivers/video/tegra/nvmap/nvmap.c
+++ b/drivers/video/tegra/nvmap/nvmap.c
@@ -578,9 +578,9 @@ unsigned long nvmap_handle_address(struct nvmap_client *c, unsigned long id)
h = nvmap_get_handle_id(c, id);
if (!h)
return -EPERM;
- spin_lock(&h->lock);
+ mutex_lock(&h->lock);
phys = handle_phys(h);
- spin_unlock(&h->lock);
+ mutex_unlock(&h->lock);
nvmap_handle_put(h);
return phys;