]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/powernv/pci: Fix m64 checks for SR-IOV and window alignment
authorRussell Currey <ruscur@russell.cc>
Wed, 14 Sep 2016 06:37:17 +0000 (16:37 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 21 Sep 2016 04:04:13 +0000 (14:04 +1000)
commit9614f0c7c56087c9febe58641983d05bf93cbaa6
treeb31542d6a1edbea965d7566bd6d0d8a10e18055c
parent860bd2f2dcbb8cda3328dd2f885817655a2f031f
powerpc/powernv/pci: Fix m64 checks for SR-IOV and window alignment

Commit f66f8ea3c384 checks for prefetchable m64 BARs by comparing the
addresses instead of using resource flags.  This broke SR-IOV as the m64
check in pnv_pci_ioda_fixup_iov_resources() fails.

The condition in pnv_pci_window_alignment() also changed to checking
only IORESOURCE_MEM_64 instead of both IORESOURCE_MEM_64 and
IORESOURCE_PREFETCH.

Revert these cases to the previous behaviour, adding a new helper function
to do so.  This is named pnv_pci_is_m64_flags() to make it clear this
function is only looking at resource flags and should not be relied on for
non-SRIOV resources.

Fixes: f66f8ea3c384 ("Fix incorrect PE reservation attempt on some 64-bit BARs")
Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Russell Currey <ruscur@russell.cc>
Tested-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/platforms/powernv/pci-ioda.c