]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/amdgpu: revert "take runtime pm reference when we attach a buffer" v2
authorChristian König <christian.koenig@amd.com>
Wed, 5 Jun 2024 11:27:20 +0000 (13:27 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 19 Jun 2024 18:17:25 +0000 (14:17 -0400)
commit8bd82363e2ee2eb3a9a8ea1fa94ebe1900d05a71
tree56b4e36d2baab65d589bd39ac44211cf6b4bb30d
parent49c9ffabde555c841392858d8b9e6cf58998a50c
drm/amdgpu: revert "take runtime pm reference when we attach a buffer" v2

This reverts commit b8c415e3bf98 ("drm/amdgpu: take runtime pm reference
when we attach a buffer") and commit 425285d39afd ("drm/amdgpu: add amdgpu
runpm usage trace for separate funcs").

Taking a runtime pm reference for DMA-buf is actually completely
unnecessary and even dangerous.

The problem is that calling pm_runtime_get_sync() from the DMA-buf
callbacks is illegal because we have the reservation locked here
which is also taken during resume. So this would deadlock.

When the buffer is in GTT it is still accessible even when the GPU
is powered down and when it is in VRAM the buffer gets migrated to
GTT before powering down.

The only use case which would make it mandatory to keep the runtime
pm reference would be if we pin the buffer into VRAM, and that's not
something we currently do.

v2: improve the commit message

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
CC: stable@vger.kernel.org
drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h