diff options
author | Kirill Artamonov <kartamonov@nvidia.com> | 2011-02-18 14:58:41 +0200 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2011-02-18 18:47:21 -0800 |
commit | 3ac244af4e6600be75f7431baf3418287142e4e1 (patch) | |
tree | a8586a60107ca54a0414cdfc30704bccfc78577d /drivers/video/tegra/nvmap/nvmap.c | |
parent | 140b49082fd7d937d8a74b4dccc091c941dacb07 (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
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>
Diffstat (limited to 'drivers/video/tegra/nvmap/nvmap.c')
-rw-r--r-- | drivers/video/tegra/nvmap/nvmap.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/video/tegra/nvmap/nvmap.c b/drivers/video/tegra/nvmap/nvmap.c index 46d3386059b6..00b9a5adb49f 100644 --- a/drivers/video/tegra/nvmap/nvmap.c +++ b/drivers/video/tegra/nvmap/nvmap.c @@ -579,9 +579,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; |