* [arnd-asm-generic:dma-sync-rework 20/20] include/linux/dma-sync.h:24:6: warning: no previous prototype for 'arch_sync_dma_for_device'
@ 2023-03-25 2:09 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-03-25 2:09 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: oe-kbuild-all, linux-arch
tree: https://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git dma-sync-rework
head: 985cd64f3b17b82468e68c6269e09a5556d3720e
commit: 9a711fbea373208c1eeb2fafb0c744bc23a79a43 [20/20] dma-mapping: replace custom code with generic implementation
config: nios2-defconfig (https://download.01.org/0day-ci/archive/20230325/202303251037.tsdm8i6z-lkp@intel.com/config)
compiler: nios2-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=9a711fbea373208c1eeb2fafb0c744bc23a79a43
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 9a711fbea373208c1eeb2fafb0c744bc23a79a43
# 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=nios2 olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=nios2 SHELL=/bin/bash arch/nios2/mm/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303251037.tsdm8i6z-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from arch/nios2/mm/dma-mapping.c:53:
>> include/linux/dma-sync.h:24:6: warning: no previous prototype for 'arch_sync_dma_for_device' [-Wmissing-prototypes]
24 | void arch_sync_dma_for_device(phys_addr_t paddr, size_t size,
| ^~~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/dma-sync.h:86:6: warning: no previous prototype for 'arch_sync_dma_for_cpu' [-Wmissing-prototypes]
86 | void arch_sync_dma_for_cpu(phys_addr_t paddr, size_t size,
| ^~~~~~~~~~~~~~~~~~~~~
arch/nios2/mm/dma-mapping.c:55:6: warning: no previous prototype for 'arch_dma_prep_coherent' [-Wmissing-prototypes]
55 | void arch_dma_prep_coherent(struct page *page, size_t size)
| ^~~~~~~~~~~~~~~~~~~~~~
arch/nios2/mm/dma-mapping.c:62:7: warning: no previous prototype for 'arch_dma_set_uncached' [-Wmissing-prototypes]
62 | void *arch_dma_set_uncached(void *ptr, size_t size)
| ^~~~~~~~~~~~~~~~~~~~~
vim +/arch_sync_dma_for_device +24 include/linux/dma-sync.h
> 24 void arch_sync_dma_for_device(phys_addr_t paddr, size_t size,
25 enum dma_data_direction dir)
26 {
27 switch (dir) {
28 case DMA_TO_DEVICE:
29 /*
30 * This may be an empty function on write-through caches,
31 * and it might invalidate the cache if an architecture has
32 * a write-back cache but no way to write it back without
33 * invalidating
34 */
35 arch_dma_cache_wback(paddr, size);
36 break;
37
38 case DMA_FROM_DEVICE:
39 /*
40 * FIXME: this should be handled the same across all
41 * architectures, see
42 * https://lore.kernel.org/all/20220606152150.GA31568@willie-the-truck/
43 */
44 if (!arch_sync_dma_clean_before_fromdevice()) {
45 arch_dma_cache_inv(paddr, size);
46 break;
47 }
48 fallthrough;
49
50 case DMA_BIDIRECTIONAL:
51 /* Skip the invalidate here if it's done later */
52 if (IS_ENABLED(CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU) &&
53 arch_sync_dma_cpu_needs_post_dma_flush())
54 arch_dma_cache_wback(paddr, size);
55 else
56 arch_dma_cache_wback_inv(paddr, size);
57 break;
58
59 default:
60 break;
61 }
62 }
63
64 #ifdef CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU
65 /*
66 * Mark the D-cache clean for these pages to avoid extra flushing.
67 */
68 static void arch_dma_mark_dcache_clean(phys_addr_t paddr, size_t size)
69 {
70 #ifdef CONFIG_ARCH_DMA_MARK_DCACHE_CLEAN
71 unsigned long pfn = PFN_UP(paddr);
72 unsigned long off = paddr & (PAGE_SIZE - 1);
73 size_t left = size;
74
75 if (off)
76 left -= PAGE_SIZE - off;
77
78 while (left >= PAGE_SIZE) {
79 struct page *page = pfn_to_page(pfn++);
80 set_bit(PG_dcache_clean, &page->flags);
81 left -= PAGE_SIZE;
82 }
83 #endif
84 }
85
> 86 void arch_sync_dma_for_cpu(phys_addr_t paddr, size_t size,
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-03-25 2:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-25 2:09 [arnd-asm-generic:dma-sync-rework 20/20] include/linux/dma-sync.h:24:6: warning: no previous prototype for 'arch_sync_dma_for_device' kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.