Open mpe opened 5 years ago
Possible fix:
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index ec48ea25a674..913f66ce7b9d 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -1833,16 +1833,18 @@ static bool pnv_pci_ioda_iommu_bypass_supported(struct pci_dev *pdev,
struct pnv_phb *phb = hose->private_data;
struct pci_dn *pdn = pci_get_pdn(pdev);
struct pnv_ioda_pe *pe;
+ u64 top;
if (WARN_ON(!pdn || pdn->pe_number == IODA_INVALID_PE))
return false;
pe = &phb->ioda.pe_array[pdn->pe_number];
- if (pe->tce_bypass_enabled) {
- u64 top = pe->tce_bypass_base + memblock_end_of_DRAM() - 1;
- if (dma_mask >= top)
- return true;
- }
+ if (!pe->tce_bypass_enabled)
+ return false;
+
+ top = pe->tce_bypass_base + memblock_end_of_DRAM() - 1;
+ if (dma_mask >= top)
+ return true;
/*
* If the device can't set the TCE bypass bit but still wants
Booting a powernv box with
iommu=nobypass
dmesg says:Which is the IPR:
0001:08:00.0 RAID bus controller: IBM PCI-E IPR SAS Adapter (ASIC) (rev 02)
The command line logic is definitely working to set the disabled bool:
The 2nd messages comes from
pnv_pci_ioda_dma_64bit_bypass()
. Which is called only frompnv_pci_ioda_iommu_bypass_supported()
.So this hunk looks to be at fault:
Which was part of torvalds/linux@8e3f1b1d8255
powerpc/powernv/pci: Enable 64-bit devices to access >4GB DMA space
.