Hi "Christian, I love your patch! Yet something to improve: [auto build test ERROR on rdma/for-next] [also build test ERROR on tegra-drm/drm/tegra/for-next v5.13-rc5 next-20210604] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Christian-K-nig/RDMA-umem-fix-missing-automated-rename/20210607-150846 base: https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git for-next config: powerpc-randconfig-r035-20210607 (attached as .config) compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project ae973380c5f6be77ce395022be40350942260be9) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # install powerpc cross compiling tool for clang build # apt-get install binutils-powerpc-linux-gnu # https://github.com/0day-ci/linux/commit/6a174683a13a824a00a001d656d1a1c2fb469ab8 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Christian-K-nig/RDMA-umem-fix-missing-automated-rename/20210607-150846 git checkout 6a174683a13a824a00a001d656d1a1c2fb469ab8 # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <lkp@xxxxxxxxx> All errors (new ones prefixed by >>): In file included from include/linux/dma-buf-map.h:9: In file included from include/linux/io.h:13: In file included from arch/powerpc/include/asm/io.h:619: arch/powerpc/include/asm/io-defs.h:43:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] DEF_PCI_AC_NORET(insb, (unsigned long p, void *b, unsigned long c), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET' __do_##name al; \ ^~~~~~~~~~~~~~ <scratch space>:175:1: note: expanded from here __do_insb ^ arch/powerpc/include/asm/io.h:556:56: note: expanded from macro '__do_insb' #define __do_insb(p, b, n) readsb((PCI_IO_ADDR)_IO_BASE+(p), (b), (n)) ~~~~~~~~~~~~~~~~~~~~~^ In file included from drivers/infiniband/core/umem_dmabuf.c:6: In file included from include/linux/dma-buf.h:16: In file included from include/linux/dma-buf-map.h:9: In file included from include/linux/io.h:13: In file included from arch/powerpc/include/asm/io.h:619: arch/powerpc/include/asm/io-defs.h:45:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] DEF_PCI_AC_NORET(insw, (unsigned long p, void *b, unsigned long c), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET' __do_##name al; \ ^~~~~~~~~~~~~~ <scratch space>:179:1: note: expanded from here __do_insw ^ arch/powerpc/include/asm/io.h:557:56: note: expanded from macro '__do_insw' #define __do_insw(p, b, n) readsw((PCI_IO_ADDR)_IO_BASE+(p), (b), (n)) ~~~~~~~~~~~~~~~~~~~~~^ In file included from drivers/infiniband/core/umem_dmabuf.c:6: In file included from include/linux/dma-buf.h:16: In file included from include/linux/dma-buf-map.h:9: In file included from include/linux/io.h:13: In file included from arch/powerpc/include/asm/io.h:619: arch/powerpc/include/asm/io-defs.h:47:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] DEF_PCI_AC_NORET(insl, (unsigned long p, void *b, unsigned long c), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET' __do_##name al; \ ^~~~~~~~~~~~~~ <scratch space>:183:1: note: expanded from here __do_insl ^ arch/powerpc/include/asm/io.h:558:56: note: expanded from macro '__do_insl' #define __do_insl(p, b, n) readsl((PCI_IO_ADDR)_IO_BASE+(p), (b), (n)) ~~~~~~~~~~~~~~~~~~~~~^ In file included from drivers/infiniband/core/umem_dmabuf.c:6: In file included from include/linux/dma-buf.h:16: In file included from include/linux/dma-buf-map.h:9: In file included from include/linux/io.h:13: In file included from arch/powerpc/include/asm/io.h:619: arch/powerpc/include/asm/io-defs.h:49:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] DEF_PCI_AC_NORET(outsb, (unsigned long p, const void *b, unsigned long c), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET' __do_##name al; \ ^~~~~~~~~~~~~~ <scratch space>:187:1: note: expanded from here __do_outsb ^ arch/powerpc/include/asm/io.h:559:58: note: expanded from macro '__do_outsb' #define __do_outsb(p, b, n) writesb((PCI_IO_ADDR)_IO_BASE+(p),(b),(n)) ~~~~~~~~~~~~~~~~~~~~~^ In file included from drivers/infiniband/core/umem_dmabuf.c:6: In file included from include/linux/dma-buf.h:16: In file included from include/linux/dma-buf-map.h:9: In file included from include/linux/io.h:13: In file included from arch/powerpc/include/asm/io.h:619: arch/powerpc/include/asm/io-defs.h:51:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] DEF_PCI_AC_NORET(outsw, (unsigned long p, const void *b, unsigned long c), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET' __do_##name al; \ ^~~~~~~~~~~~~~ <scratch space>:191:1: note: expanded from here __do_outsw ^ arch/powerpc/include/asm/io.h:560:58: note: expanded from macro '__do_outsw' #define __do_outsw(p, b, n) writesw((PCI_IO_ADDR)_IO_BASE+(p),(b),(n)) ~~~~~~~~~~~~~~~~~~~~~^ In file included from drivers/infiniband/core/umem_dmabuf.c:6: In file included from include/linux/dma-buf.h:16: In file included from include/linux/dma-buf-map.h:9: In file included from include/linux/io.h:13: In file included from arch/powerpc/include/asm/io.h:619: arch/powerpc/include/asm/io-defs.h:53:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] DEF_PCI_AC_NORET(outsl, (unsigned long p, const void *b, unsigned long c), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET' __do_##name al; \ ^~~~~~~~~~~~~~ <scratch space>:195:1: note: expanded from here __do_outsl ^ arch/powerpc/include/asm/io.h:561:58: note: expanded from macro '__do_outsl' #define __do_outsl(p, b, n) writesl((PCI_IO_ADDR)_IO_BASE+(p),(b),(n)) ~~~~~~~~~~~~~~~~~~~~~^ >> drivers/infiniband/core/umem_dmabuf.c:69:10: error: implicit declaration of function 'dma_resv_excl_fence' [-Werror,-Wimplicit-function-declaration] fence = dma_resv_excl_fence(umem_dmabuf->attach->dmabuf->resv); ^ drivers/infiniband/core/umem_dmabuf.c:69:10: note: did you mean 'dma_resv_add_excl_fence'? include/linux/dma-resv.h:279:6: note: 'dma_resv_add_excl_fence' declared here void dma_resv_add_excl_fence(struct dma_resv *obj, struct dma_fence *fence); ^ drivers/infiniband/core/umem_dmabuf.c:69:8: warning: incompatible integer to pointer conversion assigning to 'struct dma_fence *' from 'int' [-Wint-conversion] fence = dma_resv_excl_fence(umem_dmabuf->attach->dmabuf->resv); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 14 warnings and 1 error generated. vim +/dma_resv_excl_fence +69 drivers/infiniband/core/umem_dmabuf.c 11 12 int ib_umem_dmabuf_map_pages(struct ib_umem_dmabuf *umem_dmabuf) 13 { 14 struct sg_table *sgt; 15 struct scatterlist *sg; 16 struct dma_fence *fence; 17 unsigned long start, end, cur = 0; 18 unsigned int nmap = 0; 19 int i; 20 21 dma_resv_assert_held(umem_dmabuf->attach->dmabuf->resv); 22 23 if (umem_dmabuf->sgt) 24 goto wait_fence; 25 26 sgt = dma_buf_map_attachment(umem_dmabuf->attach, DMA_BIDIRECTIONAL); 27 if (IS_ERR(sgt)) 28 return PTR_ERR(sgt); 29 30 /* modify the sg list in-place to match umem address and length */ 31 32 start = ALIGN_DOWN(umem_dmabuf->umem.address, PAGE_SIZE); 33 end = ALIGN(umem_dmabuf->umem.address + umem_dmabuf->umem.length, 34 PAGE_SIZE); 35 for_each_sgtable_dma_sg(sgt, sg, i) { 36 if (start < cur + sg_dma_len(sg) && cur < end) 37 nmap++; 38 if (cur <= start && start < cur + sg_dma_len(sg)) { 39 unsigned long offset = start - cur; 40 41 umem_dmabuf->first_sg = sg; 42 umem_dmabuf->first_sg_offset = offset; 43 sg_dma_address(sg) += offset; 44 sg_dma_len(sg) -= offset; 45 cur += offset; 46 } 47 if (cur < end && end <= cur + sg_dma_len(sg)) { 48 unsigned long trim = cur + sg_dma_len(sg) - end; 49 50 umem_dmabuf->last_sg = sg; 51 umem_dmabuf->last_sg_trim = trim; 52 sg_dma_len(sg) -= trim; 53 break; 54 } 55 cur += sg_dma_len(sg); 56 } 57 58 umem_dmabuf->umem.sg_head.sgl = umem_dmabuf->first_sg; 59 umem_dmabuf->umem.sg_head.nents = nmap; 60 umem_dmabuf->umem.nmap = nmap; 61 umem_dmabuf->sgt = sgt; 62 63 wait_fence: 64 /* 65 * Although the sg list is valid now, the content of the pages 66 * may be not up-to-date. Wait for the exporter to finish 67 * the migration. 68 */ > 69 fence = dma_resv_excl_fence(umem_dmabuf->attach->dmabuf->resv); 70 if (fence) 71 return dma_fence_wait(fence, false); 72 73 return 0; 74 } 75 EXPORT_SYMBOL(ib_umem_dmabuf_map_pages); 76 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip