Skip to contentSkip to conversation

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

PATCH New Zack Rusin 1 participant 1 message Jan 26, 2023

Subsystems (3)
lore
Share & tools
lore

Zack Rusin

author
#0 lore raw

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

From: Zack Rusin <[email protected]>

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 <[email protected]>
Cc Roger.He <[email protected]>
Cc Alex Deucher <[email protected]>
---
 drivers/gpu/drm/ttm/ttm_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/ttm/ttm_device.c +1 -1
index e7147e304637..0feaa4feaad5 100644
@@ -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);
 
Signature · 1 line
2.38.1