Skip to content

Commit 4f7e0ba

Browse files
aikmpe
authored andcommitted
powerpc/iommu: Allow bypass-only for DMA
POWER8 and newer support a bypass mode which maps all host memory to PCI buses so an IOMMU table is not always required. However if we fail to create such a table, the DMA setup fails and the kernel does not boot. This skips the 32bit DMA setup check if the bypass is selected. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20190718051139.74787-3-aik@ozlabs.ru
1 parent 56090a3 commit 4f7e0ba

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

arch/powerpc/kernel/dma-iommu.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,18 +122,17 @@ int dma_iommu_dma_supported(struct device *dev, u64 mask)
122122
{
123123
struct iommu_table *tbl = get_iommu_table_base(dev);
124124

125-
if (!tbl) {
126-
dev_info(dev, "Warning: IOMMU dma not supported: mask 0x%08llx"
127-
", table unavailable\n", mask);
128-
return 0;
129-
}
130-
131125
if (dev_is_pci(dev) && dma_iommu_bypass_supported(dev, mask)) {
132126
dev->archdata.iommu_bypass = true;
133127
dev_dbg(dev, "iommu: 64-bit OK, using fixed ops\n");
134128
return 1;
135129
}
136130

131+
if (!tbl) {
132+
dev_err(dev, "Warning: IOMMU dma not supported: mask 0x%08llx, table unavailable\n", mask);
133+
return 0;
134+
}
135+
137136
if (tbl->it_offset > (mask >> tbl->it_page_shift)) {
138137
dev_info(dev, "Warning: IOMMU offset too big for device mask\n");
139138
dev_info(dev, "mask: 0x%08llx, table offset: 0x%08lx\n",

0 commit comments

Comments
 (0)