All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amdgpu: Fix a bug on flag table_freed
@ 2021-05-29 22:51 Eric Huang
  2021-05-29 22:51 ` [PATCH 2/2] drm/amdkfd: optimize memory mapping latency Eric Huang
  2021-05-30 16:54 ` [PATCH 1/2] drm/amdgpu: Fix a bug on flag table_freed Christian König
  0 siblings, 2 replies; 9+ messages in thread
From: Eric Huang @ 2021-05-29 22:51 UTC (permalink / raw)
  To: amd-gfx; +Cc: Eric Huang

table_freed will be always true when mapping a memory with size
bigger than 2MB. The problem is page table's entries are always
existed, but existing mapping depends on page talbe's bo, so
using a check of page table's bo existed will resolve the issue.

Signed-off-by: Eric Huang <jinhuieric.huang@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 0dee2e8797c7..95b94c95adac 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -1582,9 +1582,11 @@ static int amdgpu_vm_update_ptes(struct amdgpu_vm_update_params *params,
 			 * completely covered by the range and so potentially still in use.
 			 */
 			while (cursor.pfn < frag_start) {
+				/* Make sure previous mapping existed */
+				if (cursor.entry->base.bo)
+					params->table_freed = true;
 				amdgpu_vm_free_pts(adev, params->vm, &cursor);
 				amdgpu_vm_pt_next(adev, &cursor);
-				params->table_freed = true;
 			}
 
 		} else if (frag >= shift) {
-- 
2.25.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-06-01 16:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-29 22:51 [PATCH 1/2] drm/amdgpu: Fix a bug on flag table_freed Eric Huang
2021-05-29 22:51 ` [PATCH 2/2] drm/amdkfd: optimize memory mapping latency Eric Huang
2021-06-01 16:05   ` Felix Kuehling
2021-06-01 16:16     ` Felix Kuehling
2021-05-30 16:54 ` [PATCH 1/2] drm/amdgpu: Fix a bug on flag table_freed Christian König
2021-05-30 18:29   ` Eric Huang
2021-05-31 14:08     ` Christian König
2021-05-31 14:30       ` Eric Huang
2021-05-31 19:37         ` Christian König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.