From: Michel Dänzer Date: Thu, 13 Dec 2018 16:05:31 +0000 (+0100) Subject: drm/amdgpu: WARN once if amdgpu_bo_unpin is called for an unpinned BO X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=a3a0ebd10a9b6cf6c33885016393729112c85083;p=openwrt%2Fstaging%2Fblogic.git drm/amdgpu: WARN once if amdgpu_bo_unpin is called for an unpinned BO It indicates a pin/unpin imbalance bug somewhere. While the bug isn't necessarily in the call chain hitting this, it's at least one part involved. Reviewed-by: Alex Deucher Signed-off-by: Michel Dänzer Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index fd271f9746a2..728e15e5d68a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c @@ -912,7 +912,7 @@ int amdgpu_bo_unpin(struct amdgpu_bo *bo) struct ttm_operation_ctx ctx = { false, false }; int r, i; - if (!bo->pin_count) { + if (WARN_ON_ONCE(!bo->pin_count)) { dev_warn(adev->dev, "%p unpin not necessary\n", bo); return 0; }