tree:
https://github.com/sbates130272/linux-p2pmem.git martin/map_sg_cleanup
head: eafab2a966d95c80db362d536a3e1bb2444be72d
commit: 791c15fb5de785e78fb8c844d3d218c03d193e2c [5/15] MIPS/jazzdma: return error code
from vdma_alloc()
config: mips-jazz_defconfig (attached as .config)
compiler: mipsel-linux-gcc (GCC) 9.3.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/sbates130272/linux-p2pmem/commit/791c15fb5de785e78fb8c...
git remote add p2pmem
https://github.com/sbates130272/linux-p2pmem.git
git fetch --no-tags p2pmem martin/map_sg_cleanup
git checkout 791c15fb5de785e78fb8c844d3d218c03d193e2c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
> arch/mips/jazz/jazzdma.c:95:6: error: conflicting types for
'vdma_alloc'
95 | long vdma_alloc(unsigned long paddr, unsigned long
size)
| ^~~~~~~~~~
In file included from arch/mips/jazz/jazzdma.c:25:
arch/mips/include/asm/jazzdma.h:11:22: note: previous declaration of
'vdma_alloc' was here
11 | extern unsigned long vdma_alloc(unsigned long paddr, unsigned long size);
| ^~~~~~~~~~
In file included from include/linux/linkage.h:7,
from include/linux/kernel.h:8,
from arch/mips/jazz/jazzdma.c:11:
arch/mips/jazz/jazzdma.c:177:15: error: conflicting types for 'vdma_alloc'
177 | EXPORT_SYMBOL(vdma_alloc);
| ^~~~~~~~~~
include/linux/export.h:98:21: note: in definition of macro '___EXPORT_SYMBOL'
98 | extern typeof(sym) sym; \
| ^~~
include/linux/export.h:155:34: note: in expansion of macro '__EXPORT_SYMBOL'
155 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, "")
| ^~~~~~~~~~~~~~~
include/linux/export.h:158:29: note: in expansion of macro '_EXPORT_SYMBOL'
158 | #define EXPORT_SYMBOL(sym) _EXPORT_SYMBOL(sym, "")
| ^~~~~~~~~~~~~~
arch/mips/jazz/jazzdma.c:177:1: note: in expansion of macro 'EXPORT_SYMBOL'
177 | EXPORT_SYMBOL(vdma_alloc);
| ^~~~~~~~~~~~~
In file included from arch/mips/jazz/jazzdma.c:25:
arch/mips/include/asm/jazzdma.h:11:22: note: previous declaration of
'vdma_alloc' was here
11 | extern unsigned long vdma_alloc(unsigned long paddr, unsigned long size);
| ^~~~~~~~~~
arch/mips/jazz/jazzdma.c: In function 'jazz_dma_map_sg':
> arch/mips/jazz/jazzdma.c:554:13: error: 'sg_dma_address'
undeclared (first use in this function); did you mean 'set_dma_addr'?
554 | if ((int) sg_dma_address < 0)
| ^~~~~~~~~~~~~~
| set_dma_addr
arch/mips/jazz/jazzdma.c:554:13: note: each undeclared identifier is reported only once
for each function it appears in
vim +/vdma_alloc +95 arch/mips/jazz/jazzdma.c
91
92 /*
93 * Allocate DMA pagetables using a simple first-fit algorithm
94 */
95 long vdma_alloc(unsigned long paddr, unsigned long size)
96 {
97 int first, last, pages, frame, i;
98 unsigned long laddr, flags;
99
100 /* check arguments */
101
102 if (paddr > 0x1fffffff) {
103 if (vdma_debug)
104 printk("vdma_alloc: Invalid physical address: %08lx\n",
105 paddr);
106 return -EINVAL; /* invalid physical address */
107 }
108 if (size > 0x400000 || size == 0) {
109 if (vdma_debug)
110 printk("vdma_alloc: Invalid size: %08lx\n", size);
111 return -EINVAL; /* invalid physical address */
112 }
113
114 spin_lock_irqsave(&vdma_lock, flags);
115 /*
116 * Find free chunk
117 */
118 pages = VDMA_PAGE(paddr + size) - VDMA_PAGE(paddr) + 1;
119 first = 0;
120 while (1) {
121 while (pgtbl[first].owner != VDMA_PAGE_EMPTY &&
122 first < VDMA_PGTBL_ENTRIES) first++;
123 if (first + pages > VDMA_PGTBL_ENTRIES) { /* nothing free */
124 spin_unlock_irqrestore(&vdma_lock, flags);
125 return -ENOMEM;
126 }
127
128 last = first + 1;
129 while (pgtbl[last].owner == VDMA_PAGE_EMPTY
130 && last - first < pages)
131 last++;
132
133 if (last - first == pages)
134 break; /* found */
135 first = last + 1;
136 }
137
138 /*
139 * Mark pages as allocated
140 */
141 laddr = (first << 12) + (paddr & (VDMA_PAGESIZE - 1));
142 frame = paddr & ~(VDMA_PAGESIZE - 1);
143
144 for (i = first; i < last; i++) {
145 pgtbl[i].frame = frame;
146 pgtbl[i].owner = laddr;
147 frame += VDMA_PAGESIZE;
148 }
149
150 /*
151 * Update translation table and return logical start address
152 */
153 r4030_write_reg32(JAZZ_R4030_TRSTBL_INV, 0);
154
155 if (vdma_debug > 1)
156 printk("vdma_alloc: Allocated %d pages starting from %08lx\n",
157 pages, laddr);
158
159 if (vdma_debug > 2) {
160 printk("LADDR: ");
161 for (i = first; i < last; i++)
162 printk("%08x ", i << 12);
163 printk("\nPADDR: ");
164 for (i = first; i < last; i++)
165 printk("%08x ", pgtbl[i].frame);
166 printk("\nOWNER: ");
167 for (i = first; i < last; i++)
168 printk("%08x ", pgtbl[i].owner);
169 printk("\n");
170 }
171
172 spin_unlock_irqrestore(&vdma_lock, flags);
173
174 return laddr;
175 }
176
177 EXPORT_SYMBOL(vdma_alloc);
178
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org