iommu/tegra: smmu: Don't call alloc_pdir with as->lock
authorJoerg Roedel <joerg.roedel@amd.com>
Tue, 17 Jul 2012 09:47:14 +0000 (11:47 +0200)
committerVarun Colbert <vcolbert@nvidia.com>
Sat, 4 Aug 2012 01:42:25 +0000 (18:42 -0700)
commitb7e3b74fc7f5e624ab1b9de64932e54799353c35
treefdc78bef1768d6b628769bfbc5684cda3a032002
parent12dbb8c507c9db8046f643ddb18e7d3b5c3397c8
iommu/tegra: smmu: Don't call alloc_pdir with as->lock

Instead of taking as->lock before calling alloc_pdir() and
releasing it in that function to allocate memory, just take
the lock only in the alloc_pdir function and run the loop
without any lock held. This simplifies the complicated
lock->unlock->alloc->lock->unlock sequence into
alloc->lock->unlock.

[Hiroshi Doyu: Backport from the upstream.]

Change-Id: I2894761f7476a1a1aaaad0220edd3b030e7d510e
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com>
Reviewed-on: http://git-master/r/120011
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
drivers/iommu/tegra-smmu.c