Re: [PATCH v7 1/4] drm/loongson: Add DRM Driver for Loongson 7A1000 bridge chip

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Chenyang,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on drm/drm-next]
[also build test WARNING on v5.18-rc3 next-20220422]
[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/intel-lab-lkp/linux/commits/Chenyang-Li/drm-loongson-Add-DRM-Driver-for-Loongson-7A1000-bridge-chip/20220422-161914
base:   git://anongit.freedesktop.org/drm/drm drm-next
config: arm-randconfig-s031-20220422 (https://download.01.org/0day-ci/archive/20220423/202204230030.kZgmTGOQ-lkp@xxxxxxxxx/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.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-dirty
        # https://github.com/intel-lab-lkp/linux/commit/e9a9964d58e6cc797a113fa47f54583c10908d63
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Chenyang-Li/drm-loongson-Add-DRM-Driver-for-Loongson-7A1000-bridge-chip/20220422-161914
        git checkout e9a9964d58e6cc797a113fa47f54583c10908d63
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm SHELL=/bin/bash drivers/gpu/drm/loongson/

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


sparse warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/loongson/loongson_drv.c:91:9: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/gpu/drm/loongson/loongson_drv.c:99:5: sparse: sparse: symbol 'loongson_modeset_init' was not declared. Should it be static?

vim +/__iomem +91 drivers/gpu/drm/loongson/loongson_drv.c

    36	
    37	static int loongson_device_init(struct drm_device *dev)
    38	{
    39		struct loongson_device *ldev = to_loongson_device(dev);
    40		struct pci_dev *pdev = to_pci_dev(dev->dev);
    41		struct pci_dev *gpu_pdev;
    42		resource_size_t aper_base;
    43		resource_size_t aper_size;
    44		resource_size_t mmio_base;
    45		resource_size_t mmio_size;
    46		int ret;
    47	
    48		/* GPU MEM */
    49		/* We need get 7A-gpu pci device information for ldev->gpu_pdev */
    50		/* dev->pdev save 7A-dc pci device information */
    51		gpu_pdev = pci_get_device(PCI_VENDOR_ID_LOONGSON,
    52					  PCI_DEVICE_ID_LOONGSON_GPU, NULL);
    53		ret = pci_enable_device(gpu_pdev);
    54		if (ret)
    55			return ret;
    56		pci_set_drvdata(gpu_pdev, dev);
    57	
    58		aper_base = pci_resource_start(gpu_pdev, 2);
    59		aper_size = pci_resource_len(gpu_pdev, 2);
    60		ldev->vram_start = aper_base;
    61		ldev->vram_size = aper_size;
    62	
    63		if (!devm_request_mem_region(dev->dev, ldev->vram_start,
    64					     ldev->vram_size, "loongson_vram")) {
    65			drm_err(dev, "Can't reserve VRAM\n");
    66			return -ENXIO;
    67		}
    68	
    69		/* DC MEM */
    70		mmio_base = pci_resource_start(pdev, 0);
    71		mmio_size = pci_resource_len(pdev, 0);
    72		ldev->mmio = devm_ioremap(dev->dev, mmio_base, mmio_size);
    73		if (!ldev->mmio) {
    74			drm_err(dev, "Cannot map mmio region\n");
    75			return -ENOMEM;
    76		}
    77	
    78		if (!devm_request_mem_region(dev->dev, mmio_base,
    79					     mmio_size, "loongson_mmio")) {
    80			drm_err(dev, "Can't reserve mmio registers\n");
    81			return -ENOMEM;
    82		}
    83	
    84		/* DC IO */
    85		ldev->io = devm_ioremap(dev->dev, LS7A_CHIPCFG_REG_BASE, 0xf);
    86		if (!ldev->io)
    87			return -ENOMEM;
    88	
    89		ldev->num_crtc = 2;
    90	
  > 91		drm_info(dev, "DC mmio base 0x%llx size 0x%llx io 0x%llx\n",
    92			 mmio_base, mmio_size, *(u64 *)ldev->io);
    93		drm_info(dev, "GPU vram start = 0x%x size = 0x%x\n",
    94			 ldev->vram_start, ldev->vram_size);
    95	
    96		return 0;
    97	}
    98	

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



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux