]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
powerpc/iommu/vfio_spapr_tce: Cleanup iommu_table disposal
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Mon, 7 Aug 2017 15:45:00 +0000 (17:45 +0200)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Thu, 24 Aug 2017 08:03:22 +0000 (10:03 +0200)
commit2ad1ce60d47bc51eccf75fe4d8610e2a325f7c1f
treefed96f2b05745cd9f07d00f398082a4509bb94fa
parent5c42257be483ac0931587e9598927bf5e01a8629
powerpc/iommu/vfio_spapr_tce: Cleanup iommu_table disposal

BugLink: http://bugs.launchpad.net/bugs/1686019
At the moment iommu_table can be disposed by either calling
iommu_table_free() directly or it_ops::free(); the only implementation
of free() is in IODA2 - pnv_ioda2_table_free() - and it calls
iommu_table_free() anyway.

As we are going to have reference counting on tables, we need an unified
way of disposing tables.

This moves it_ops::free() call into iommu_free_table() and makes use
of the latter. The free() callback now handles only platform-specific
data.

As from now on the iommu_free_table() calls it_ops->free(), we need
to have it_ops initialized before calling iommu_free_table() so this
moves this initialization in pnv_pci_ioda2_create_table().

This should cause no behavioral change.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Acked-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit 11edf116e3a6352cfee6b1437d41603c9aff79c9)
Signed-off-by: Jose Ricardo Ziviani <joserz@linux.vnet.ibm.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
arch/powerpc/kernel/iommu.c
arch/powerpc/platforms/powernv/pci-ioda.c
drivers/vfio/vfio_iommu_spapr_tce.c