]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/iommu: Remove IOMMU device references via bus notifier
authorNishanth Aravamudan <nacc@linux.vnet.ibm.com>
Sat, 21 Feb 2015 19:00:50 +0000 (11:00 -0800)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 4 Mar 2015 02:19:33 +0000 (13:19 +1100)
commitf8bd32f3e206cfe91de5efcf190def25af89947a
tree61b5a9fa79e15af596924997068e2c69edd965ca
parent7db24102e355e04837c1ba7375f11074c9bd431e
powerpc/iommu: Remove IOMMU device references via bus notifier

After 07f2dc8c0124 ("PPC: POWERNV: move iommu_add_device earlier"), the
refcnt on the kobject backing the IOMMU group for a PCI device is
elevated by each call to pci_dma_dev_setup_pSeriesLP() (via
set_iommu_table_base_and_group). When we go to dlpar a multi-function
PCI device out:

        iommu_reconfig_notifier ->
                iommu_free_table ->
                        iommu_group_put
                        BUG_ON(tbl->it_group)

We trip this BUG_ON, because there are still references on the table, so
it is not freed. Fix this by moving the powernv bus notifier to common
code and calling it for both powernv and pseries.

Fixes: 07f2dc8c0124 ("PPC: POWERNV: move iommu_add_device earlier")
Signed-off-by: Nishanth Aravamudan <nacc@linux.vnet.ibm.com>
Tested-by: Nishanth Aravamudan <nacc@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/iommu.h
arch/powerpc/kernel/iommu.c
arch/powerpc/platforms/powernv/pci.c
arch/powerpc/platforms/pseries/iommu.c