From: Joerg Roedel Date: Mon, 21 Dec 2015 11:50:54 +0000 (+0100) Subject: iommu/amd: Warn only once on unexpected pte value X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a7fb668fd88c979e790f0c324a1a6d749a8c5a60;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git iommu/amd: Warn only once on unexpected pte value This prevents possible flooding of the kernel log. Signed-off-by: Joerg Roedel --- diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 8b2be1e7714f..3cdfac6024a5 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c @@ -2328,7 +2328,7 @@ static dma_addr_t dma_ops_domain_map(struct dma_ops_domain *dom, else if (direction == DMA_BIDIRECTIONAL) __pte |= IOMMU_PTE_IR | IOMMU_PTE_IW; - WARN_ON(*pte); + WARN_ON_ONCE(*pte); *pte = __pte; @@ -2357,7 +2357,7 @@ static void dma_ops_domain_unmap(struct dma_ops_domain *dom, pte += PM_LEVEL_INDEX(0, address); - WARN_ON(!*pte); + WARN_ON_ONCE(!*pte); *pte = 0ULL; }