summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiro Sugawara <hsugawara@nvidia.com>2011-09-01 14:04:25 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:48:52 -0800
commita658edf17a0b2dd2a77c4e753154cc96dd007a31 (patch)
tree8ebcc8db85e7c1feac28f29b15a0e98bee54768e
parentbd260e07436ccdd85275cf0eeb42e49c226e0ddb (diff)
arm: tegra: iovmm: Remove unnecessary and harmful lock in IOVMM
Bug 862658 Reverting to K36 code. Google invented the lock (originally as spinlock). The lock surrounds a read-only list and is not only unnecessary but also affects atomicity of lower layers. Should real protection be necessary in a lower layer, the layer would be responsible for the proetection. The SMMU layer does not need protection. Change-Id: I45641cfde3eebc536f57d14db447b03f4ea814b5 Reviewed-on: http://git-master/r/50349 Tested-by: Hiro Sugawara <hsugawara@nvidia.com> Reviewed-by: Scott Williams <scwilliams@nvidia.com> Rebase-Id: R9c0fdcdbc673c0ba353a8d0731dcf4e4bf3a81fa
-rw-r--r--arch/arm/mach-tegra/iovmm.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/arch/arm/mach-tegra/iovmm.c b/arch/arm/mach-tegra/iovmm.c
index e792443dc377..b4b21779126c 100644
--- a/arch/arm/mach-tegra/iovmm.c
+++ b/arch/arm/mach-tegra/iovmm.c
@@ -75,7 +75,6 @@ struct iovmm_share_group {
static LIST_HEAD(iovmm_devices);
static LIST_HEAD(iovmm_groups);
static DEFINE_MUTEX(iovmm_group_list_lock);
-static DEFINE_MUTEX(iovmm_device_list_lock);
static struct kmem_cache *iovmm_cache;
static tegra_iovmm_addr_t iovmm_align_up(struct tegra_iovmm_device *dev,
@@ -814,12 +813,10 @@ struct tegra_iovmm_client *tegra_iovmm_alloc_client(const char *name,
kfree(grp);
goto fail_lock;
}
- mutex_lock(&iovmm_device_list_lock);
list_for_each_entry(dev, &iovmm_devices, list) {
grp->domain = dev->ops->alloc_domain(dev, c);
if (grp->domain) break;
}
- mutex_unlock(&iovmm_device_list_lock);
if (!grp->domain) {
pr_err("%s: alloc_domain failed for %s\n",
__func__, c->name);
@@ -887,7 +884,6 @@ static int tegra_iovmm_suspend(void)
struct tegra_iovmm_device *dev;
unsigned long flags;
- mutex_lock(&iovmm_device_list_lock);
list_for_each_entry(dev, &iovmm_devices, list) {
if (!dev->ops->suspend)
@@ -897,11 +893,9 @@ static int tegra_iovmm_suspend(void)
if (rc) {
pr_err("%s: %s suspend returned %d\n",
__func__, dev->name, rc);
- mutex_unlock(&iovmm_device_list_lock);
return rc;
}
}
- mutex_unlock(&iovmm_device_list_lock);
return 0;
}
@@ -910,14 +904,10 @@ static void tegra_iovmm_resume(void)
struct tegra_iovmm_device *dev;
unsigned long flags;
- mutex_lock(&iovmm_device_list_lock);
-
list_for_each_entry(dev, &iovmm_devices, list) {
if (dev->ops->resume)
dev->ops->resume(dev);
}
-
- mutex_unlock(&iovmm_device_list_lock);
}
static struct syscore_ops tegra_iovmm_syscore_ops = {