iommu/tegra: smmu: Fix unsleepable memory allocation at alloc_pdir()
authorHiroshi DOYU <hdoyu@nvidia.com>
Mon, 2 Jul 2012 11:26:38 +0000 (14:26 +0300)
committerJoerg Roedel <joerg.roedel@amd.com>
Tue, 17 Jul 2012 09:29:58 +0000 (11:29 +0200)
alloc_pdir() is called from smmu_iommu_domain_init() with spin_lock
held. memory allocations in alloc_pdir() had to be atomic. Instead of
converting into atomic allocation, this patch once releases a lock,
does the allocation, holds the lock again and then sees if it's raced
or not in order to avoid introducing mutex and preallocation.

Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com>
Reported-by: Chris Wright <chrisw@sous-sol.org>
Cc: Chris Wright <chrisw@sous-sol.org>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

No differences found