Skip to contentSkip to conversation

iommu/vt-d: remove the useless dma_pte_addr

PATCH Applied Yijing Wang 1 participant 2 messages May 26, 2014 – Jun 18, 2014 1 message not in the archive IOMMU

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 iommu/vt-d: remove the useless dma_pte_addr

---
 drivers/iommu/intel-iommu.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
drivers/iommu/intel-iommu.c +2 -4
index f256ffc..7b7127a 100644
@@ -848,13 +848,11 @@ static struct dma_pte *pfn_to_dma_pte(struct dmar_domain *domain,
 
 			domain_flush_cache(domain, tmp_page, VTD_PAGE_SIZE);
 			pteval = ((uint64_t)virt_to_dma_pfn(tmp_page) << VTD_PAGE_SHIFT) | DMA_PTE_READ | DMA_PTE_WRITE;
-			if (cmpxchg64(&pte->val, 0ULL, pteval)) {
+			if (cmpxchg64(&pte->val, 0ULL, pteval))
 				/* Someone else set it while we were thinking; use theirs. */
 				free_pgtable_page(tmp_page);
-			} else {
-				dma_pte_addr(pte);
+			else
 				domain_flush_cache(domain, pte, sizeof(*pte));
-			}
 		}
 		if (level == 1)
 			break;
Signature · 1 line
1.7.1

A message that is not in the archive (sent off-list or not yet received): 1401106427-9420-1-git-send-email-wangyijing-hv44wF8Li93QT0dZR+AlfA@public.gmane.org

#2 lore raw

ping...

Quoted 26 lines · Yijing Wang
---
 drivers/iommu/intel-iommu.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
drivers/iommu/intel-iommu.c +2 -4
index f256ffc..7b7127a 100644
@@ -848,13 +848,11 @@ static struct dma_pte *pfn_to_dma_pte(struct dmar_domain *domain,
 
 			domain_flush_cache(domain, tmp_page, VTD_PAGE_SIZE);
 			pteval = ((uint64_t)virt_to_dma_pfn(tmp_page) << VTD_PAGE_SHIFT) | DMA_PTE_READ | DMA_PTE_WRITE;
-			if (cmpxchg64(&pte->val, 0ULL, pteval)) {
+			if (cmpxchg64(&pte->val, 0ULL, pteval))
 				/* Someone else set it while we were thinking; use theirs. */
 				free_pgtable_page(tmp_page);
-			} else {
-				dma_pte_addr(pte);
+			else
 				domain_flush_cache(domain, pte, sizeof(*pte));
-			}
 		}
 		if (level == 1)
 			break;
Signature · 2 lines
Thanks!
Yijing