Content-Type: multipart/mixed; boundary="===============5016902872598365050==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: Re: [PATCH v1 3/3] mmc: Add driver for LiteX's LiteSDCard interface Date: Sat, 04 Dec 2021 12:41:47 +0800 Message-ID: <202112041255.X6DL0sKx-lkp@intel.com> In-Reply-To: <20211203234155.2319803-4-gsomlo@gmail.com> List-Id: --===============5016902872598365050== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi Gabriel, I love your patch! Yet something to improve: [auto build test ERROR on robh/for-next] [also build test ERROR on linux/master ulf-hansson-mmc-mirror/next linus/ma= ster v5.16-rc3 next-20211203] [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/Gabriel-Somlo/mmc-Add-Lite= SDCard-mmc-driver/20211204-074318 base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-= next config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20211204/2= 02112041255.X6DL0sKx-lkp(a)intel.com/config) compiler: sh4-linux-gcc (GCC) 11.2.0 reproduce (this is a W=3D1 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/0day-ci/linux/commit/f967027b6ffe6f577773d3607= edcf6677f7e56c5 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Gabriel-Somlo/mmc-Add-LiteSDCard-m= mc-driver/20211204-074318 git checkout f967027b6ffe6f577773d3607edcf6677f7e56c5 # save the config file to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dgcc-11.2.0 make.cross= O=3Dbuild_dir ARCH=3Dsh SHELL=3D/bin/bash drivers/mmc/host/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All errors (new ones prefixed by >>): drivers/mmc/host/litex_mmc.c: In function 'litex_mmc_probe': >> drivers/mmc/host/litex_mmc.c:617:23: error: implicit declaration of func= tion 'request_irq'; did you mean 'request_key'? [-Werror=3Dimplicit-functio= n-declaration] 617 | ret =3D request_irq(host->irq, litex_mmc_interru= pt, 0, | ^~~~~~~~~~~ | request_key drivers/mmc/host/litex_mmc.c: In function 'litex_mmc_remove': >> drivers/mmc/host/litex_mmc.c:651:17: error: implicit declaration of func= tion 'free_irq' [-Werror=3Dimplicit-function-declaration] 651 | free_irq(host->irq, host->mmc); | ^~~~~~~~ cc1: some warnings being treated as errors vim +617 drivers/mmc/host/litex_mmc.c 496 = 497 static int 498 litex_mmc_probe(struct platform_device *pdev) 499 { 500 struct litex_mmc_host *host; 501 struct mmc_host *mmc; 502 struct device_node *cpu; 503 int ret; 504 = 505 mmc =3D mmc_alloc_host(sizeof(struct litex_mmc_host), &pdev->dev); 506 /* NOTE: defaults to max_[req,seg]_size=3DPAGE_SIZE, max_blk_size= =3D512, 507 * and max_blk_count accordingly set to 8; 508 * If for some reason we need to modify max_blk_count, we must also 509 * re-calculate `max_[req,seg]_size =3D max_blk_size * max_blk_coun= t;` 510 */ 511 if (!mmc) 512 return -ENOMEM; 513 = 514 host =3D mmc_priv(mmc); 515 host->mmc =3D mmc; 516 host->dev =3D pdev; 517 = 518 host->clock =3D 0; 519 cpu =3D of_get_next_cpu_node(NULL); 520 ret =3D of_property_read_u32(cpu, "clock-frequency", &host->freq); 521 of_node_put(cpu); 522 if (ret) { 523 dev_err(&pdev->dev, "No \"clock-frequency\" property in DT\n"); 524 goto err_free_host; 525 } 526 = 527 init_completion(&host->cmd_done); 528 host->irq =3D platform_get_irq(pdev, 0); 529 if (host->irq < 0) 530 dev_err(&pdev->dev, "Failed to get IRQ, using polling\n"); 531 = 532 /* LiteSDCard only supports 4-bit bus width; therefore, we MUST inj= ect 533 * a SET_BUS_WIDTH (acmd6) before the very first data transfer, ear= lier 534 * than when the mmc subsystem would normally get around to it! 535 */ 536 host->is_bus_width_set =3D false; 537 host->app_cmd =3D false; 538 = 539 ret =3D dma_set_mask(&pdev->dev, DMA_BIT_MASK(32)); 540 if (ret) 541 goto err_free_host; 542 = 543 host->buf_size =3D mmc->max_req_size * 2; 544 host->buffer =3D dma_alloc_coherent(&pdev->dev, host->buf_size, 545 &host->dma, GFP_DMA); 546 if (host->buffer =3D=3D NULL) { 547 ret =3D -ENOMEM; 548 goto err_free_host; 549 } 550 = 551 host->sdphy =3D devm_platform_ioremap_resource_byname(pdev, "phy"); 552 if (IS_ERR(host->sdphy)) { 553 ret =3D PTR_ERR(host->sdphy); 554 goto err_free_dma; 555 } 556 = 557 host->sdcore =3D devm_platform_ioremap_resource_byname(pdev, "core"= ); 558 if (IS_ERR(host->sdcore)) { 559 ret =3D PTR_ERR(host->sdcore); 560 goto err_free_dma; 561 } 562 = 563 host->sdreader =3D devm_platform_ioremap_resource_byname(pdev, "rea= der"); 564 if (IS_ERR(host->sdreader)) { 565 ret =3D PTR_ERR(host->sdreader); 566 goto err_free_dma; 567 } 568 = 569 host->sdwriter =3D devm_platform_ioremap_resource_byname(pdev, "wri= ter"); 570 if (IS_ERR(host->sdwriter)) { 571 ret =3D PTR_ERR(host->sdwriter); 572 goto err_free_dma; 573 } 574 = 575 if (host->irq > 0) { 576 host->sdirq =3D devm_platform_ioremap_resource_byname(pdev, "irq"); 577 if (IS_ERR(host->sdirq)) { 578 ret =3D PTR_ERR(host->sdirq); 579 goto err_free_dma; 580 } 581 } 582 = 583 mmc->ocr_avail =3D MMC_VDD_32_33 | MMC_VDD_33_34; 584 mmc->ops =3D &litex_mmc_ops; 585 = 586 mmc->f_min =3D 12.5e6; 587 mmc->f_max =3D 50e6; 588 = 589 ret =3D mmc_of_parse(mmc); 590 if (ret) 591 goto err_free_dma; 592 = 593 /* force 4-bit bus_width (only width supported by hardware) */ 594 mmc->caps &=3D ~MMC_CAP_8_BIT_DATA; 595 mmc->caps |=3D MMC_CAP_4_BIT_DATA; 596 = 597 /* set default capabilities */ 598 mmc->caps |=3D MMC_CAP_WAIT_WHILE_BUSY | 599 MMC_CAP_DRIVER_TYPE_D | 600 MMC_CAP_CMD23; 601 mmc->caps2 |=3D MMC_CAP2_NO_WRITE_PROTECT | 602 MMC_CAP2_FULL_PWR_CYCLE | 603 MMC_CAP2_NO_SDIO; 604 = 605 platform_set_drvdata(pdev, host); 606 = 607 ret =3D mmc_add_host(mmc); 608 if (ret < 0) 609 goto err_free_dma; 610 = 611 /* ensure DMA bus masters are disabled */ 612 litex_write8(host->sdreader + LITEX_BLK2MEM_ENA, 0); 613 litex_write8(host->sdwriter + LITEX_MEM2BLK_ENA, 0); 614 = 615 /* set up interrupt handler */ 616 if (host->irq > 0) { > 617 ret =3D request_irq(host->irq, litex_mmc_interrupt, 0, 618 "litex-mmc", mmc); 619 if (ret < 0) { 620 dev_err(&pdev->dev, 621 "irq setup error %d, using polling\n", ret); 622 host->irq =3D 0; 623 } 624 } 625 = 626 /* enable card-change interrupts, or else ask for polling */ 627 if (host->irq > 0) { 628 litex_write32(host->sdirq + LITEX_IRQ_PENDING, 629 SDIRQ_CARD_DETECT); /* clears it */ 630 litex_write32(host->sdirq + LITEX_IRQ_ENABLE, 631 SDIRQ_CARD_DETECT); 632 } else { 633 mmc->caps |=3D MMC_CAP_NEEDS_POLL; 634 } 635 = 636 return 0; 637 = 638 err_free_dma: 639 dma_free_coherent(&pdev->dev, host->buf_size, host->buffer, host->d= ma); 640 err_free_host: 641 mmc_free_host(mmc); 642 return ret; 643 } 644 = 645 static int 646 litex_mmc_remove(struct platform_device *pdev) 647 { 648 struct litex_mmc_host *host =3D dev_get_drvdata(&pdev->dev); 649 = 650 if (host->irq > 0) > 651 free_irq(host->irq, host->mmc); 652 mmc_remove_host(host->mmc); 653 dma_free_coherent(&pdev->dev, host->buf_size, host->buffer, host->d= ma); 654 mmc_free_host(host->mmc); 655 = 656 return 0; 657 } 658 = --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org --===============5016902872598365050==--