]> 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)
commitc8cf4c0b2963a64983fd5369cd665fd00f79df00
tree61b5a9fa79e15af596924997068e2c69edd965ca
parentf223888f64b648bfbb541b5e74b579647c379318
powerpc/iommu: Remove IOMMU device references via bus notifier

After 26dc459130f1 ("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: 26dc459130f1 ("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