Skip to contentSkip to conversation

drm/amdgpu: fix amdgpu_res_first()

PATCH In review Nirmoy Das 2 participants 2 messages Mar 19, 2021 – Mar 20, 2021

Subsystems (2)
lore
Share & tools
lore

Nirmoy Das

author
#0 lore raw

PATCH 1/1 drm/amdgpu: fix amdgpu_res_first()

Fix size comparison in the resource cursor.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h +1 -1
index b49a61d07d60..40f2adf305bc 100644
@@ -64,7 +64,7 @@ static inline void amdgpu_res_first(struct ttm_resource *res,
 	BUG_ON(start + size > res->num_pages << PAGE_SHIFT);
 
 	node = res->mm_node;
-	while (start > node->size << PAGE_SHIFT)
+	while (start >= node->size << PAGE_SHIFT)
 		start -= node++->size << PAGE_SHIFT;
 
 	cur->start = (node->start << PAGE_SHIFT) + start;
Signature · 6 lines
2.30.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by on v1 1/1
#1 lore raw

Am 19.03.21 um 20:08 schrieb Nirmoy Das:

Quoted 3 lines

Fix size comparison in the resource cursor.

Quoted 9 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h +0 -0
index b49a61d07d60..40f2adf305bc 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h static inline void amdgpu_res_first(struct ttm_resource *res, · line 70

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h +1 -1
@@ -64,7 +64,7 @@ static inline void amdgpu_res_first(struct ttm_resource *res,
  	BUG_ON(start + size > res->num_pages << PAGE_SHIFT);
 
  	node = res->mm_node;
-	while (start > node->size << PAGE_SHIFT)
+	while (start >= node->size << PAGE_SHIFT)
  		start -= node++->size << PAGE_SHIFT;
 
  	cur->start = (node->start << PAGE_SHIFT) + start;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx