tree:
https://github.com/HabanaAI/linux.git habanalabs-next
head: 91c010442fcde7865302198c1173cf7f81399f83
commit: 91c010442fcde7865302198c1173cf7f81399f83 [21/21] [PATCH] habanalabs: make use of
dma_mmap_coherent
config: arc-allyesconfig (attached as .config)
compiler: arc-elf-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
git checkout 91c010442fcde7865302198c1173cf7f81399f83
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
drivers/misc/habanalabs/common/command_buffer.c: In function 'hl_cb_mmap':
> drivers/misc/habanalabs/common/command_buffer.c:346:44: warning:
cast to pointer from integer of different size [-Wint-to-pointer-cast]
346 |
rc = hdev->asic_funcs->cb_mmap(hdev, vma, (void *) cb->kernel_address,
| ^
#
https://github.com/HabanaAI/linux/commit/91c010442fcde7865302198c1173cf7f...
git remote add habanaai
https://github.com/HabanaAI/linux.git
git fetch --no-tags habanaai habanalabs-next
git checkout 91c010442fcde7865302198c1173cf7f81399f83
vim +346 drivers/misc/habanalabs/common/command_buffer.c
297
298 int hl_cb_mmap(struct hl_fpriv *hpriv, struct vm_area_struct *vma)
299 {
300 struct hl_device *hdev = hpriv->hdev;
301 struct hl_cb *cb;
302 u32 handle;
303 int rc;
304
305 handle = vma->vm_pgoff;
306
307 /* reference was taken here */
308 cb = hl_cb_get(hdev, &hpriv->cb_mgr, handle);
309 if (!cb) {
310 dev_err(hdev->dev,
311 "CB mmap failed, no match to handle 0x%x\n", handle);
312 return -EINVAL;
313 }
314
315 /* Validation check */
316 if ((vma->vm_end - vma->vm_start) != ALIGN(cb->size, PAGE_SIZE)) {
317 dev_err(hdev->dev,
318 "CB mmap failed, mmap size 0x%lx != 0x%x cb size\n",
319 vma->vm_end - vma->vm_start, cb->size);
320 rc = -EINVAL;
321 goto put_cb;
322 }
323
324 spin_lock(&cb->lock);
325
326 if (cb->mmap) {
327 dev_err(hdev->dev,
328 "CB mmap failed, CB already mmaped to user\n");
329 rc = -EINVAL;
330 goto release_lock;
331 }
332
333 cb->mmap = true;
334
335 spin_unlock(&cb->lock);
336
337 vma->vm_ops = &cb_vm_ops;
338
339 /*
340 * Note: We're transferring the cb reference to
341 * vma->vm_private_data here.
342 */
343
344 vma->vm_private_data = cb;
345
346 rc = hdev->asic_funcs->cb_mmap(hdev, vma, (void *)
cb->kernel_address,
347 cb->bus_address, cb->size);
348 if (rc) {
349 spin_lock(&cb->lock);
350 cb->mmap = false;
351 goto release_lock;
352 }
353
354 cb->mmap_size = cb->size;
355
356 return 0;
357
358 release_lock:
359 spin_unlock(&cb->lock);
360 put_cb:
361 hl_cb_put(cb);
362 return rc;
363 }
364
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org