All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/ttm:fix wrong decoding of bo_count
@ 2017-08-14  3:47 Monk Liu
       [not found] ` <1502682425-9285-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Monk Liu @ 2017-08-14  3:47 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Monk Liu

From: Monk Liu <monk.liu@amd.com>

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
Signed-off-by: Monk Liu <monk.liu@amd.com>
---
 drivers/gpu/drm/ttm/ttm_bo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index d3463eb..d1e54b5 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -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

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/ttm:fix wrong decoding of bo_count
       [not found] ` <1502682425-9285-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
@ 2017-08-14  8:04   ` Christian König
  2017-08-24  2:26   ` Deucher, Alexander
  1 sibling, 0 replies; 3+ messages in thread
From: Christian König @ 2017-08-14  8:04 UTC (permalink / raw)
  To: Monk Liu, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Am 14.08.2017 um 05:47 schrieb Monk Liu:
> From: Monk Liu <monk.liu@amd.com>
>
> 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
> Signed-off-by: Monk Liu <monk.liu@amd.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/ttm/ttm_bo.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index d3463eb..d1e54b5 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -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
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] drm/ttm:fix wrong decoding of bo_count
       [not found] ` <1502682425-9285-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
  2017-08-14  8:04   ` Christian König
@ 2017-08-24  2:26   ` Deucher, Alexander
  1 sibling, 0 replies; 3+ messages in thread
From: Deucher, Alexander @ 2017-08-24  2:26 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Liu, Monk

> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf
> Of Monk Liu
> Sent: Sunday, August 13, 2017 11:47 PM
> To: amd-gfx@lists.freedesktop.org
> Cc: Liu, Monk
> Subject: [PATCH] drm/ttm:fix wrong decoding of bo_count
> 
> From: Monk Liu <monk.liu@amd.com>
> 
> 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
> Signed-off-by: Monk Liu <monk.liu@amd.com>

I don't think this one ever landed either.

Alex

> ---
>  drivers/gpu/drm/ttm/ttm_bo.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index d3463eb..d1e54b5 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -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
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-08-24  2:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-14  3:47 [PATCH] drm/ttm:fix wrong decoding of bo_count Monk Liu
     [not found] ` <1502682425-9285-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2017-08-14  8:04   ` Christian König
2017-08-24  2:26   ` Deucher, Alexander

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.