diff options
author | Alexey Kardashevskiy <aik@ozlabs.ru> | 2018-05-30 19:22:50 +1000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-07-03 11:24:50 +0200 |
commit | 0e8bb91c6dd6a77c60279c4fd83975ef257ed3c2 (patch) | |
tree | aaf90d38b8ea14f0bf338982b8405a6c044d8015 /arch/powerpc/platforms | |
parent | 919c9b8187bc8aa66388e50248c7f6c5b0c87e97 (diff) | |
download | linux-stable-0e8bb91c6dd6a77c60279c4fd83975ef257ed3c2.tar.gz linux-stable-0e8bb91c6dd6a77c60279c4fd83975ef257ed3c2.tar.bz2 linux-stable-0e8bb91c6dd6a77c60279c4fd83975ef257ed3c2.zip |
powerpc/powernv/ioda2: Remove redundant free of TCE pages
commit 98fd72fe82527fd26618062b60cfd329451f2329 upstream.
When IODA2 creates a PE, it creates an IOMMU table with it_ops::free
set to pnv_ioda2_table_free() which calls pnv_pci_ioda2_table_free_pages().
Since iommu_tce_table_put() calls it_ops::free when the last reference
to the table is released, explicit call to pnv_pci_ioda2_table_free_pages()
is not needed so let's remove it.
This should fix double free in the case of PCI hotuplug as
pnv_pci_ioda2_table_free_pages() does not reset neither
iommu_table::it_base nor ::it_size.
This was not exposed by SRIOV as it uses different code path via
pnv_pcibios_sriov_disable().
IODA1 does not inialize it_ops::free so it does not have this issue.
Fixes: c5f7700bbd2e ("powerpc/powernv: Dynamically release PE")
Cc: stable@vger.kernel.org # v4.8+
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r-- | arch/powerpc/platforms/powernv/pci-ioda.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index 57f9e55f4352..677b29ef4532 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/arch/powerpc/platforms/powernv/pci-ioda.c @@ -3591,7 +3591,6 @@ static void pnv_pci_ioda2_release_pe_dma(struct pnv_ioda_pe *pe) WARN_ON(pe->table_group.group); } - pnv_pci_ioda2_table_free_pages(tbl); iommu_tce_table_put(tbl); } |