linux/arch/powerpc/platforms
Gavin Shan 763fe0addb powerpc/powernv: Fix IOMMU group lost
When we take full hotplug to recover from EEH errors, PCI buses
could be involved. For the case, the child devices of involved
PCI buses can't be attached to IOMMU group properly, which is
caused by commit 3f28c5a ("powerpc/powernv: Reduce multi-hit of
iommu_add_device()").

When adding the PCI devices of the newly created PCI buses to
the system, the IOMMU group is expected to be added in (C).
(A) fails to bind the IOMMU group because bus->is_added is
false. (B) fails because the device doesn't have binding IOMMU
table yet. bus->is_added is set to true at end of (C) and
pdev->is_added is set to true at (D).

   pcibios_add_pci_devices()
      pci_scan_bridge()
         pci_scan_child_bus()
            pci_scan_slot()
               pci_scan_single_device()
                  pci_scan_device()
                  pci_device_add()
                     pcibios_add_device()           A: Ignore
                     device_add()                   B: Ignore
                  pcibios_fixup_bus()
                     pcibios_setup_bus_devices()
                        pcibios_setup_device()      C: Hit
      pcibios_finish_adding_to_bus()
         pci_bus_add_devices()
            pci_bus_add_device()                    D: Add device

If the parent PCI bus isn't involved in hotplug, the IOMMU
group is expected to be bound in (B). (A) should fail as the
sysfs entries aren't populated.

The patch fixes the issue by reverting commit 3f28c5a and remove
WARN_ON() in iommu_add_device() to allow calling the function
even the specified device already has associated IOMMU group.

Cc: <stable@vger.kernel.org>  # 3.16+
Reported-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Acked-by: Wei Yang <weiyang@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-13 15:13:42 +10:00
..
8xx powerpc/8xx: Remove empty asm/mpc8xx.h 2014-06-25 18:49:40 -05:00
40x Removal of GENERIC_GPIO for v3.10 2013-05-09 09:59:16 -07:00
44x lib/scatterlist: make ARCH_HAS_SG_CHAIN an actual Kconfig 2014-08-08 15:57:26 -07:00
52xx lib/scatterlist: make ARCH_HAS_SG_CHAIN an actual Kconfig 2014-08-08 15:57:26 -07:00
82xx powerpc: add explicit OF includes 2013-10-09 20:04:11 -05:00
83xx powerpc: Delete non-required instances of include <linux/init.h> 2014-01-15 13:46:44 +11:00
85xx powerpc/t2080rdb: Add T2080RDB board support 2014-07-31 00:11:10 -05:00
86xx powerpc: add explicit OF includes 2013-10-09 20:04:11 -05:00
512x powerpc/512x: clk: support MPC5121/5123/5125 SoC variants 2014-01-12 18:59:36 +01:00
amigaone lib/scatterlist: make ARCH_HAS_SG_CHAIN an actual Kconfig 2014-08-08 15:57:26 -07:00
cell powerpc: cell: Use ktime_get_ns() 2014-07-23 10:18:07 -07:00
chrp of/fdt: update of_get_flat_dt_prop in prep for libfdt 2014-04-30 00:59:15 -05:00
embedded6xx powerpc/legacy_serial: Support MVME5100 UARTS with shifted registers 2014-04-28 17:36:25 +10:00
maple POWERPC: drivers: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
pasemi powerpc: No need to use dot symbols when branching to a function 2014-04-23 10:05:16 +10:00
powermac powerpc: Remove CONFIG_POWER4 2014-07-28 14:10:26 +10:00
powernv powerpc/powernv: Fix IOMMU group lost 2014-08-13 15:13:42 +10:00
ps3 Merge branch 'powernv-cpuidle' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2014-04-02 13:47:29 -07:00
pseries arch/powerpc: replace obsolete strict_strto* calls 2014-08-08 15:57:28 -07:00
fsl_uli1575.c of/irq: Refactor interrupt-map parsing 2013-10-24 11:43:04 +01:00
Kconfig powerpc: Remove platforms/wsp and associated pieces 2014-06-11 16:35:38 +10:00
Kconfig.cputype powerpc: Remove CONFIG_POWER4 2014-07-28 14:10:26 +10:00
Makefile powerpc: Remove platforms/wsp and associated pieces 2014-06-11 16:35:38 +10:00