diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2018-12-13 11:05:31 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-12-14 15:55:17 -0500 |
commit | a3a0ebd10a9b6cf6c33885016393729112c85083 (patch) | |
tree | 1d101bb772d3856e6766186062584b0cd7d0d6a2 /drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | |
parent | 344e7ad467f5bd057b9d4d66adafbfa8077ccaa6 (diff) |
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 <alexander.deucher@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) | |||
912 | struct ttm_operation_ctx ctx = { false, false }; | 912 | struct ttm_operation_ctx ctx = { false, false }; |
913 | int r, i; | 913 | int r, i; |
914 | 914 | ||
915 | if (!bo->pin_count) { | 915 | if (WARN_ON_ONCE(!bo->pin_count)) { |
916 | dev_warn(adev->dev, "%p unpin not necessary\n", bo); | 916 | dev_warn(adev->dev, "%p unpin not necessary\n", bo); |
917 | return 0; | 917 | return 0; |
918 | } | 918 | } |