powerpc/eeh/ioda2: Use device::iommu_group to check IOMMU group

This relies on the fact that a PCI device always has an IOMMU table
which may not be the case when we get dynamic DMA windows so
let's use more reliable check for IOMMU group here.

As we do not rely on the table presence here, remove the workaround
from pnv_pci_ioda2_set_bypass(); also remove the @add_to_iommu_group
parameter from pnv_ioda_setup_bus_dma().

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Acked-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
Alexey Kardashevskiy
2015-06-05 16:34:53 +10:00
committed by Michael Ellerman
parent 1cbb4a1c43
commit ea30e99e8e
2 changed files with 6 additions and 25 deletions

View File

@@ -1410,13 +1410,11 @@ static int dev_has_iommu_table(struct device *dev, void *data)
{
struct pci_dev *pdev = to_pci_dev(dev);
struct pci_dev **ppdev = data;
struct iommu_table *tbl;
if (!dev)
return 0;
tbl = get_iommu_table_base(dev);
if (tbl && tbl->it_group) {
if (dev->iommu_group) {
*ppdev = pdev;
return 1;
}