mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
powerpc/iommu/vfio_spapr_tce: Cleanup iommu_table disposal
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 <[email protected]> Reviewed-by: David Gibson <[email protected]> Acked-by: Alex Williamson <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
This commit is contained in:
parent
a540aa56ba
commit
11edf116e3
3 changed files with 9 additions and 7 deletions
|
|
@ -680,7 +680,7 @@ static void tce_iommu_free_table(struct tce_container *container,
|
|||
unsigned long pages = tbl->it_allocated_size >> PAGE_SHIFT;
|
||||
|
||||
tce_iommu_userspace_view_free(tbl, container->mm);
|
||||
tbl->it_ops->free(tbl);
|
||||
iommu_free_table(tbl, "");
|
||||
decrement_locked_vm(container->mm, pages);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue