Skip to content

Commit 751b9a5

Browse files
committed
Merge tag 'powerpc-4.8-7' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull one more powerpc fix from Michael Ellerman: "powernv/pci: Fix m64 checks for SR-IOV and window alignment from Russell Currey" * tag 'powerpc-4.8-7' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/powernv/pci: Fix m64 checks for SR-IOV and window alignment
2 parents 8d2c0d3 + b79331a commit 751b9a5

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

arch/powerpc/platforms/powernv/pci-ioda.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,13 @@ static inline bool pnv_pci_is_m64(struct pnv_phb *phb, struct resource *r)
124124
r->start < (phb->ioda.m64_base + phb->ioda.m64_size));
125125
}
126126

127+
static inline bool pnv_pci_is_m64_flags(unsigned long resource_flags)
128+
{
129+
unsigned long flags = (IORESOURCE_MEM_64 | IORESOURCE_PREFETCH);
130+
131+
return (resource_flags & flags) == flags;
132+
}
133+
127134
static struct pnv_ioda_pe *pnv_ioda_init_pe(struct pnv_phb *phb, int pe_no)
128135
{
129136
phb->ioda.pe_array[pe_no].phb = phb;
@@ -2871,7 +2878,7 @@ static void pnv_pci_ioda_fixup_iov_resources(struct pci_dev *pdev)
28712878
res = &pdev->resource[i + PCI_IOV_RESOURCES];
28722879
if (!res->flags || res->parent)
28732880
continue;
2874-
if (!pnv_pci_is_m64(phb, res)) {
2881+
if (!pnv_pci_is_m64_flags(res->flags)) {
28752882
dev_warn(&pdev->dev, "Don't support SR-IOV with"
28762883
" non M64 VF BAR%d: %pR. \n",
28772884
i, res);
@@ -3096,7 +3103,7 @@ static resource_size_t pnv_pci_window_alignment(struct pci_bus *bus,
30963103
* alignment for any 64-bit resource, PCIe doesn't care and
30973104
* bridges only do 64-bit prefetchable anyway.
30983105
*/
3099-
if (phb->ioda.m64_segsize && (type & IORESOURCE_MEM_64))
3106+
if (phb->ioda.m64_segsize && pnv_pci_is_m64_flags(type))
31003107
return phb->ioda.m64_segsize;
31013108
if (type & IORESOURCE_MEM)
31023109
return phb->ioda.m32_segsize;

0 commit comments

Comments
 (0)