Re: [PATCH 27/30] media: platform: vxd: Kconfig: Add Video decoder Kconfig and Makefile

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

 



Hi,

I love your patch! Yet something to improve:

[auto build test ERROR on linuxtv-media/master]
[also build test ERROR on staging/staging-testing driver-core/driver-core-testing linus/master v5.14-rc6 next-20210818]
[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/sidraya-bj-pathpartnertech-com/TI-Video-Decoder-driver-upstreaming-to-v5-14-rc6-kernel/20210818-221811
base:   git://linuxtv.org/media_tree.git master
config: mips-allyesconfig (attached as .config)
compiler: mips-linux-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://github.com/0day-ci/linux/commit/f42ae4f45639a6214f9e775d4280061bf52fc229
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review sidraya-bj-pathpartnertech-com/TI-Video-Decoder-driver-upstreaming-to-v5-14-rc6-kernel/20210818-221811
        git checkout f42ae4f45639a6214f9e775d4280061bf52fc229
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=mips 

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

All errors (new ones prefixed by >>):

   drivers/staging/media/vxd/decoder/../common/img_mem_unified.c: In function 'unified_free':
>> drivers/staging/media/vxd/decoder/../common/img_mem_unified.c:159:17: error: implicit declaration of function 'vunmap'; did you mean 'kunmap'? [-Werror=implicit-function-declaration]
     159 |                 vunmap(buffer->kptr);
         |                 ^~~~~~
         |                 kunmap
   drivers/staging/media/vxd/decoder/../common/img_mem_unified.c: In function 'unified_map_km':
>> drivers/staging/media/vxd/decoder/../common/img_mem_unified.c:197:24: error: implicit declaration of function 'vmap'; did you mean 'kmap'? [-Werror=implicit-function-declaration]
     197 |         buffer->kptr = vmap((struct page **)pages, num_pages, VM_MAP, prot);
         |                        ^~~~
         |                        kmap
>> drivers/staging/media/vxd/decoder/../common/img_mem_unified.c:197:63: error: 'VM_MAP' undeclared (first use in this function); did you mean 'VM_MTE'?
     197 |         buffer->kptr = vmap((struct page **)pages, num_pages, VM_MAP, prot);
         |                                                               ^~~~~~
         |                                                               VM_MTE
   drivers/staging/media/vxd/decoder/../common/img_mem_unified.c:197:63: note: each undeclared identifier is reported only once for each function it appears in
   cc1: some warnings being treated as errors


vim +159 drivers/staging/media/vxd/decoder/../common/img_mem_unified.c

76b88427fbba69 Sidraya 2021-08-18  145  
76b88427fbba69 Sidraya 2021-08-18  146  static void unified_free(struct heap *heap, struct buffer *buffer)
76b88427fbba69 Sidraya 2021-08-18  147  {
76b88427fbba69 Sidraya 2021-08-18  148  	void *dev = buffer->device;
76b88427fbba69 Sidraya 2021-08-18  149  	void *sgt = buffer->priv;
76b88427fbba69 Sidraya 2021-08-18  150  	void *sgl;
76b88427fbba69 Sidraya 2021-08-18  151  
76b88427fbba69 Sidraya 2021-08-18  152  	dev_dbg(dev, "%s:%d buffer %d (0x%p)\n", __func__, __LINE__,
76b88427fbba69 Sidraya 2021-08-18  153  		buffer->id, buffer);
76b88427fbba69 Sidraya 2021-08-18  154  
76b88427fbba69 Sidraya 2021-08-18  155  	if (buffer->kptr) {
76b88427fbba69 Sidraya 2021-08-18  156  		dev_dbg(dev, "%s vunmap 0x%p\n", __func__, buffer->kptr);
76b88427fbba69 Sidraya 2021-08-18  157  		dma_unmap_sg(dev, img_mmu_get_sgl(sgt), img_mmu_get_orig_nents(sgt),
76b88427fbba69 Sidraya 2021-08-18  158  			     DMA_FROM_DEVICE);
76b88427fbba69 Sidraya 2021-08-18 @159  		vunmap(buffer->kptr);
76b88427fbba69 Sidraya 2021-08-18  160  	}
76b88427fbba69 Sidraya 2021-08-18  161  
76b88427fbba69 Sidraya 2021-08-18  162  	sgl = img_mmu_get_sgl(sgt);
76b88427fbba69 Sidraya 2021-08-18  163  	while (sgl) {
76b88427fbba69 Sidraya 2021-08-18  164  		__free_page(sg_page(sgl));
76b88427fbba69 Sidraya 2021-08-18  165  		sgl = sg_next(sgl);
76b88427fbba69 Sidraya 2021-08-18  166  	}
76b88427fbba69 Sidraya 2021-08-18  167  	sg_free_table(sgt);
76b88427fbba69 Sidraya 2021-08-18  168  	kfree(sgt);
76b88427fbba69 Sidraya 2021-08-18  169  }
76b88427fbba69 Sidraya 2021-08-18  170  
76b88427fbba69 Sidraya 2021-08-18  171  static int unified_map_km(struct heap *heap, struct buffer *buffer)
76b88427fbba69 Sidraya 2021-08-18  172  {
76b88427fbba69 Sidraya 2021-08-18  173  	void *dev = buffer->device;
76b88427fbba69 Sidraya 2021-08-18  174  	void *sgt = buffer->priv;
76b88427fbba69 Sidraya 2021-08-18  175  	void *sgl = img_mmu_get_sgl(sgt);
76b88427fbba69 Sidraya 2021-08-18  176  	unsigned int num_pages = sg_nents(sgl);
76b88427fbba69 Sidraya 2021-08-18  177  	unsigned int orig_nents = img_mmu_get_orig_nents(sgt);
76b88427fbba69 Sidraya 2021-08-18  178  	void **pages;
76b88427fbba69 Sidraya 2021-08-18  179  	int ret;
76b88427fbba69 Sidraya 2021-08-18  180  	pgprot_t prot;
76b88427fbba69 Sidraya 2021-08-18  181  
76b88427fbba69 Sidraya 2021-08-18  182  	dev_dbg(dev, "%s:%d buffer %d (0x%p)\n", __func__, __LINE__, buffer->id, buffer);
76b88427fbba69 Sidraya 2021-08-18  183  
76b88427fbba69 Sidraya 2021-08-18  184  	if (buffer->kptr) {
76b88427fbba69 Sidraya 2021-08-18  185  		dev_warn(dev, "%s called for already mapped buffer %d\n", __func__, buffer->id);
76b88427fbba69 Sidraya 2021-08-18  186  		return 0;
76b88427fbba69 Sidraya 2021-08-18  187  	}
76b88427fbba69 Sidraya 2021-08-18  188  
76b88427fbba69 Sidraya 2021-08-18  189  	pages = kmalloc_array(num_pages, sizeof(void *), GFP_KERNEL);
76b88427fbba69 Sidraya 2021-08-18  190  	if (!pages)
76b88427fbba69 Sidraya 2021-08-18  191  		return -ENOMEM;
76b88427fbba69 Sidraya 2021-08-18  192  
76b88427fbba69 Sidraya 2021-08-18  193  	img_mmu_get_pages(pages, sgt);
76b88427fbba69 Sidraya 2021-08-18  194  
76b88427fbba69 Sidraya 2021-08-18  195  	prot = PAGE_KERNEL;
76b88427fbba69 Sidraya 2021-08-18  196  	prot = pgprot_writecombine(prot);
76b88427fbba69 Sidraya 2021-08-18 @197  	buffer->kptr = vmap((struct page **)pages, num_pages, VM_MAP, prot);
76b88427fbba69 Sidraya 2021-08-18  198  	kfree(pages);
76b88427fbba69 Sidraya 2021-08-18  199  	if (!buffer->kptr) {
76b88427fbba69 Sidraya 2021-08-18  200  		dev_err(dev, "%s vmap failed!\n", __func__);
76b88427fbba69 Sidraya 2021-08-18  201  		return -EFAULT;
76b88427fbba69 Sidraya 2021-08-18  202  	}
76b88427fbba69 Sidraya 2021-08-18  203  
76b88427fbba69 Sidraya 2021-08-18  204  	ret = dma_map_sg(dev, sgl, orig_nents, DMA_FROM_DEVICE);
76b88427fbba69 Sidraya 2021-08-18  205  
76b88427fbba69 Sidraya 2021-08-18  206  	if (ret <= 0) {
76b88427fbba69 Sidraya 2021-08-18  207  		dev_err(dev, "%s dma_map_sg failed!\n", __func__);
76b88427fbba69 Sidraya 2021-08-18  208  		vunmap(buffer->kptr);
76b88427fbba69 Sidraya 2021-08-18  209  		return -EFAULT;
76b88427fbba69 Sidraya 2021-08-18  210  	}
76b88427fbba69 Sidraya 2021-08-18  211  	dev_dbg(dev, "%s:%d buffer %d orig_nents %d nents %d\n", __func__,
76b88427fbba69 Sidraya 2021-08-18  212  		__LINE__, buffer->id, orig_nents, ret);
76b88427fbba69 Sidraya 2021-08-18  213  
76b88427fbba69 Sidraya 2021-08-18  214  	img_mmu_set_sgt_nents(sgt, ret);
76b88427fbba69 Sidraya 2021-08-18  215  
76b88427fbba69 Sidraya 2021-08-18  216  	dev_dbg(dev, "%s:%d buffer %d vmap to 0x%p\n", __func__, __LINE__,
76b88427fbba69 Sidraya 2021-08-18  217  		buffer->id, buffer->kptr);
76b88427fbba69 Sidraya 2021-08-18  218  
76b88427fbba69 Sidraya 2021-08-18  219  	return 0;
76b88427fbba69 Sidraya 2021-08-18  220  }
76b88427fbba69 Sidraya 2021-08-18  221  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux