Re: [PATCH 2/2] arm64: avoid increasing DMA masks above what hardware supports
Hi Nikita, [auto build test ERROR on linus/master] [also build test ERROR on v4.10-rc3 next-20170112] [cannot apply to arm64/for-next/core] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Nikita-Yushchenko/dma-mapping-let-arch-know-origin-of-dma-range-passed-to-arch_setup_dma_ops/20170113-152733 config: arm64-defconfig (attached as .config) compiler: aarch64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705 reproduce: wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree make.cross ARCH=arm64 All errors (new ones prefixed by >>): arch/arm64/mm/dma-mapping.c: In function 'dma_set_mask': >> arch/arm64/mm/dma-mapping.c:210:6: error: 'mask' undeclared (first use in >> this function) if (mask > dev->archdata.parent_dma_mask) ^~~~ arch/arm64/mm/dma-mapping.c:210:6: note: each undeclared identifier is reported only once for each function it appears in vim +/mask +210 arch/arm64/mm/dma-mapping.c 204 } 205 206 int dma_set_mask(struct device *dev, u64 dma_mask) 207 { 208 const struct dma_map_ops *ops = get_dma_ops(dev); 209 > 210 if (mask > dev->archdata.parent_dma_mask) 211 mask = dev->archdata.parent_dma_mask; 212 213 if (ops->set_dma_mask) --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip
Re: [PATCH 2/2] arm64: avoid increasing DMA masks above what hardware supports
>> @@ -959,6 +990,15 @@ void arch_setup_dma_ops(struct device *dev, u64 >> dma_base, u64 size, >> if (!dev->archdata.dma_ops) >> dev->archdata.dma_ops = &swiotlb_dma_ops; >> >> + /* >> +* Whatever the parent bus can set. A device must not set >> +* a DMA mask larger than this. >> +*/ >> + if (enforce_range) >> + dev->archdata.parent_dma_mask = size - 1; >> + else >> + dev->archdata.parent_dma_mask = DMA_BIT_MASK(64); >> + >> dev->archdata.dma_coherent = coherent; >> __iommu_setup_dma_ops(dev, dma_base, size, iommu); >> > > Could we just pass the mask instead of the size here? We don't want to change API now. Nikita
Re: [PATCH 2/2] arm64: avoid increasing DMA masks above what hardware supports
On Wednesday, January 11, 2017 9:31:52 PM CET Nikita Yushchenko wrote: > @@ -959,6 +990,15 @@ void arch_setup_dma_ops(struct device *dev, u64 > dma_base, u64 size, > if (!dev->archdata.dma_ops) > dev->archdata.dma_ops = &swiotlb_dma_ops; > > + /* > +* Whatever the parent bus can set. A device must not set > +* a DMA mask larger than this. > +*/ > + if (enforce_range) > + dev->archdata.parent_dma_mask = size - 1; > + else > + dev->archdata.parent_dma_mask = DMA_BIT_MASK(64); > + > dev->archdata.dma_coherent = coherent; > __iommu_setup_dma_ops(dev, dma_base, size, iommu); > Could we just pass the mask instead of the size here? Arnd