Skip to contentSkip to conversation

drm/ttm:fix wrong decoding of bo_count

PATCH In review Monk Liu 3 participants 3 messages Aug 14, 2017 – Aug 24, 2017 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

Monk Liu

author
#0 lore raw

PATCH 1/1 drm/ttm:fix wrong decoding of bo_count

From: Monk Liu <[email protected]>

we observe abnormal number from:
/sys/devices/virtual/drm/amdttm/buffer_objects/bo_count

bo_count is atomic_inc which is "int" type,
shouldn't explicitly turn it to unsigned long.

Change-Id I169b3d056df65df363d9030e5b240a2960bcee60
---
 drivers/gpu/drm/ttm/ttm_bo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/ttm/ttm_bo.c +2 -2
index d3463eb..d1e54b5 100644
@@ -108,8 +108,8 @@ static ssize_t ttm_bo_global_show(struct kobject *kobj,
 	struct ttm_bo_global *glob =
 		container_of(kobj, struct ttm_bo_global, kobj);
 
-	return snprintf(buffer, PAGE_SIZE, "%lu\n",
-			(unsigned long) atomic_read(&glob->bo_count));
+	return snprintf(buffer, PAGE_SIZE, "%d\n",
+				atomic_read(&glob->bo_count));
 }
 
 static struct attribute *ttm_bo_global_attrs[] = {
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1502682425-9285-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#2 lore raw

Am 14.08.2017 um 05:47 schrieb Monk Liu:

Quoted 10 lines

From: Monk Liu <[email protected]>

we observe abnormal number from:
/sys/devices/virtual/drm/amdttm/buffer_objects/bo_count

bo_count is atomic_inc which is "int" type,
shouldn't explicitly turn it to unsigned long.

Change-Id I169b3d056df65df363d9030e5b240a2960bcee60
Quoted 9 lines
---
  drivers/gpu/drm/ttm/ttm_bo.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/ttm/ttm_bo.c +0 -0
index d3463eb..d1e54b5 100644

drivers/gpu/drm/ttm/ttm_bo.c static ssize_t ttm_bo_global_show(struct kobject *kobj, · line 115

Quoted 10 lines
drivers/gpu/drm/ttm/ttm_bo.c +2 -2
@@ -108,8 +108,8 @@ static ssize_t ttm_bo_global_show(struct kobject *kobj,
  	struct ttm_bo_global *glob =
  		container_of(kobj, struct ttm_bo_global, kobj);
 
-	return snprintf(buffer, PAGE_SIZE, "%lu\n",
-			(unsigned long) atomic_read(&glob->bo_count));
+	return snprintf(buffer, PAGE_SIZE, "%d\n",
+				atomic_read(&glob->bo_count));
  }
 
  static struct attribute *ttm_bo_global_attrs[] = {

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#3 lore raw
In reply to a message not in the archive
Quoted 10 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Monk Liu
Sent: Sunday, August 13, 2017 11:47 PM
To: [email protected]
Cc: Liu, Monk
Subject: [PATCH] drm/ttm:fix wrong decoding of bo_count

From: Monk Liu <[email protected]>

Quoted 8 lines

we observe abnormal number from:
/sys/devices/virtual/drm/amdttm/buffer_objects/bo_count

bo_count is atomic_inc which is "int" type,
shouldn't explicitly turn it to unsigned long.

Change-Id I169b3d056df65df363d9030e5b240a2960bcee60

I don't think this one ever landed either.

Alex

Quoted 23 lines
---
 drivers/gpu/drm/ttm/ttm_bo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/ttm/ttm_bo.c +2 -2
index d3463eb..d1e54b5 100644
@@ -108,8 +108,8 @@ static ssize_t ttm_bo_global_show(struct kobject
 *kobj,
 	struct ttm_bo_global *glob =
 		container_of(kobj, struct ttm_bo_global, kobj);
 
-	return snprintf(buffer, PAGE_SIZE, "%lu\n",
-			(unsigned long) atomic_read(&glob->bo_count));
+	return snprintf(buffer, PAGE_SIZE, "%d\n",
+				atomic_read(&glob->bo_count));
 }
 

static struct attribute *ttm_bo_global_attrs[] = {
--
2.7.4

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx