summaryrefslogtreecommitdiff
path: root/arch/arm/plat-omap/dmm_user.c
diff options
context:
space:
mode:
authorHari Kanigeri <h-kanigeri2@ti.com>2010-10-04 11:06:59 -0500
committerRicardo Perez Olivares <x0081762@ti.com>2010-10-06 12:39:54 -0500
commit9152c0999526b6df55df3b7d6a11583dd24c3281 (patch)
treef6178caca3f3477e26282db346b8372ec962ebc9 /arch/arm/plat-omap/dmm_user.c
parentf6317a75f3841ece523c9a5a300314f6f5a111ee (diff)
omap:iommu-event notification shouldn't be blocking call
iommu_notify_event function is called from interrupt context, and this function is using internally blocking_notifier_call_chain call that could sleep. The fix is changing blocking_notifier to raw_notifier and let the callers of the iommu_notify_event handle the protection. iommu_notify_event is used for 2 purposes. One is for MMU FAULT notification to the device handler where the devh sets the error state to Fault and prevents the broadcasting of any iommu close notifications. This shouldn't be blocking. Second, it is used to broadcast the notifications of the Process ID that closed the iommu handle to remote processor. This could be blocking. Reported by Hari Nagalla Signed-off-by: Hari Kanigeri <h-kanigeri2@ti.com> Signed-off-by: Hari Nagalla <hnagalla@ti.com>
Diffstat (limited to 'arch/arm/plat-omap/dmm_user.c')
-rw-r--r--arch/arm/plat-omap/dmm_user.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/arm/plat-omap/dmm_user.c b/arch/arm/plat-omap/dmm_user.c
index 30f8bedee140..3afa28db3d2d 100644
--- a/arch/arm/plat-omap/dmm_user.c
+++ b/arch/arm/plat-omap/dmm_user.c
@@ -244,7 +244,15 @@ static int omap_dmm_release(struct inode *inode, struct file *filp)
}
obj = filp->private_data;
flush_signals(current);
- iommu_notify_event(obj->iovmm->iommu, IOMMU_CLOSE, NULL);
+
+ status = mutex_lock_interruptible(&obj->iovmm->dmm_map_lock);
+ if (status == 0) {
+ iommu_notify_event(obj->iovmm->iommu, IOMMU_CLOSE, NULL);
+ mutex_unlock(&obj->iovmm->dmm_map_lock);
+ } else {
+ pr_err("%s mutex_lock_interruptible returned 0x%x\n",
+ __func__, status);
+ }
user_remove_resources(obj);
iommu_put(obj->iovmm->iommu);
kfree(obj);