Skip to content

Commit

Permalink
iommu/tegra: smmu: Fix unsleepable memory allocation
Browse files Browse the repository at this point in the history
allo_pdir() is called in smmu_iommu_domain_init() with spin_lock
held. memory allocations in it have to be atomic/unsleepable.

Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com>
Reported-by: Chris Wright <chrisw@sous-sol.org>
Acked-by: Chris Wright <chrisw@sous-sol.org>
Cc: stable@vger.kernel.org
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
  • Loading branch information
Hiroshi DOYU authored and Joerg Roedel committed Jul 2, 2012
1 parent ac1534a commit 8f53dc7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/iommu/tegra-smmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,13 +550,13 @@ static int alloc_pdir(struct smmu_as *as)
return 0;

as->pte_count = devm_kzalloc(smmu->dev,
sizeof(as->pte_count[0]) * SMMU_PDIR_COUNT, GFP_KERNEL);
sizeof(as->pte_count[0]) * SMMU_PDIR_COUNT, GFP_ATOMIC);
if (!as->pte_count) {
dev_err(smmu->dev,
"failed to allocate smmu_device PTE cunters\n");
return -ENOMEM;
}
as->pdir_page = alloc_page(GFP_KERNEL | __GFP_DMA);
as->pdir_page = alloc_page(GFP_ATOMIC | __GFP_DMA);
if (!as->pdir_page) {
dev_err(smmu->dev,
"failed to allocate smmu_device page directory\n");
Expand Down

0 comments on commit 8f53dc7

Please sign in to comment.