[PATCH] drm/ttm:fix wrong decoding of bo_count

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux