All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zack Rusin <zack@kde.org>
To: dri-devel@lists.freedesktop.org
Cc: banackm@vmware.com, krastevm@vmware.com,
	"Roger . He" <Hongbo.He@amd.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	mombasawalam@vmware.com
Subject: [PATCH] drm/ttm: Fix a typo in iteration over swap-lists
Date: Thu, 26 Jan 2023 13:01:51 -0500	[thread overview]
Message-ID: <20230126180151.605367-1-zack@kde.org> (raw)

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 --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


                 reply	other threads:[~2023-01-26 18:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230126180151.605367-1-zack@kde.org \
    --to=zack@kde.org \
    --cc=Hongbo.He@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=banackm@vmware.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=krastevm@vmware.com \
    --cc=mombasawalam@vmware.com \
    --cc=zackr@vmware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.