powerpc/powernv/npu: Use the correct IOMMU page size
This uses the page size from iommu_table instead of hard-coded 4K. This should cause no change in behavior. While we are here, move bits around to prepare for further rework which will define and use iommu_table_group_ops. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:

committed by
Michael Ellerman

parent
0bbcdb437d
commit
6969af7352
@@ -204,8 +204,7 @@ static void pnv_npu_disable_bypass(struct pnv_ioda_pe *npe)
|
|||||||
struct pnv_phb *phb = npe->phb;
|
struct pnv_phb *phb = npe->phb;
|
||||||
struct pci_dev *gpdev;
|
struct pci_dev *gpdev;
|
||||||
struct pnv_ioda_pe *gpe;
|
struct pnv_ioda_pe *gpe;
|
||||||
void *addr;
|
struct iommu_table *tbl;
|
||||||
unsigned int size;
|
|
||||||
int64_t rc;
|
int64_t rc;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -219,11 +218,11 @@ static void pnv_npu_disable_bypass(struct pnv_ioda_pe *npe)
|
|||||||
if (!gpe)
|
if (!gpe)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
addr = (void *)gpe->table_group.tables[0]->it_base;
|
tbl = gpe->table_group.tables[0];
|
||||||
size = gpe->table_group.tables[0]->it_size << 3;
|
|
||||||
rc = opal_pci_map_pe_dma_window(phb->opal_id, npe->pe_number,
|
rc = opal_pci_map_pe_dma_window(phb->opal_id, npe->pe_number,
|
||||||
npe->pe_number, 1, __pa(addr),
|
npe->pe_number, 1, __pa(tbl->it_base),
|
||||||
size, 0x1000);
|
tbl->it_size << 3,
|
||||||
|
IOMMU_PAGE_SIZE(tbl));
|
||||||
if (rc != OPAL_SUCCESS)
|
if (rc != OPAL_SUCCESS)
|
||||||
pr_warn("%s: Error %lld setting DMA window on PHB#%d-PE#%d\n",
|
pr_warn("%s: Error %lld setting DMA window on PHB#%d-PE#%d\n",
|
||||||
__func__, rc, phb->hose->global_number, npe->pe_number);
|
__func__, rc, phb->hose->global_number, npe->pe_number);
|
||||||
|
Reference in New Issue
Block a user