Skip to content

Commit 5012650

Browse files
committed
Merge branch 'iommu/amd/amd-vi' into iommu/next
* iommu/amd/amd-vi: iommu/amd: Use try_cmpxchg64() in v2_alloc_pte()
2 parents 91b3a24 + 9a448e4 commit 5012650

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iommu/amd/io_pgtable_v2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ static u64 *v2_alloc_pte(int nid, u64 *pgd, unsigned long iova,
158158

159159
__npte = set_pgtable_attr(page);
160160
/* pte could have been changed somewhere. */
161-
if (cmpxchg64(pte, __pte, __npte) != __pte)
161+
if (!try_cmpxchg64(pte, &__pte, __npte))
162162
iommu_free_page(page);
163163
else if (IOMMU_PTE_PRESENT(__pte))
164164
*updated = true;

0 commit comments

Comments
 (0)