diff options
author | Hiroshi DOYU <hdoyu@nvidia.com> | 2012-06-27 05:54:01 -0400 |
---|---|---|
committer | Joerg Roedel <joerg.roedel@amd.com> | 2012-07-02 05:56:44 -0400 |
commit | 8f53dc724a83a0082184fa27df80c25c7df47340 (patch) | |
tree | ae15ec7282706da6947bd97d87354d7dbe58b6b0 /drivers/iommu | |
parent | ac1534a55d1e87d59a21c09c570605933b551480 (diff) |
iommu/tegra: smmu: Fix unsleepable memory allocation
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>
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/tegra-smmu.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c index ecd679043d77..3f3d09d560ea 100644 --- a/drivers/iommu/tegra-smmu.c +++ b/drivers/iommu/tegra-smmu.c | |||
@@ -550,13 +550,13 @@ static int alloc_pdir(struct smmu_as *as) | |||
550 | return 0; | 550 | return 0; |
551 | 551 | ||
552 | as->pte_count = devm_kzalloc(smmu->dev, | 552 | as->pte_count = devm_kzalloc(smmu->dev, |
553 | sizeof(as->pte_count[0]) * SMMU_PDIR_COUNT, GFP_KERNEL); | 553 | sizeof(as->pte_count[0]) * SMMU_PDIR_COUNT, GFP_ATOMIC); |
554 | if (!as->pte_count) { | 554 | if (!as->pte_count) { |
555 | dev_err(smmu->dev, | 555 | dev_err(smmu->dev, |
556 | "failed to allocate smmu_device PTE cunters\n"); | 556 | "failed to allocate smmu_device PTE cunters\n"); |
557 | return -ENOMEM; | 557 | return -ENOMEM; |
558 | } | 558 | } |
559 | as->pdir_page = alloc_page(GFP_KERNEL | __GFP_DMA); | 559 | as->pdir_page = alloc_page(GFP_ATOMIC | __GFP_DMA); |
560 | if (!as->pdir_page) { | 560 | if (!as->pdir_page) { |
561 | dev_err(smmu->dev, | 561 | dev_err(smmu->dev, |
562 | "failed to allocate smmu_device page directory\n"); | 562 | "failed to allocate smmu_device page directory\n"); |