diff mbox series

drm/ttm: Fix a typo in iteration over swap-lists

Message ID 20230126180151.605367-1-zack@kde.org (mailing list archive)
State New, archived
Headers show
Series drm/ttm: Fix a typo in iteration over swap-lists | expand

Commit Message

Zack Rusin Jan. 26, 2023, 6:01 p.m. UTC
From: Zack Rusin <zackr@vmware.com>

On device fini all the lru's for different priorities are checked
for whether or not they were clean. The code used 0 instead of the
iteration variable, which results in continuously checking only the swap
list for priority 0.

Use the loop index to fix it.

Fixes: cf6c467d67d3 ("drm/ttm: add BO priorities for the LRUs")
Cc: Christian K├Ânig <christian.koenig@amd.com>
Cc: Roger.He <Hongbo.He@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Zack Rusin <zackr@vmware.com>
---
 drivers/gpu/drm/ttm/ttm_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/ttm/ttm_device.c b/drivers/gpu/drm/ttm/ttm_device.c
index e7147e304637..0feaa4feaad5 100644
--- a/drivers/gpu/drm/ttm/ttm_device.c
+++ b/drivers/gpu/drm/ttm/ttm_device.c
@@ -254,7 +254,7 @@  void ttm_device_fini(struct ttm_device *bdev)
 
 	spin_lock(&bdev->lru_lock);
 	for (i = 0; i < TTM_MAX_BO_PRIORITY; ++i)
-		if (list_empty(&man->lru[0]))
+		if (list_empty(&man->lru[i]))
 			pr_debug("Swap list %d was clean\n", i);
 	spin_unlock(&bdev->lru_lock);