video: tegra: nvmap: fix potential deadlock
authorKirill Artamonov <kartamonov@nvidia.com>
Fri, 18 Feb 2011 12:58:41 +0000 (14:58 +0200)
committerDan Willemsen <dwillemsen@nvidia.com>
Thu, 1 Dec 2011 05:44:53 +0000 (21:44 -0800)
commite213542a2f06930c44ddc41ddcbc2035436a3973
tree26640cdad04168e5a35df519e19295df23556b70
parent6083867a56f3b4f535fdd49366eae848a6537446
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
drivers/video/tegra/nvmap/nvmap.c
drivers/video/tegra/nvmap/nvmap.h
drivers/video/tegra/nvmap/nvmap_dev.c
drivers/video/tegra/nvmap/nvmap_handle.c
drivers/video/tegra/nvmap/nvmap_heap.c
drivers/video/tegra/nvmap/nvmap_ioctl.c