* [PATCH v2] accel/ivpu: Fix warning in ivpu_gem_bo_free()
@ 2025-05-28 17:12 Jacek Lawrynowicz
2025-05-28 17:14 ` Lizhi Hou
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Jacek Lawrynowicz @ 2025-05-28 17:12 UTC (permalink / raw)
To: dri-devel; +Cc: jeff.hugo, lizhi.hou, Jacek Lawrynowicz, stable
Don't WARN if imported buffers are in use in ivpu_gem_bo_free() as they
can be indeed used in the original context/driver.
Fixes: 647371a6609d ("accel/ivpu: Add GEM buffer object management")
Cc: stable@vger.kernel.org # v6.3
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
---
v2: Use drm_gem_is_imported() to check if the buffer is imported.
---
drivers/accel/ivpu/ivpu_gem.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/accel/ivpu/ivpu_gem.c b/drivers/accel/ivpu/ivpu_gem.c
index c193a80241f5f..5ff0bac739fc9 100644
--- a/drivers/accel/ivpu/ivpu_gem.c
+++ b/drivers/accel/ivpu/ivpu_gem.c
@@ -278,7 +278,8 @@ static void ivpu_gem_bo_free(struct drm_gem_object *obj)
list_del(&bo->bo_list_node);
mutex_unlock(&vdev->bo_list_lock);
- drm_WARN_ON(&vdev->drm, !dma_resv_test_signaled(obj->resv, DMA_RESV_USAGE_READ));
+ drm_WARN_ON(&vdev->drm, !drm_gem_is_imported(&bo->base.base) &&
+ !dma_resv_test_signaled(obj->resv, DMA_RESV_USAGE_READ));
drm_WARN_ON(&vdev->drm, ivpu_bo_size(bo) == 0);
drm_WARN_ON(&vdev->drm, bo->base.vaddr);
--
2.45.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] accel/ivpu: Fix warning in ivpu_gem_bo_free()
2025-05-28 17:12 [PATCH v2] accel/ivpu: Fix warning in ivpu_gem_bo_free() Jacek Lawrynowicz
@ 2025-05-28 17:14 ` Lizhi Hou
2025-05-30 19:52 ` Jeff Hugo
2025-06-05 12:50 ` Jacek Lawrynowicz
2 siblings, 0 replies; 4+ messages in thread
From: Lizhi Hou @ 2025-05-28 17:14 UTC (permalink / raw)
To: Jacek Lawrynowicz, dri-devel; +Cc: jeff.hugo, stable
On 5/28/25 10:12, Jacek Lawrynowicz wrote:
> Don't WARN if imported buffers are in use in ivpu_gem_bo_free() as they
> can be indeed used in the original context/driver.
>
> Fixes: 647371a6609d ("accel/ivpu: Add GEM buffer object management")
> Cc: stable@vger.kernel.org # v6.3
> Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
> ---
> v2: Use drm_gem_is_imported() to check if the buffer is imported.
> ---
> drivers/accel/ivpu/ivpu_gem.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/accel/ivpu/ivpu_gem.c b/drivers/accel/ivpu/ivpu_gem.c
> index c193a80241f5f..5ff0bac739fc9 100644
> --- a/drivers/accel/ivpu/ivpu_gem.c
> +++ b/drivers/accel/ivpu/ivpu_gem.c
> @@ -278,7 +278,8 @@ static void ivpu_gem_bo_free(struct drm_gem_object *obj)
> list_del(&bo->bo_list_node);
> mutex_unlock(&vdev->bo_list_lock);
>
> - drm_WARN_ON(&vdev->drm, !dma_resv_test_signaled(obj->resv, DMA_RESV_USAGE_READ));
> + drm_WARN_ON(&vdev->drm, !drm_gem_is_imported(&bo->base.base) &&
> + !dma_resv_test_signaled(obj->resv, DMA_RESV_USAGE_READ));
Reviewed-by: Lizhi Hou <lizhi.hou@amd.com>
> drm_WARN_ON(&vdev->drm, ivpu_bo_size(bo) == 0);
> drm_WARN_ON(&vdev->drm, bo->base.vaddr);
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] accel/ivpu: Fix warning in ivpu_gem_bo_free()
2025-05-28 17:12 [PATCH v2] accel/ivpu: Fix warning in ivpu_gem_bo_free() Jacek Lawrynowicz
2025-05-28 17:14 ` Lizhi Hou
@ 2025-05-30 19:52 ` Jeff Hugo
2025-06-05 12:50 ` Jacek Lawrynowicz
2 siblings, 0 replies; 4+ messages in thread
From: Jeff Hugo @ 2025-05-30 19:52 UTC (permalink / raw)
To: Jacek Lawrynowicz, dri-devel; +Cc: lizhi.hou, stable
On 5/28/2025 11:12 AM, Jacek Lawrynowicz wrote:
> Don't WARN if imported buffers are in use in ivpu_gem_bo_free() as they
> can be indeed used in the original context/driver.
>
> Fixes: 647371a6609d ("accel/ivpu: Add GEM buffer object management")
> Cc: stable@vger.kernel.org # v6.3
> Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Reviewed-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] accel/ivpu: Fix warning in ivpu_gem_bo_free()
2025-05-28 17:12 [PATCH v2] accel/ivpu: Fix warning in ivpu_gem_bo_free() Jacek Lawrynowicz
2025-05-28 17:14 ` Lizhi Hou
2025-05-30 19:52 ` Jeff Hugo
@ 2025-06-05 12:50 ` Jacek Lawrynowicz
2 siblings, 0 replies; 4+ messages in thread
From: Jacek Lawrynowicz @ 2025-06-05 12:50 UTC (permalink / raw)
To: dri-devel; +Cc: jeff.hugo, lizhi.hou, stable
Applied to drm-misc-fixes
On 5/28/2025 7:12 PM, Jacek Lawrynowicz wrote:
> Don't WARN if imported buffers are in use in ivpu_gem_bo_free() as they
> can be indeed used in the original context/driver.
>
> Fixes: 647371a6609d ("accel/ivpu: Add GEM buffer object management")
> Cc: stable@vger.kernel.org # v6.3
> Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
> ---
> v2: Use drm_gem_is_imported() to check if the buffer is imported.
> ---
> drivers/accel/ivpu/ivpu_gem.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/accel/ivpu/ivpu_gem.c b/drivers/accel/ivpu/ivpu_gem.c
> index c193a80241f5f..5ff0bac739fc9 100644
> --- a/drivers/accel/ivpu/ivpu_gem.c
> +++ b/drivers/accel/ivpu/ivpu_gem.c
> @@ -278,7 +278,8 @@ static void ivpu_gem_bo_free(struct drm_gem_object *obj)
> list_del(&bo->bo_list_node);
> mutex_unlock(&vdev->bo_list_lock);
>
> - drm_WARN_ON(&vdev->drm, !dma_resv_test_signaled(obj->resv, DMA_RESV_USAGE_READ));
> + drm_WARN_ON(&vdev->drm, !drm_gem_is_imported(&bo->base.base) &&
> + !dma_resv_test_signaled(obj->resv, DMA_RESV_USAGE_READ));
> drm_WARN_ON(&vdev->drm, ivpu_bo_size(bo) == 0);
> drm_WARN_ON(&vdev->drm, bo->base.vaddr);
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-06-05 12:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-28 17:12 [PATCH v2] accel/ivpu: Fix warning in ivpu_gem_bo_free() Jacek Lawrynowicz
2025-05-28 17:14 ` Lizhi Hou
2025-05-30 19:52 ` Jeff Hugo
2025-06-05 12:50 ` Jacek Lawrynowicz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).