powerpc/iommu: Remove the dependency on EEH struct in DDW mechanism
authorGuilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
Mon, 11 Apr 2016 19:17:23 +0000 (16:17 -0300)
committerWilly Tarreau <w@1wt.eu>
Sun, 21 Aug 2016 21:22:45 +0000 (23:22 +0200)
commitb738ed81a859e1185d2c9b54ef15456c8117f306
treefbae7e75f172c87413a93282e0eedad6b7b98cba
parent628cb1780bca2d899d76b29fd6884fa73d243c7c
powerpc/iommu: Remove the dependency on EEH struct in DDW mechanism

commit 8445a87f7092bc8336ea1305be9306f26b846d93 upstream.

Commit 39baadbf36ce ("powerpc/eeh: Remove eeh information from pci_dn")
changed the pci_dn struct by removing its EEH-related members.
As part of this clean-up, DDW mechanism was modified to read the device
configuration address from eeh_dev struct.

As a consequence, now if we disable EEH mechanism on kernel command-line
for example, the DDW mechanism will fail, generating a kernel oops by
dereferencing a NULL pointer (which turns to be the eeh_dev pointer).

This patch just changes the configuration address calculation on DDW
functions to a manual calculation based on pci_dn members instead of
using eeh_dev-based address.

No functional changes were made. This was tested on pSeries, both
in PHyp and qemu guest.

Fixes: 39baadbf36ce ("powerpc/eeh: Remove eeh information from pci_dn")
Cc: stable@vger.kernel.org # v3.4+
Reviewed-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Willy Tarreau <w@1wt.eu>
arch/powerpc/platforms/pseries/iommu.c