[dinguyen:socfpga-5.14_v1 2/121] arch/arm/mach-socfpga/fpga-dma.c:571:15: error: implicit declaration of function 'devm_ioremap_nocache'; did you mean 'devm_ioremap_release'?
From: kernel test robot
Date: Sun Nov 07 2021 - 04:41:19 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux.git socfpga-5.14_v1
head: cc7ba8d9b34b85acfbeefb77fa57c116c733c2c4
commit: c20d1db912279c6f64211ade1e47b3e4c6eeb436 [2/121] FogBugz #172665: Sample driver for DMA transfer to FPGA soft IP (FIFO)
config: arm-allyesconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.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://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux.git/commit/?id=c20d1db912279c6f64211ade1e47b3e4c6eeb436
git remote add dinguyen https://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux.git
git fetch --no-tags dinguyen socfpga-5.14_v1
git checkout c20d1db912279c6f64211ade1e47b3e4c6eeb436
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
All error/warnings (new ones prefixed by >>):
arch/arm/mach-socfpga/fpga-dma.c: In function 'fpga_dma_dma_start_rx':
>> arch/arm/mach-socfpga/fpga-dma.c:422:13: warning: variable 'num_words' set but not used [-Wunused-but-set-variable]
422 | int num_words;
| ^~~~~~~~~
arch/arm/mach-socfpga/fpga-dma.c: In function 'fpga_dma_dma_start_tx':
arch/arm/mach-socfpga/fpga-dma.c:474:13: warning: variable 'num_words' set but not used [-Wunused-but-set-variable]
474 | int num_words;
| ^~~~~~~~~
arch/arm/mach-socfpga/fpga-dma.c: In function 'request_and_map':
>> arch/arm/mach-socfpga/fpga-dma.c:571:15: error: implicit declaration of function 'devm_ioremap_nocache'; did you mean 'devm_ioremap_release'? [-Werror=implicit-function-declaration]
571 | ptr = devm_ioremap_nocache(&pdev->dev, res->start, resource_size(res));
| ^~~~~~~~~~~~~~~~~~~~
| devm_ioremap_release
>> arch/arm/mach-socfpga/fpga-dma.c:571:13: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
571 | ptr = devm_ioremap_nocache(&pdev->dev, res->start, resource_size(res));
| ^
cc1: some warnings being treated as errors
vim +571 arch/arm/mach-socfpga/fpga-dma.c
412
413 static int fpga_dma_dma_start_rx(struct platform_device *pdev,
414 unsigned datalen, unsigned char *databuf,
415 u32 burst_size)
416 {
417 struct fpga_dma_pdata *pdata = platform_get_drvdata(pdev);
418 struct dma_chan *dmachan;
419 struct dma_slave_config dmaconf;
420 struct dma_async_tx_descriptor *dmadesc = NULL;
421
> 422 int num_words;
423
424 num_words = word_to_bytes(pdata, datalen);
425
426 dmachan = pdata->rxchan;
427 memset(&dmaconf, 0, sizeof(dmaconf));
428 dmaconf.direction = DMA_DEV_TO_MEM;
429 dmaconf.src_addr = pdata->data_reg_phy + ALT_FPGADMA_DATA_READ;
430 dmaconf.src_addr_width = 8;
431 dmaconf.src_maxburst = burst_size;
432
433 pdata->rx_dma_addr = dma_map_single(&pdev->dev,
434 databuf, datalen, DMA_FROM_DEVICE);
435 if (dma_mapping_error(&pdev->dev, pdata->rx_dma_addr)) {
436 dev_err(&pdev->dev, "dma_map_single for RX failed\n");
437 return -EINVAL;
438 }
439
440 /* set up slave config */
441 dmaengine_slave_config(dmachan, &dmaconf);
442
443 /* get dmadesc */
444 dmadesc = dmaengine_prep_slave_single(dmachan,
445 pdata->rx_dma_addr,
446 datalen,
447 dmaconf.direction,
448 DMA_PREP_INTERRUPT);
449 if (!dmadesc) {
450 fpga_dma_dma_cleanup(pdev, datalen, IS_DMA_READ);
451 return -ENOMEM;
452 }
453 dmadesc->callback = fpga_dma_dma_rx_done;
454 dmadesc->callback_param = pdata;
455
456 /* start DMA */
457 pdata->rx_cookie = dmaengine_submit(dmadesc);
458 if (dma_submit_error(pdata->rx_cookie))
459 dev_err(&pdev->dev, "rx_cookie error on dmaengine_submit\n");
460 dma_async_issue_pending(dmachan);
461
462 return 0;
463 }
464
465 static int fpga_dma_dma_start_tx(struct platform_device *pdev,
466 unsigned datalen, unsigned char *databuf,
467 u32 burst_size)
468 {
469 struct fpga_dma_pdata *pdata = platform_get_drvdata(pdev);
470 struct dma_chan *dmachan;
471 struct dma_slave_config dmaconf;
472 struct dma_async_tx_descriptor *dmadesc = NULL;
473
> 474 int num_words;
475
476 num_words = word_to_bytes(pdata, datalen);
477
478 dmachan = pdata->txchan;
479 memset(&dmaconf, 0, sizeof(dmaconf));
480 dmaconf.direction = DMA_MEM_TO_DEV;
481 dmaconf.dst_addr = pdata->data_reg_phy + ALT_FPGADMA_DATA_WRITE;
482 dmaconf.dst_addr_width = 8;
483 dmaconf.dst_maxburst = burst_size;
484 pdata->tx_dma_addr = dma_map_single(&pdev->dev,
485 databuf, datalen, DMA_TO_DEVICE);
486 if (dma_mapping_error(&pdev->dev, pdata->tx_dma_addr)) {
487 dev_err(&pdev->dev, "dma_map_single for TX failed\n");
488 return -EINVAL;
489 }
490
491 /* set up slave config */
492 dmaengine_slave_config(dmachan, &dmaconf);
493
494 /* get dmadesc */
495 dmadesc = dmaengine_prep_slave_single(dmachan,
496 pdata->tx_dma_addr,
497 datalen,
498 dmaconf.direction,
499 DMA_PREP_INTERRUPT);
500 if (!dmadesc) {
501 fpga_dma_dma_cleanup(pdev, datalen, IS_DMA_WRITE);
502 return -ENOMEM;
503 }
504 dmadesc->callback = fpga_dma_dma_tx_done;
505 dmadesc->callback_param = pdata;
506
507 /* start DMA */
508 pdata->tx_cookie = dmaengine_submit(dmadesc);
509 if (dma_submit_error(pdata->tx_cookie))
510 dev_err(&pdev->dev, "tx_cookie error on dmaengine_submit\n");
511 dma_async_issue_pending(dmachan);
512
513 return 0;
514 }
515
516 static void fpga_dma_dma_shutdown(struct fpga_dma_pdata *pdata)
517 {
518 if (pdata->txchan) {
519 dmaengine_terminate_all(pdata->txchan);
520 dma_release_channel(pdata->txchan);
521 }
522 if (pdata->rxchan) {
523 dmaengine_terminate_all(pdata->rxchan);
524 dma_release_channel(pdata->rxchan);
525 }
526 pdata->rxchan = pdata->txchan = NULL;
527 }
528
529 static int fpga_dma_dma_init(struct fpga_dma_pdata *pdata)
530 {
531 struct platform_device *pdev = pdata->pdev;
532
533 pdata->txchan = dma_request_slave_channel(&pdev->dev, "tx");
534 if (pdata->txchan)
535 dev_dbg(&pdev->dev, "TX channel %s %d selected\n",
536 dma_chan_name(pdata->txchan), pdata->txchan->chan_id);
537 else
538 dev_err(&pdev->dev, "could not get TX dma channel\n");
539
540 pdata->rxchan = dma_request_slave_channel(&pdev->dev, "rx");
541 if (pdata->rxchan)
542 dev_dbg(&pdev->dev, "RX channel %s %d selected\n",
543 dma_chan_name(pdata->rxchan), pdata->rxchan->chan_id);
544 else
545 dev_err(&pdev->dev, "could not get RX dma channel\n");
546
547 if (!pdata->rxchan && !pdata->txchan)
548 /* both channels not there, maybe it's
549 bcs dma isn't loaded... */
550 return -EPROBE_DEFER;
551
552 if (!pdata->rxchan || !pdata->txchan)
553 return -ENOMEM;
554
555 return 0;
556 }
557
558 /* --------------------------------------------------------------------- */
559
560 static void __iomem *request_and_map(struct platform_device *pdev,
561 const struct resource *res)
562 {
563 void __iomem *ptr;
564
565 if (!devm_request_mem_region(&pdev->dev, res->start, resource_size(res),
566 pdev->name)) {
567 dev_err(&pdev->dev, "unable to request %s\n", res->name);
568 return NULL;
569 }
570
> 571 ptr = devm_ioremap_nocache(&pdev->dev, res->start, resource_size(res));
572 if (!ptr)
573 dev_err(&pdev->dev, "ioremap_nocache of %s failed!", res->name);
574
575 return ptr;
576 }
577
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip