[arnd-asm-generic:dma-sync-rework 5/20] arch/powerpc/mm/dma-noncoherent.c:91:59: error: unknown type name 'dma_cache_op'

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

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git dma-sync-rework
head:   9a711fbea373208c1eeb2fafb0c744bc23a79a43
commit: 8c96c581a246a71ec30a3971cdf7b702b22bb537 [5/20] powerpc: dma-mapping: split out cache operation logic
config: powerpc-randconfig-r013-20230322 (https://download.01.org/0day-ci/archive/20230324/202303242353.M76EyrYe-lkp@xxxxxxxxx/config)
compiler: powerpc-linux-gcc (GCC) 12.1.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/arnd/asm-generic.git/commit/?id=8c96c581a246a71ec30a3971cdf7b702b22bb537
        git remote add arnd-asm-generic https://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git
        git fetch --no-tags arnd-asm-generic dma-sync-rework
        git checkout 8c96c581a246a71ec30a3971cdf7b702b22bb537
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=powerpc olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=powerpc SHELL=/bin/bash arch/powerpc/mm/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Link: https://lore.kernel.org/oe-kbuild-all/202303242353.M76EyrYe-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

>> arch/powerpc/mm/dma-noncoherent.c:91:59: error: unknown type name 'dma_cache_op'
      91 | static void __dma_phys_op(phys_addr_t paddr, size_t size, dma_cache_op op)
         |                                                           ^~~~~~~~~~~~
   arch/powerpc/mm/dma-noncoherent.c: In function 'arch_sync_dma_for_device':
   arch/powerpc/mm/dma-noncoherent.c:107:17: error: 'direction' undeclared (first use in this function); did you mean 'irqaction'?
     107 |         switch (direction) {
         |                 ^~~~~~~~~
         |                 irqaction
   arch/powerpc/mm/dma-noncoherent.c:107:17: note: each undeclared identifier is reported only once for each function it appears in
>> arch/powerpc/mm/dma-noncoherent.c:115:22: error: 'start' undeclared (first use in this function); did you mean 'stat'?
     115 |                 if ((start | end) & (L1_CACHE_BYTES - 1))
         |                      ^~~~~
         |                      stat
>> arch/powerpc/mm/dma-noncoherent.c:115:30: error: 'end' undeclared (first use in this function); did you mean '_end'?
     115 |                 if ((start | end) & (L1_CACHE_BYTES - 1))
         |                              ^~~
         |                              _end
>> arch/powerpc/mm/dma-noncoherent.c:116:25: error: implicit declaration of function '__dma_phys_op'; did you mean '__dma_op'? [-Werror=implicit-function-declaration]
     116 |                         __dma_phys_op(start, end, DMA_CACHE_FLUSH);
         |                         ^~~~~~~~~~~~~
         |                         __dma_op
   arch/powerpc/mm/dma-noncoherent.c: In function 'arch_sync_dma_for_cpu':
   arch/powerpc/mm/dma-noncoherent.c:132:17: error: 'direction' undeclared (first use in this function); did you mean 'irqaction'?
     132 |         switch (direction) {
         |                 ^~~~~~~~~
         |                 irqaction
   arch/powerpc/mm/dma-noncoherent.c:140:22: error: 'start' undeclared (first use in this function); did you mean 'stat'?
     140 |                 if ((start | end) & (L1_CACHE_BYTES - 1))
         |                      ^~~~~
         |                      stat
   arch/powerpc/mm/dma-noncoherent.c:140:30: error: 'end' undeclared (first use in this function); did you mean '_end'?
     140 |                 if ((start | end) & (L1_CACHE_BYTES - 1))
         |                              ^~~
         |                              _end
   cc1: all warnings being treated as errors


vim +/dma_cache_op +91 arch/powerpc/mm/dma-noncoherent.c

    86	
    87	/*
    88	 * __dma_phys_op makes memory consistent. identical to __dma_op, but
    89	 * takes a phys_addr_t instead of a virtual address
    90	 */
  > 91	static void __dma_phys_op(phys_addr_t paddr, size_t size, dma_cache_op op)
    92	{
    93		struct page *page = pfn_to_page(paddr >> PAGE_SHIFT);
    94		unsigned offset = paddr & ~PAGE_MASK;
    95	
    96	#ifdef CONFIG_HIGHMEM
    97		__dma_highmem_op(page, offset, size, op);
    98	#else
    99		unsigned long start = (unsigned long)page_address(page) + offset;
   100		__dma_op((void *)start, size, op);
   101	#endif
   102	}
   103	
   104	void arch_sync_dma_for_device(phys_addr_t paddr, size_t size,
   105			enum dma_data_direction dir)
   106	{
   107		switch (direction) {
   108		case DMA_NONE:
   109			BUG();
   110		case DMA_FROM_DEVICE:
   111			/*
   112			 * invalidate only when cache-line aligned otherwise there is
   113			 * the potential for discarding uncommitted data from the cache
   114			 */
 > 115			if ((start | end) & (L1_CACHE_BYTES - 1))
 > 116				__dma_phys_op(start, end, DMA_CACHE_FLUSH);
   117			else
   118				__dma_phys_op(start, end, DMA_CACHE_INVAL);
   119			break;
   120		case DMA_TO_DEVICE:		/* writeback only */
   121			__dma_phys_op(start, end, DMA_CACHE_CLEAN);
   122			break;
   123		case DMA_BIDIRECTIONAL:	/* writeback and invalidate */
   124			__dma_phys_op(start, end, DMA_CACHE_FLUSH);
   125			break;
   126		}
   127	}
   128	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests



[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux