drm/nouveau: fix dma syncing for loops (v2)
Subsystems (3)
Dave Airlie
maintainerPATCH 1/1 drm/nouveau: fix dma syncing for loops (v2)
From: Dave Airlie <[email protected]>
The index variable should only be increased in one place.
Noticed this while trying to track down another oops.
v2: use while loop.
--- drivers/gpu/drm/nouveau/nouveau_bo.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/nouveau/nouveau_bo.c +4 -2
@@ -556,7 +556,8 @@ nouveau_bo_sync_for_device(struct nouveau_bo *nvbo)if (nvbo->force_coherent)return ; -for (i =0 ; i < ttm_dma->num_pages; ++i) { + i =0 ; +while (i < ttm_dma->num_pages) {struct page *p = ttm_dma->pages[i];size_t num_pages =1 ;
@@ -587,7 +588,8 @@ nouveau_bo_sync_for_cpu(struct nouveau_bo *nvbo)if (nvbo->force_coherent)return ; -for (i =0 ; i < ttm_dma->num_pages; ++i) { + i =0 ; +while (i < ttm_dma->num_pages) {struct page *p = ttm_dma->pages[i];size_t num_pages =1 ;
Signature · 6 lines
2.27.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 7 lines
-----Original Message-----
From: Dave Airlie <[email protected]>
Sent: Wednesday, March 10, 2021 11:35 PM
To: [email protected]
Cc: Ruhl, Michael J <[email protected]>; [email protected]
Subject: [PATCH] drm/nouveau: fix dma syncing for loops (v2)
Quoted 7 lines
From: Dave Airlie <[email protected]>
The index variable should only be increased in one place.
Noticed this while trying to track down another oops.
v2: use while loop.
Ok, that makes it more obvious for me.
Thanks.
M
Quoted 35 lines
Fixes f295c8cfec83 ("drm/nouveau: fix dma syncing warning with debuggingon.")
Signed-off-by Dave Airlie <[email protected]>---
drivers/gpu/drm/nouveau/nouveau_bo.c| 6 ++++--1 file changed, 4 insertions(+), 2 deletions(-)drivers/gpu/drm/nouveau/nouveau_bo.c +4
-3@@ -556,7 +556,8 @@ nouveau_bo_sync_for_device(struct nouveau_bo *nvbo)if (nvbo->force_coherent)return ; -for (i =0 ; i < ttm_dma->num_pages; ++i) { + i =0 ; +while (i < ttm_dma->num_pages) {struct page *p = ttm_dma->pages[i];size_t num_pages =1 ;@@ -587,7 +588,8 @@ nouveau_bo_sync_for_cpu(struct nouveau_bo *nvbo)if (nvbo->force_coherent)return ; -for (i =0 ; i < ttm_dma->num_pages; ++i) { + i =0 ; +while (i < ttm_dma->num_pages) {struct page *p = ttm_dma->pages[i];size_t num_pages =1 ; --
Quoted 1 line
2.27.0
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel