|
@@ -576,15 +576,10 @@ static int pnv_tce_build(struct iommu_table *tbl, long index, long npages,
|
|
|
unsigned long uaddr, enum dma_data_direction direction,
|
|
|
struct dma_attrs *attrs, bool rm)
|
|
|
{
|
|
|
- u64 proto_tce;
|
|
|
+ u64 proto_tce = iommu_direction_to_tce_perm(direction);
|
|
|
__be64 *tcep, *tces;
|
|
|
u64 rpn;
|
|
|
|
|
|
- proto_tce = TCE_PCI_READ; // Read allowed
|
|
|
-
|
|
|
- if (direction != DMA_TO_DEVICE)
|
|
|
- proto_tce |= TCE_PCI_WRITE;
|
|
|
-
|
|
|
tces = tcep = ((__be64 *)tbl->it_base) + index - tbl->it_offset;
|
|
|
rpn = __pa(uaddr) >> tbl->it_page_shift;
|
|
|
|