[PATCH v2] drm/amdkfd: Check correct memory types for is_system variable

Felix Kuehling felix.kuehling at amd.com
Fri May 10 21:56:06 UTC 2024


On 2024-05-10 10:06, Sreekant Somasekharan wrote:
> To catch GPU mapping of system memory, TTM_PL_TT and AMDGPU_PL_PREEMPT
> must be checked.
>
> 'Fixes: 3b01ca1b860d ("drm/amdkfd: mark GFX12 system and peer
> GPU memory mappings as MTYPE_NC")'

I don't think that's a valid format for the Fixes tag. It should be a 
single line and no single quotes. Other than that, the patch is

Reviewed-by: Felix Kuehling <felix.kuehling at amd.com>


> Signed-off-by: Sreekant Somasekharan <sreekant.somasekharan at amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c
> index df0363ad1a51..6eb370609d01 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c
> @@ -495,7 +495,8 @@ static void gmc_v12_0_get_vm_pte(struct amdgpu_device *adev,
>   	struct amdgpu_bo *bo = mapping->bo_va->base.bo;
>   	struct amdgpu_device *bo_adev = amdgpu_ttm_adev(bo->tbo.bdev);
>   	bool coherent = bo->flags & AMDGPU_GEM_CREATE_COHERENT;
> -	bool is_system = bo->tbo.resource->mem_type == TTM_PL_SYSTEM;
> +	bool is_system = (bo->tbo.resource->mem_type == TTM_PL_TT) ||
> +		(bo->tbo.resource->mem_type == AMDGPU_PL_PREEMPT);
>   
>   
>   	*flags &= ~AMDGPU_PTE_EXECUTABLE;


More information about the amd-gfx mailing list