]> 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)
commit2789d16891f6bef72b9c4b1a24161821fb73b0c6
treeb31542d6a1edbea965d7566bd6d0d8a10e18055c
parent2cd40ff3d82ae32fb73e32e2bdc6af06f29f974b
powerpc/powernv/pci: Fix m64 checks for SR-IOV and window alignment

Commit 1af165f499d0 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: 1af165f499d0 ("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