Hi Shunsuke, [FYI, it's a private test report for your RFC patch.] [auto build test WARNING on helgaas-pci/next] [also build test WARNING on helgaas-pci/for-linus linus/master v6.2-rc3 next-20230113] [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#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Shunsuke-Mie/PCI-endpoint-support-an-alignment-aware-map-unmaping/20230113-170756 base: https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git next patch link: https://lore.kernel.org/r/20230113090350.1103494-2-mie%40igel.co.jp patch subject: [RFC PATCH 1/3] PCI: endpoint: support an alignment aware map/unmaping config: ia64-allyesconfig compiler: ia64-linux-gcc (GCC) 12.1.0 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 # https://github.com/intel-lab-lkp/linux/commit/cccc71b1d7f50a0bc89e0eae0a194b6da166d607 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Shunsuke-Mie/PCI-endpoint-support-an-alignment-aware-map-unmaping/20230113-170756 git checkout cccc71b1d7f50a0bc89e0eae0a194b6da166d607 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=ia64 olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=ia64 SHELL=/bin/bash drivers/pci/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot All warnings (new ones prefixed by >>): drivers/pci/endpoint/functions/pci-epf-test.c: In function 'pci_epf_test_copy': >> drivers/pci/endpoint/functions/pci-epf-test.c:336:35: warning: passing argument 5 of 'pci_epc_map_addr' makes pointer from integer without a cast [-Wint-conversion] 336 | reg->src_addr, reg->size); | ~~~^~~~~~~~~~ | | | u64 {aka long long unsigned int} In file included from drivers/pci/endpoint/functions/pci-epf-test.c:18: include/linux/pci-epc.h:223:59: note: expected 'phys_addr_t *' {aka 'long long unsigned int *'} but argument is of type 'u64' {aka 'long long unsigned int'} 223 | u64 pci_addr, phys_addr_t *phys_addr, | ~~~~~~~~~~~~~^~~~~~~~~ >> drivers/pci/endpoint/functions/pci-epf-test.c:335:13: warning: assignment to 'int' from 'void *' makes integer from pointer without a cast [-Wint-conversion] 335 | ret = pci_epc_map_addr(epc, epf->func_no, epf->vfunc_no, src_phys_addr, | ^ drivers/pci/endpoint/functions/pci-epf-test.c:352:35: warning: passing argument 5 of 'pci_epc_map_addr' makes pointer from integer without a cast [-Wint-conversion] 352 | reg->dst_addr, reg->size); | ~~~^~~~~~~~~~ | | | u64 {aka long long unsigned int} include/linux/pci-epc.h:223:59: note: expected 'phys_addr_t *' {aka 'long long unsigned int *'} but argument is of type 'u64' {aka 'long long unsigned int'} 223 | u64 pci_addr, phys_addr_t *phys_addr, | ~~~~~~~~~~~~~^~~~~~~~~ drivers/pci/endpoint/functions/pci-epf-test.c:351:13: warning: assignment to 'int' from 'void *' makes integer from pointer without a cast [-Wint-conversion] 351 | ret = pci_epc_map_addr(epc, epf->func_no, epf->vfunc_no, dst_phys_addr, | ^ drivers/pci/endpoint/functions/pci-epf-test.c:396:9: error: too few arguments to function 'pci_epc_unmap_addr' 396 | pci_epc_unmap_addr(epc, epf->func_no, epf->vfunc_no, dst_phys_addr); | ^~~~~~~~~~~~~~~~~~ include/linux/pci-epc.h:225:6: note: declared here 225 | void pci_epc_unmap_addr(struct pci_epc *epc, u8 func_no, u8 vfunc_no, | ^~~~~~~~~~~~~~~~~~ drivers/pci/endpoint/functions/pci-epf-test.c:402:9: error: too few arguments to function 'pci_epc_unmap_addr' 402 | pci_epc_unmap_addr(epc, epf->func_no, epf->vfunc_no, src_phys_addr); | ^~~~~~~~~~~~~~~~~~ include/linux/pci-epc.h:225:6: note: declared here 225 | void pci_epc_unmap_addr(struct pci_epc *epc, u8 func_no, u8 vfunc_no, | ^~~~~~~~~~~~~~~~~~ drivers/pci/endpoint/functions/pci-epf-test.c: In function 'pci_epf_test_read': drivers/pci/endpoint/functions/pci-epf-test.c:437:35: warning: passing argument 5 of 'pci_epc_map_addr' makes pointer from integer without a cast [-Wint-conversion] 437 | reg->src_addr, reg->size); | ~~~^~~~~~~~~~ | | | u64 {aka long long unsigned int} include/linux/pci-epc.h:223:59: note: expected 'phys_addr_t *' {aka 'long long unsigned int *'} but argument is of type 'u64' {aka 'long long unsigned int'} 223 | u64 pci_addr, phys_addr_t *phys_addr, | ~~~~~~~~~~~~~^~~~~~~~~ drivers/pci/endpoint/functions/pci-epf-test.c:436:13: warning: assignment to 'int' from 'void *' makes integer from pointer without a cast [-Wint-conversion] 436 | ret = pci_epc_map_addr(epc, epf->func_no, epf->vfunc_no, phys_addr, | ^ drivers/pci/endpoint/functions/pci-epf-test.c:492:9: error: too few arguments to function 'pci_epc_unmap_addr' 492 | pci_epc_unmap_addr(epc, epf->func_no, epf->vfunc_no, phys_addr); | ^~~~~~~~~~~~~~~~~~ include/linux/pci-epc.h:225:6: note: declared here 225 | void pci_epc_unmap_addr(struct pci_epc *epc, u8 func_no, u8 vfunc_no, | ^~~~~~~~~~~~~~~~~~ drivers/pci/endpoint/functions/pci-epf-test.c: In function 'pci_epf_test_write': drivers/pci/endpoint/functions/pci-epf-test.c:526:35: warning: passing argument 5 of 'pci_epc_map_addr' makes pointer from integer without a cast [-Wint-conversion] 526 | reg->dst_addr, reg->size); | ~~~^~~~~~~~~~ | | | u64 {aka long long unsigned int} include/linux/pci-epc.h:223:59: note: expected 'phys_addr_t *' {aka 'long long unsigned int *'} but argument is of type 'u64' {aka 'long long unsigned int'} 223 | u64 pci_addr, phys_addr_t *phys_addr, | ~~~~~~~~~~~~~^~~~~~~~~ drivers/pci/endpoint/functions/pci-epf-test.c:525:13: warning: assignment to 'int' from 'void *' makes integer from pointer without a cast [-Wint-conversion] 525 | ret = pci_epc_map_addr(epc, epf->func_no, epf->vfunc_no, phys_addr, | ^ drivers/pci/endpoint/functions/pci-epf-test.c:588:9: error: too few arguments to function 'pci_epc_unmap_addr' 588 | pci_epc_unmap_addr(epc, epf->func_no, epf->vfunc_no, phys_addr); | ^~~~~~~~~~~~~~~~~~ include/linux/pci-epc.h:225:6: note: declared here 225 | void pci_epc_unmap_addr(struct pci_epc *epc, u8 func_no, u8 vfunc_no, | ^~~~~~~~~~~~~~~~~~ vim +/pci_epc_map_addr +336 drivers/pci/endpoint/functions/pci-epf-test.c 5893c2e5353bb9 Kishon Vijay Abraham I 2020-03-16 311 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 312 static int pci_epf_test_copy(struct pci_epf_test *epf_test) 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 313 { 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 314 int ret; 5ebf3fc59bd20d Kishon Vijay Abraham I 2020-03-16 315 bool use_dma; 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 316 void __iomem *src_addr; 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 317 void __iomem *dst_addr; 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 318 phys_addr_t src_phys_addr; 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 319 phys_addr_t dst_phys_addr; 5893c2e5353bb9 Kishon Vijay Abraham I 2020-03-16 320 struct timespec64 start, end; 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 321 struct pci_epf *epf = epf_test->epf; 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 322 struct device *dev = &epf->dev; 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 323 struct pci_epc *epc = epf->epc; 3235b994950d84 Kishon Vijay Abraham I 2017-08-18 324 enum pci_barno test_reg_bar = epf_test->test_reg_bar; 3235b994950d84 Kishon Vijay Abraham I 2017-08-18 325 struct pci_epf_test_reg *reg = epf_test->reg[test_reg_bar]; 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 326 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 327 src_addr = pci_epc_mem_alloc_addr(epc, &src_phys_addr, reg->size); 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 328 if (!src_addr) { 798c0441bec8c4 Gustavo Pimentel 2018-05-14 329 dev_err(dev, "Failed to allocate source address\n"); 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 330 reg->status = STATUS_SRC_ADDR_INVALID; 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 331 ret = -ENOMEM; 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 332 goto err; 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 333 } 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 334 53fd3cbe5e9d79 Kishon Vijay Abraham I 2021-08-19 @335 ret = pci_epc_map_addr(epc, epf->func_no, epf->vfunc_no, src_phys_addr, 53fd3cbe5e9d79 Kishon Vijay Abraham I 2021-08-19 @336 reg->src_addr, reg->size); 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 337 if (ret) { 798c0441bec8c4 Gustavo Pimentel 2018-05-14 338 dev_err(dev, "Failed to map source address\n"); 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 339 reg->status = STATUS_SRC_ADDR_INVALID; 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 340 goto err_src_addr; 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 341 } 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 342 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 343 dst_addr = pci_epc_mem_alloc_addr(epc, &dst_phys_addr, reg->size); 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 344 if (!dst_addr) { 798c0441bec8c4 Gustavo Pimentel 2018-05-14 345 dev_err(dev, "Failed to allocate destination address\n"); 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 346 reg->status = STATUS_DST_ADDR_INVALID; 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 347 ret = -ENOMEM; 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 348 goto err_src_map_addr; 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 349 } 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 350 53fd3cbe5e9d79 Kishon Vijay Abraham I 2021-08-19 351 ret = pci_epc_map_addr(epc, epf->func_no, epf->vfunc_no, dst_phys_addr, 53fd3cbe5e9d79 Kishon Vijay Abraham I 2021-08-19 352 reg->dst_addr, reg->size); 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 353 if (ret) { 798c0441bec8c4 Gustavo Pimentel 2018-05-14 354 dev_err(dev, "Failed to map destination address\n"); 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 355 reg->status = STATUS_DST_ADDR_INVALID; 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 356 goto err_dst_addr; 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 357 } 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 358 5893c2e5353bb9 Kishon Vijay Abraham I 2020-03-16 359 ktime_get_ts64(&start); 5ebf3fc59bd20d Kishon Vijay Abraham I 2020-03-16 360 use_dma = !!(reg->flags & FLAG_USE_DMA); 5ebf3fc59bd20d Kishon Vijay Abraham I 2020-03-16 361 if (use_dma) { 5ebf3fc59bd20d Kishon Vijay Abraham I 2020-03-16 362 if (!epf_test->dma_supported) { 5ebf3fc59bd20d Kishon Vijay Abraham I 2020-03-16 363 dev_err(dev, "Cannot transfer data using DMA\n"); 5ebf3fc59bd20d Kishon Vijay Abraham I 2020-03-16 364 ret = -EINVAL; 5ebf3fc59bd20d Kishon Vijay Abraham I 2020-03-16 365 goto err_map_addr; 5ebf3fc59bd20d Kishon Vijay Abraham I 2020-03-16 366 } 5ebf3fc59bd20d Kishon Vijay Abraham I 2020-03-16 367 8353813c88ef21 Frank Li 2022-05-24 368 if (epf_test->dma_private) { 8353813c88ef21 Frank Li 2022-05-24 369 dev_err(dev, "Cannot transfer data using DMA\n"); 8353813c88ef21 Frank Li 2022-05-24 370 ret = -EINVAL; 8353813c88ef21 Frank Li 2022-05-24 371 goto err_map_addr; 8353813c88ef21 Frank Li 2022-05-24 372 } 8353813c88ef21 Frank Li 2022-05-24 373 5ebf3fc59bd20d Kishon Vijay Abraham I 2020-03-16 374 ret = pci_epf_test_data_transfer(epf_test, dst_phys_addr, 8353813c88ef21 Frank Li 2022-05-24 375 src_phys_addr, reg->size, 0, 8353813c88ef21 Frank Li 2022-05-24 376 DMA_MEM_TO_MEM); 5ebf3fc59bd20d Kishon Vijay Abraham I 2020-03-16 377 if (ret) 5ebf3fc59bd20d Kishon Vijay Abraham I 2020-03-16 378 dev_err(dev, "Data transfer failed\n"); 5ebf3fc59bd20d Kishon Vijay Abraham I 2020-03-16 379 } else { 829cc0e2ea2d61 Hou Zhiqiang 2021-12-17 380 void *buf; 829cc0e2ea2d61 Hou Zhiqiang 2021-12-17 381 829cc0e2ea2d61 Hou Zhiqiang 2021-12-17 382 buf = kzalloc(reg->size, GFP_KERNEL); 829cc0e2ea2d61 Hou Zhiqiang 2021-12-17 383 if (!buf) { 829cc0e2ea2d61 Hou Zhiqiang 2021-12-17 384 ret = -ENOMEM; 829cc0e2ea2d61 Hou Zhiqiang 2021-12-17 385 goto err_map_addr; 829cc0e2ea2d61 Hou Zhiqiang 2021-12-17 386 } 829cc0e2ea2d61 Hou Zhiqiang 2021-12-17 387 829cc0e2ea2d61 Hou Zhiqiang 2021-12-17 388 memcpy_fromio(buf, src_addr, reg->size); 829cc0e2ea2d61 Hou Zhiqiang 2021-12-17 389 memcpy_toio(dst_addr, buf, reg->size); 829cc0e2ea2d61 Hou Zhiqiang 2021-12-17 390 kfree(buf); 5ebf3fc59bd20d Kishon Vijay Abraham I 2020-03-16 391 } 5893c2e5353bb9 Kishon Vijay Abraham I 2020-03-16 392 ktime_get_ts64(&end); 5893c2e5353bb9 Kishon Vijay Abraham I 2020-03-16 393 pci_epf_test_print_rate("COPY", reg->size, &start, &end, use_dma); 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 394 5ebf3fc59bd20d Kishon Vijay Abraham I 2020-03-16 395 err_map_addr: 53fd3cbe5e9d79 Kishon Vijay Abraham I 2021-08-19 396 pci_epc_unmap_addr(epc, epf->func_no, epf->vfunc_no, dst_phys_addr); 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 397 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 398 err_dst_addr: 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 399 pci_epc_mem_free_addr(epc, dst_phys_addr, dst_addr, reg->size); 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 400 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 401 err_src_map_addr: 53fd3cbe5e9d79 Kishon Vijay Abraham I 2021-08-19 402 pci_epc_unmap_addr(epc, epf->func_no, epf->vfunc_no, src_phys_addr); 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 403 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 404 err_src_addr: 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 405 pci_epc_mem_free_addr(epc, src_phys_addr, src_addr, reg->size); 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 406 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 407 err: 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 408 return ret; 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 409 } 349e7a85b25fa6 Kishon Vijay Abraham I 2017-03-27 410 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests