Message ID | 20190712094509.56695-3-aik@ozlabs.ru |
---|---|
State | Superseded |
Headers | show |
Series | powerpc/ioda2: Yet another attempt to allow DMA masks between 32 and 59 | expand |
Context | Check | Description |
---|---|---|
snowpatch_ozlabs/checkpatch | warning | total: 0 errors, 1 warnings, 0 checks, 23 lines checked |
snowpatch_ozlabs/apply_patch | success | Successfully applied on branch next (c06dc11e93d41bae3f06a812b33ba422839936d0) |
> This skips the 32bit DMA setup check if the bypass is can be selected.
That sentence does not parse. I think you need to dop the "can be"
based on the actual patch.
On 13/07/2019 01:20, Christoph Hellwig wrote: >> This skips the 32bit DMA setup check if the bypass is can be selected. > > That sentence does not parse. I think you need to dop the "can be" > based on the actual patch. "the 32bit DMA setup check" is "if (!(tbl = get_iommu_table_base(dev)))". I can rephrase though.
On Mon, Jul 15, 2019 at 06:33:00PM +1000, Alexey Kardashevskiy wrote: > > > On 13/07/2019 01:20, Christoph Hellwig wrote: > > > This skips the 32bit DMA setup check if the bypass is can be selected. > > > > That sentence does not parse. I think you need to dop the "can be" > > based on the actual patch. > > > "the 32bit DMA setup check" is > "if (!(tbl = get_iommu_table_base(dev)))". > > I can rephrase though. What I mean is to replace "This skips the 32bit DMA setup check if the bypass is can be selected." with "This skips the 32bit DMA setup check if the bypass is selected." or alternatively: "This skips the 32bit DMA setup check if the bypass can be selected." but I think the first version is more accurate.
diff --git a/arch/powerpc/kernel/dma-iommu.c b/arch/powerpc/kernel/dma-iommu.c index a0879674a9c8..c963d704fa31 100644 --- a/arch/powerpc/kernel/dma-iommu.c +++ b/arch/powerpc/kernel/dma-iommu.c @@ -122,18 +122,17 @@ int dma_iommu_dma_supported(struct device *dev, u64 mask) { struct iommu_table *tbl = get_iommu_table_base(dev); - if (!tbl) { - dev_info(dev, "Warning: IOMMU dma not supported: mask 0x%08llx" - ", table unavailable\n", mask); - return 0; - } - if (dev_is_pci(dev) && dma_iommu_bypass_supported(dev, mask)) { dev->archdata.iommu_bypass = true; dev_dbg(dev, "iommu: 64-bit OK, using fixed ops\n"); return 1; } + if (!tbl) { + dev_err(dev, "Warning: IOMMU dma not supported: mask 0x%08llx, table unavailable\n", mask); + return 0; + } + if (tbl->it_offset > (mask >> tbl->it_page_shift)) { dev_info(dev, "Warning: IOMMU offset too big for device mask\n"); dev_info(dev, "mask: 0x%08llx, table offset: 0x%08lx\n",