[PATCH] drm/ttm: Fix a typo in iteration over swap-lists
Zack Rusin
zack at kde.org
Thu Jan 26 18:01:51 UTC 2023
From: Zack Rusin <zackr at 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 at amd.com>
Cc: Roger.He <Hongbo.He at amd.com>
Cc: Alex Deucher <alexander.deucher at amd.com>
Signed-off-by: Zack Rusin <zackr at vmware.com>
---
drivers/gpu/drm/ttm/ttm_device.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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);
--
2.38.1
More information about the dri-devel
mailing list