[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 08:05:24 UTC 2021


https://bugzilla.kernel.org/show_bug.cgi?id=214621

--- Comment #9 from Christian König (christian.koenig at amd.com) ---
(In reply to Lang Yu from comment #8)
> (In reply to Christian König from comment #7)
> > Yeah, that won't work. As far as I can see the problem is not inside
> amdgpu,
> > but rather inside the driver which is importing buffers from amdgpu.
> 
> At least, we should call drm_prime_gem_destroy() to detach dma-buf(if
> exists) before WARN_ON_ONCE(bo->pin_count).

Nope, that's incorrect. You are mixing things up here.

This is for the case when amdgpu imports a buffer, but the warning happens when
amdgpu exports a buffer.

And on import you indeed only want to drop the attachment after the BO is
really destroyed or not when the GEM handle is destroyed. Otherwise you could
potentially unmap memory while it is still used by the hardware.

> And do you think if clients don't unmap/detach amdgpu dma-buf properly,
> should amdgpu do that work? Thanks!

No. That rather looks like the importer is messing up some reference count and
forgets to destroy the attachment before the dma-buf. There is absolutely
nothing the exporter can do in that situation.

There is the slightly chance that the bug is indeed somewhere inside amdgpu or
the dma-buf framework itself (Michel and I are huntin a similar issue at the
moment), but it does work with other driver combinations.

-- 
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