Re: [PATCH V1 XDMA 1/1] dmaengine: xilinx: xdma: add xilinx xdma driver

From: kernel test robot
Date: Tue Aug 09 2022 - 23:47:37 EST


Hi Lizhi,

I love your patch! Perhaps something to improve:

[auto build test WARNING on vkoul-dmaengine/next]
[also build test WARNING on linus/master v5.19 next-20220809]
[cannot apply to xilinx-xlnx/master]
[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/Lizhi-Hou/xilinx-XDMA-driver/20220810-010405
base: https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine.git next
config: microblaze-randconfig-s042-20220810 (https://download.01.org/0day-ci/archive/20220810/202208101134.qoV0PSu7-lkp@xxxxxxxxx/config)
compiler: microblaze-linux-gcc (GCC) 12.1.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-39-gce1a6720-dirty
# https://github.com/intel-lab-lkp/linux/commit/097b3b1f980c265a944c1e61a27cd50493fd0608
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Lizhi-Hou/xilinx-XDMA-driver/20220810-010405
git checkout 097b3b1f980c265a944c1e61a27cd50493fd0608
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=microblaze SHELL=/bin/bash drivers/dma/xilinx/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>

sparse warnings: (new ones prefixed by >>)
>> drivers/dma/xilinx/xdma.c:872:18: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void *reg_base @@ got void [noderef] __iomem * @@
drivers/dma/xilinx/xdma.c:872:18: sparse: expected void *reg_base
drivers/dma/xilinx/xdma.c:872:18: sparse: got void [noderef] __iomem *
>> drivers/dma/xilinx/xdma.c:878:24: sparse: sparse: incorrect type in argument 3 (different address spaces) @@ expected void [noderef] __iomem *regs @@ got void *reg_base @@
drivers/dma/xilinx/xdma.c:878:24: sparse: expected void [noderef] __iomem *regs
drivers/dma/xilinx/xdma.c:878:24: sparse: got void *reg_base

vim +872 drivers/dma/xilinx/xdma.c

832
833 /**
834 * xdma_probe - Driver probe function
835 * @pdev: Pointer to the platform_device structure
836 */
837 static int xdma_probe(struct platform_device *pdev)
838 {
839 struct xdma_platdata *pdata = dev_get_platdata(&pdev->dev);
840 struct xdma_device *xdev;
841 struct resource *res;
842 int ret = -ENODEV;
843 void *reg_base;
844
845 if (pdata->max_dma_channels > XDMA_MAX_CHANNELS) {
846 dev_err(&pdev->dev, "invalid max dma channels %d",
847 pdata->max_dma_channels);
848 return -EINVAL;
849 }
850
851 xdev = devm_kzalloc(&pdev->dev, sizeof(*xdev), GFP_KERNEL);
852 if (!xdev)
853 return -ENOMEM;
854
855 platform_set_drvdata(pdev, xdev);
856 xdev->pdev = pdev;
857
858 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
859 if (!res) {
860 dev_err(&pdev->dev, "failed to get irq resource");
861 goto failed;
862 }
863 xdev->irq_start = res->start;
864 xdev->irq_num = res->end - res->start + 1;
865
866 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
867 if (!res) {
868 dev_err(&pdev->dev, "failed to get io resource");
869 goto failed;
870 }
871
> 872 reg_base = devm_ioremap_resource(&pdev->dev, res);
873 if (!reg_base) {
874 dev_err(&pdev->dev, "ioremap failed");
875 goto failed;
876 }
877
> 878 xdev->regmap = devm_regmap_init_mmio(&pdev->dev, reg_base,
879 &xdma_regmap_config);
880 if (!xdev->regmap) {
881 dev_err(&pdev->dev, "config regmap failed: %d", ret);
882 goto failed;
883 }
884 INIT_LIST_HEAD(&xdev->dma_dev.channels);
885
886 ret = xdma_config_channels(xdev, DMA_MEM_TO_DEV);
887 if (ret) {
888 dev_err(&pdev->dev, "config H2C channels failed: %d", ret);
889 goto failed;
890 }
891
892 ret = xdma_config_channels(xdev, DMA_DEV_TO_MEM);
893 if (ret) {
894 dev_err(&pdev->dev, "config C2H channels failed: %d", ret);
895 goto failed;
896 }
897
898 dma_cap_set(DMA_SLAVE, xdev->dma_dev.cap_mask);
899 dma_cap_set(DMA_PRIVATE, xdev->dma_dev.cap_mask);
900
901 xdev->dma_dev.dev = &pdev->dev;
902 xdev->dma_dev.device_free_chan_resources = xdma_free_chan_resources;
903 xdev->dma_dev.device_alloc_chan_resources = xdma_alloc_chan_resources;
904 xdev->dma_dev.device_tx_status = dma_cookie_status;
905 xdev->dma_dev.device_prep_slave_sg = xdma_prep_device_sg;
906 xdev->dma_dev.device_config = xdma_device_config;
907 xdev->dma_dev.device_issue_pending = xdma_issue_pending;
908 xdev->dma_dev.filter.map = pdata->device_map;
909 xdev->dma_dev.filter.mapcnt = pdata->device_map_cnt;
910 xdev->dma_dev.filter.fn = xdma_filter_fn;
911
912 ret = dma_async_device_register(&xdev->dma_dev);
913 if (ret) {
914 dev_err(&pdev->dev, "failed to register Xilinx XDMA: %d", ret);
915 goto failed;
916 }
917 xdev->status |= XDMA_DEV_STATUS_REG_DMA;
918
919 ret = xdma_irq_init(xdev);
920 if (ret) {
921 dev_err(&pdev->dev, "failed to init msix: %d", ret);
922 goto failed;
923 }
924 xdev->status |= XDMA_DEV_STATUS_INIT_MSIX;
925
926 return 0;
927
928 failed:
929 xdma_remove(pdev);
930
931 return ret;
932 }
933

--
0-DAY CI Kernel Test Service
https://01.org/lkp