aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/amd_iommu.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c
index 679f2a8e22ee..d743aa0adccc 100644
--- a/arch/x86/kernel/amd_iommu.c
+++ b/arch/x86/kernel/amd_iommu.c
@@ -876,7 +876,7 @@ static dma_addr_t map_single(struct device *dev, phys_addr_t paddr,
876 if (addr == bad_dma_address) 876 if (addr == bad_dma_address)
877 goto out; 877 goto out;
878 878
879 if (iommu->need_sync) 879 if (unlikely(iommu->need_sync))
880 iommu_completion_wait(iommu); 880 iommu_completion_wait(iommu);
881 881
882out: 882out:
@@ -905,7 +905,7 @@ static void unmap_single(struct device *dev, dma_addr_t dma_addr,
905 905
906 __unmap_single(iommu, domain->priv, dma_addr, size, dir); 906 __unmap_single(iommu, domain->priv, dma_addr, size, dir);
907 907
908 if (iommu->need_sync) 908 if (unlikely(iommu->need_sync))
909 iommu_completion_wait(iommu); 909 iommu_completion_wait(iommu);
910 910
911 spin_unlock_irqrestore(&domain->lock, flags); 911 spin_unlock_irqrestore(&domain->lock, flags);
@@ -968,7 +968,7 @@ static int map_sg(struct device *dev, struct scatterlist *sglist,
968 goto unmap; 968 goto unmap;
969 } 969 }
970 970
971 if (iommu->need_sync) 971 if (unlikely(iommu->need_sync))
972 iommu_completion_wait(iommu); 972 iommu_completion_wait(iommu);
973 973
974out: 974out:
@@ -1014,7 +1014,7 @@ static void unmap_sg(struct device *dev, struct scatterlist *sglist,
1014 s->dma_address = s->dma_length = 0; 1014 s->dma_address = s->dma_length = 0;
1015 } 1015 }
1016 1016
1017 if (iommu->need_sync) 1017 if (unlikely(iommu->need_sync))
1018 iommu_completion_wait(iommu); 1018 iommu_completion_wait(iommu);
1019 1019
1020 spin_unlock_irqrestore(&domain->lock, flags); 1020 spin_unlock_irqrestore(&domain->lock, flags);
@@ -1061,7 +1061,7 @@ static void *alloc_coherent(struct device *dev, size_t size,
1061 goto out; 1061 goto out;
1062 } 1062 }
1063 1063
1064 if (iommu->need_sync) 1064 if (unlikely(iommu->need_sync))
1065 iommu_completion_wait(iommu); 1065 iommu_completion_wait(iommu);
1066 1066
1067out: 1067out:
@@ -1093,7 +1093,7 @@ static void free_coherent(struct device *dev, size_t size,
1093 1093
1094 __unmap_single(iommu, domain->priv, dma_addr, size, DMA_BIDIRECTIONAL); 1094 __unmap_single(iommu, domain->priv, dma_addr, size, DMA_BIDIRECTIONAL);
1095 1095
1096 if (iommu->need_sync) 1096 if (unlikely(iommu->need_sync))
1097 iommu_completion_wait(iommu); 1097 iommu_completion_wait(iommu);
1098 1098
1099 spin_unlock_irqrestore(&domain->lock, flags); 1099 spin_unlock_irqrestore(&domain->lock, flags);