tree: https://github.com/sbates130272/linux-p2pmem.git p2pdma_user_cmb_x4 head: fa4cb582249aff75fc288e643e5dc9b6c303daaa commit: c2a06cbc32a9c52483512859be6b79e47516c3b3 [14/24] dma-direct: Support PCI P2PDMA pages in dma-direct map_sg config: x86_64-randconfig-a001-20200930 (attached as .config) compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project bcd05599d0e53977a963799d6ee4f6e0bc21331b) 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 x86_64 cross compiling tool for clang build # apt-get install binutils-x86-64-linux-gnu # https://github.com/sbates130272/linux-p2pmem/commit/c2a06cbc32a9c52483512859be6b79e47516c3b3 git remote add p2pmem https://github.com/sbates130272/linux-p2pmem.git git fetch --no-tags p2pmem p2pdma_user_cmb_x4 git checkout c2a06cbc32a9c52483512859be6b79e47516c3b3 # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All errors (new ones prefixed by >>): >> kernel/dma/direct.c:385:11: error: implicit declaration of function 'pci_p2pdma_should_map_bus' [-Werror,-Wimplicit-function-declaration] map = pci_p2pdma_should_map_bus(dev, pgmap); ^ >> kernel/dma/direct.c:386:48: error: too few arguments to function call, expected 3, have 1 bus_off = pci_p2pdma_bus_offset(sg_page(sg)); ~~~~~~~~~~~~~~~~~~~~~ ^ include/linux/pci-p2pdma.h:88:19: note: 'pci_p2pdma_bus_offset' declared here static inline int pci_p2pdma_bus_offset(struct device *dev, ^ 2 errors generated. vim +/pci_p2pdma_should_map_bus +385 kernel/dma/direct.c 372 373 int dma_direct_map_sg(struct device *dev, struct scatterlist *sgl, int nents, 374 enum dma_data_direction dir, unsigned long attrs) 375 { 376 struct dev_pagemap *pgmap = NULL; 377 int i, map = -1; 378 struct scatterlist *sg; 379 u64 bus_off; 380 381 for_each_sg(sgl, sg, nents, i) { 382 if (is_pci_p2pdma_page(sg_page(sg))) { 383 if (sg_page(sg)->pgmap != pgmap) { 384 pgmap = sg_page(sg)->pgmap; > 385 map = pci_p2pdma_should_map_bus(dev, pgmap); > 386 bus_off = pci_p2pdma_bus_offset(sg_page(sg)); 387 } 388 389 if (map < 0 || !(attrs & DMA_ATTR_P2PDMA)) { 390 sg->dma_address = DMA_MAPPING_ERROR; 391 goto out_unmap; 392 } 393 394 if (map) { 395 sg->dma_address = sg_phys(sg) + sg->offset - 396 bus_off; 397 sg_dma_len(sg) = sg->length | SG_P2PDMA_FLAG; 398 continue; 399 } 400 } 401 402 sg->dma_address = dma_direct_map_page(dev, sg_page(sg), 403 sg->offset, sg->length, dir, attrs); 404 if (sg->dma_address == DMA_MAPPING_ERROR) 405 goto out_unmap; 406 sg_dma_len(sg) = sg->length; 407 } 408 409 return nents; 410 411 out_unmap: 412 dma_direct_unmap_sg(dev, sgl, i, dir, attrs | DMA_ATTR_SKIP_CPU_SYNC); 413 return 0; 414 } 415 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org