OSDN Git Service

drm/amdgpu/dc: Stop dma_resv_lock inversion in commit_tail
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 27 Jul 2020 21:30:18 +0000 (23:30 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 30 Jul 2020 19:36:44 +0000 (15:36 -0400)
commit178b0013f074da545492662ec76dc2be363ca85c
tree134f00356eb1f4606447766ec91b24a3a28e38a4
parent317469f695c27e290b8001a0df0fdbb95f27bfa9
drm/amdgpu/dc: Stop dma_resv_lock inversion in commit_tail

Trying to grab dma_resv_lock while in commit_tail before we've done
all the code that leads to the eventual signalling of the vblank event
(which can be a dma_fence) is deadlock-y. Don't do that.

Here the solution is easy because just grabbing locks to read
something races anyway. We don't need to bother, READ_ONCE is
equivalent. And avoids the locking issue.

v2: Also take into account tmz_surface boolean, plus just delete the
old code.

Cc: linux-media@vger.kernel.org
Cc: linaro-mm-sig@lists.linaro.org
Cc: linux-rdma@vger.kernel.org
Cc: amd-gfx@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Christian König <christian.koenig@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c