]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdgpu: Fix a bug in checking the result of reserve page
authorLuben Tuikov <luben.tuikov@amd.com>
Tue, 13 Apr 2021 12:31:59 +0000 (08:31 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 15 Apr 2021 20:32:44 +0000 (16:32 -0400)
commitb163adedaa7d420a7fc5bb91f951e642e9e921e9
tree6eef3ca5488d4cfa1245c1584b0398884d9812b8
parente8fc79834b3574b792bbe95958ee0bb75c20d0f4
drm/amdgpu: Fix a bug in checking the result of reserve page

Fix if (ret) --> if (!ret), a bug, for
"retire_page", which caused the kernel to recall
the method with *pos == end of file, and that
bounced back with error. On the first run, we
advanced *pos, but returned 0 back to fs layer,
also a bug.

Fix the logic of the check of the result of
amdgpu_reserve_page_direct()--it is 0 on success,
and non-zero on error, not the other way
around. This patch fixes this bug.

Cc: Alexander Deucher <Alexander.Deucher@amd.com>
Cc: John Clements <john.clements@amd.com>
Cc: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Luben Tuikov <luben.tuikov@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c