From: kernel test robot <lkp@intel.com>
To: Liviu Dudau <liviu.dudau@arm.com>,
Boris Brezillon <bbrezillon@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev,
Steven Price <steven.price@arm.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Jann Horn <jannh@google.com>
Subject: Re: [PATCH] drm/panthor: Lock XArray when getting entries for heap and VM
Date: Thu, 7 Nov 2024 01:32:27 +0800 [thread overview]
Message-ID: <202411070140.L4JAwkvX-lkp@intel.com> (raw)
In-Reply-To: <20241106120748.290697-1-liviu.dudau@arm.com>
Hi Liviu,
kernel test robot noticed the following build errors:
[auto build test ERROR on drm-misc/drm-misc-next]
[also build test ERROR on linus/master v6.12-rc6 next-20241106]
[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#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Liviu-Dudau/drm-panthor-Lock-XArray-when-getting-entries-for-heap-and-VM/20241106-200841
base: git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
patch link: https://lore.kernel.org/r/20241106120748.290697-1-liviu.dudau%40arm.com
patch subject: [PATCH] drm/panthor: Lock XArray when getting entries for heap and VM
config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20241107/202411070140.L4JAwkvX-lkp@intel.com/config)
compiler: arceb-elf-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241107/202411070140.L4JAwkvX-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202411070140.L4JAwkvX-lkp@intel.com/
All error/warnings (new ones prefixed by >>):
>> drivers/gpu/drm/panthor/panthor_heap.c:354:57: warning: 'struct pathor_heap_pool' declared inside parameter list will not be visible outside of this definition or declaration
354 | static struct panthor_heap *panthor_heap_from_id(struct pathor_heap_pool *pool, u32 id)
| ^~~~~~~~~~~~~~~~
In file included from include/linux/list_lru.h:14,
from include/linux/fs.h:13,
from include/linux/huge_mm.h:8,
from include/linux/mm.h:1120,
from include/linux/scatterlist.h:8,
from include/linux/iommu.h:10,
from include/linux/io-pgtable.h:6,
from drivers/gpu/drm/panthor/panthor_device.h:10,
from drivers/gpu/drm/panthor/panthor_heap.c:9:
drivers/gpu/drm/panthor/panthor_heap.c: In function 'panthor_heap_from_id':
>> drivers/gpu/drm/panthor/panthor_heap.c:358:22: error: invalid use of undefined type 'struct pathor_heap_pool'
358 | xa_lock(&pool->xa);
| ^~
include/linux/xarray.h:536:45: note: in definition of macro 'xa_lock'
536 | #define xa_lock(xa) spin_lock(&(xa)->xa_lock)
| ^~
drivers/gpu/drm/panthor/panthor_heap.c:359:29: error: invalid use of undefined type 'struct pathor_heap_pool'
359 | heap = xa_load(&pool->xa, id);
| ^~
drivers/gpu/drm/panthor/panthor_heap.c:360:24: error: invalid use of undefined type 'struct pathor_heap_pool'
360 | xa_unlock(&pool->va);
| ^~
include/linux/xarray.h:537:47: note: in definition of macro 'xa_unlock'
537 | #define xa_unlock(xa) spin_unlock(&(xa)->xa_lock)
| ^~
drivers/gpu/drm/panthor/panthor_heap.c: In function 'panthor_heap_return_chunk':
>> drivers/gpu/drm/panthor/panthor_heap.c:389:37: error: passing argument 1 of 'panthor_heap_from_id' from incompatible pointer type [-Werror=incompatible-pointer-types]
389 | heap = panthor_heap_from_id(pool, heap_id);
| ^~~~
| |
| struct panthor_heap_pool *
drivers/gpu/drm/panthor/panthor_heap.c:354:75: note: expected 'struct pathor_heap_pool *' but argument is of type 'struct panthor_heap_pool *'
354 | static struct panthor_heap *panthor_heap_from_id(struct pathor_heap_pool *pool, u32 id)
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
drivers/gpu/drm/panthor/panthor_heap.c: In function 'panthor_heap_grow':
drivers/gpu/drm/panthor/panthor_heap.c:452:37: error: passing argument 1 of 'panthor_heap_from_id' from incompatible pointer type [-Werror=incompatible-pointer-types]
452 | heap = panthor_heap_from_id(pool, heap_id);
| ^~~~
| |
| struct panthor_heap_pool *
drivers/gpu/drm/panthor/panthor_heap.c:354:75: note: expected 'struct pathor_heap_pool *' but argument is of type 'struct panthor_heap_pool *'
354 | static struct panthor_heap *panthor_heap_from_id(struct pathor_heap_pool *pool, u32 id)
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
cc1: some warnings being treated as errors
--
In file included from include/linux/list_lru.h:14,
from include/linux/fs.h:13,
from include/linux/seq_file.h:11,
from include/drm/drm_debugfs.h:36,
from drivers/gpu/drm/panthor/panthor_mmu.c:5:
drivers/gpu/drm/panthor/panthor_mmu.c: In function 'panthor_vm_pool_get_vm':
>> drivers/gpu/drm/panthor/panthor_mmu.c:1585:26: error: 'struct panthor_vm_pool' has no member named 'va'; did you mean 'xa'?
1585 | xa_unlock(&pool->va);
| ^~
include/linux/xarray.h:537:47: note: in definition of macro 'xa_unlock'
537 | #define xa_unlock(xa) spin_unlock(&(xa)->xa_lock)
| ^~
vim +358 drivers/gpu/drm/panthor/panthor_heap.c
353
> 354 static struct panthor_heap *panthor_heap_from_id(struct pathor_heap_pool *pool, u32 id)
355 {
356 struct panthor_heap *heap;
357
> 358 xa_lock(&pool->xa);
359 heap = xa_load(&pool->xa, id);
360 xa_unlock(&pool->va);
361
362 return heap;
363 }
364
365 /**
366 * panthor_heap_return_chunk() - Return an unused heap chunk
367 * @pool: The pool this heap belongs to.
368 * @heap_gpu_va: The GPU address of the heap context.
369 * @chunk_gpu_va: The chunk VA to return.
370 *
371 * This function is used when a chunk allocated with panthor_heap_grow()
372 * couldn't be linked to the heap context through the FW interface because
373 * the group requesting the allocation was scheduled out in the meantime.
374 */
375 int panthor_heap_return_chunk(struct panthor_heap_pool *pool,
376 u64 heap_gpu_va,
377 u64 chunk_gpu_va)
378 {
379 u64 offset = heap_gpu_va - panthor_kernel_bo_gpuva(pool->gpu_contexts);
380 u32 heap_id = (u32)offset / panthor_heap_ctx_stride(pool->ptdev);
381 struct panthor_heap_chunk *chunk, *tmp, *removed = NULL;
382 struct panthor_heap *heap;
383 int ret;
384
385 if (offset > U32_MAX || heap_id >= MAX_HEAPS_PER_POOL)
386 return -EINVAL;
387
388 down_read(&pool->lock);
> 389 heap = panthor_heap_from_id(pool, heap_id);
390 if (!heap) {
391 ret = -EINVAL;
392 goto out_unlock;
393 }
394
395 chunk_gpu_va &= GENMASK_ULL(63, 12);
396
397 mutex_lock(&heap->lock);
398 list_for_each_entry_safe(chunk, tmp, &heap->chunks, node) {
399 if (panthor_kernel_bo_gpuva(chunk->bo) == chunk_gpu_va) {
400 removed = chunk;
401 list_del(&chunk->node);
402 heap->chunk_count--;
403 break;
404 }
405 }
406 mutex_unlock(&heap->lock);
407
408 if (removed) {
409 panthor_kernel_bo_destroy(chunk->bo);
410 kfree(chunk);
411 ret = 0;
412 } else {
413 ret = -EINVAL;
414 }
415
416 out_unlock:
417 up_read(&pool->lock);
418 return ret;
419 }
420
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2024-11-06 17:33 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-06 12:07 [PATCH] drm/panthor: Lock XArray when getting entries for heap and VM Liviu Dudau
2024-11-06 12:14 ` Mihail Atanassov
2024-11-06 14:54 ` Mihail Atanassov
2024-11-06 12:16 ` Boris Brezillon
2024-11-06 13:10 ` Liviu Dudau
2024-11-06 13:21 ` Boris Brezillon
2024-11-06 18:59 ` Liviu Dudau
2024-11-06 12:17 ` Boris Brezillon
2024-11-06 13:17 ` Steven Price
2024-11-06 13:34 ` Boris Brezillon
2024-11-06 13:40 ` Steven Price
2024-11-06 17:32 ` kernel test robot [this message]
2024-11-06 17:53 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202411070140.L4JAwkvX-lkp@intel.com \
--to=lkp@intel.com \
--cc=airlied@gmail.com \
--cc=bbrezillon@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jannh@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=liviu.dudau@arm.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=simona@ffwll.ch \
--cc=steven.price@arm.com \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.