diff mbox series

[5/6] drm/amdgpu: Fix BUG_ON assert

Message ID 20210622162339.761651-5-andrey.grodzovsky@amd.com (mailing list archive)
State New, archived
Headers show
Series [1/6] drm/ttm: add TTM_PL_FLAG_TEMPORARY flag v3 | expand

Commit Message

Andrey Grodzovsky June 22, 2021, 4:23 p.m. UTC
With added CPU domain to placement you can have
now 3 placemnts at once.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Christian König June 23, 2021, 8:30 a.m. UTC | #1
Am 22.06.21 um 18:23 schrieb Andrey Grodzovsky:
> With added CPU domain to placement you can have
> now 3 placemnts at once.
>
> Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>

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

And please add CC: stable@kernel.org since this is trigger able from 
userspace and actually a rather nasty bug.

Christian.

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> index b7a2070d90af..81268eded073 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> @@ -180,7 +180,7 @@ void amdgpu_bo_placement_from_domain(struct amdgpu_bo *abo, u32 domain)
>   		c++;
>   	}
>   
> -	BUG_ON(c >= AMDGPU_BO_MAX_PLACEMENTS);
> +	BUG_ON(c > AMDGPU_BO_MAX_PLACEMENTS);
>   
>   	placement->num_placement = c;
>   	placement->placement = places;
diff mbox series

Patch

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index b7a2070d90af..81268eded073 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -180,7 +180,7 @@  void amdgpu_bo_placement_from_domain(struct amdgpu_bo *abo, u32 domain)
 		c++;
 	}
 
-	BUG_ON(c >= AMDGPU_BO_MAX_PLACEMENTS);
+	BUG_ON(c > AMDGPU_BO_MAX_PLACEMENTS);
 
 	placement->num_placement = c;
 	placement->placement = places;