|
@@ -737,8 +737,8 @@ int pnv_tce_xchg(struct iommu_table *tbl, long index,
|
|
|
if (newtce & TCE_PCI_WRITE)
|
|
|
newtce |= TCE_PCI_READ;
|
|
|
|
|
|
- oldtce = xchg(pnv_tce(tbl, idx), cpu_to_be64(newtce));
|
|
|
- *hpa = be64_to_cpu(oldtce) & ~(TCE_PCI_READ | TCE_PCI_WRITE);
|
|
|
+ oldtce = be64_to_cpu(xchg(pnv_tce(tbl, idx), cpu_to_be64(newtce)));
|
|
|
+ *hpa = oldtce & ~(TCE_PCI_READ | TCE_PCI_WRITE);
|
|
|
*direction = iommu_tce_direction(oldtce);
|
|
|
|
|
|
return 0;
|