[Bug 214621] WARNING: CPU: 3 PID: 521 at drivers/gpu/drm/ttm/ttm_bo.c:409 ttm_bo_release+0xb64/0xe40 [ttm]
bugzilla-daemon at bugzilla.kernel.org
bugzilla-daemon at bugzilla.kernel.org
Thu Nov 4 12:15:48 UTC 2021
https://bugzilla.kernel.org/show_bug.cgi?id=214621
--- Comment #12 from Lang Yu (Lang.Yu at amd.com) ---
(In reply to Christian König from comment #11)
> Well it's really appreciated that you are looking into this.
>
> One thing we might want to do is to move the warning in dma_buf_release():
>
> diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
> index 3f63d58bf68a..6ecc01585cf4 100644
> --- a/drivers/dma-buf/dma-buf.c
> +++ b/drivers/dma-buf/dma-buf.c
> @@ -75,6 +75,7 @@ static void dma_buf_release(struct dentry *dentry)
> * dma-buf while still having pending operation to the buffer.
> */
> BUG_ON(dmabuf->cb_in.active || dmabuf->cb_out.active);
> + WARN_ON(!list_empty(&dmabuf->attachments));
>
> dma_buf_stats_teardown(dmabuf);
> dmabuf->ops->release(dmabuf);
> @@ -82,7 +83,6 @@ static void dma_buf_release(struct dentry *dentry)
> if (dmabuf->resv == (struct dma_resv *)&dmabuf[1])
> dma_resv_fini(dmabuf->resv);
>
> - WARN_ON(!list_empty(&dmabuf->attachments));
> module_put(dmabuf->owner);
> kfree(dmabuf->name);
> kfree(dmabuf);
>
> This way users get the dma-buf warning first and maybe a bit less confused.
The warning was just merged into mainline 5.15.0 on Tue Nov 2 16:47:49
2021(commit 56d33754481f). Not sure Erhard F.'s build contains this warning.
And we can also add a debug WARN() into amdgpu_dma_buf_pin() to see who pinned
dma_buf.
--
You may reply to this email to add a comment.
You are receiving this mail because:
You are watching the assignee of the bug.
More information about the dri-devel
mailing list