mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	drm/amdkfd: Check correct memory types for is_system variable
To catch GPU mapping of system memory, TTM_PL_TT and AMDGPU_PL_PREEMPT
must be checked.
Fixes: 628e1ace23 ("drm/amdkfd: mark GFX12 system and peer GPU memory mappings as MTYPE_NC")
Signed-off-by: Sreekant Somasekharan <sreekant.somasekharan@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
			
			
This commit is contained in:
		
							parent
							
								
									b72fa761fc
								
							
						
					
					
						commit
						0cce5f285d
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
					@ -524,7 +524,8 @@ static void gmc_v12_0_get_vm_pte(struct amdgpu_device *adev,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	bo_adev = amdgpu_ttm_adev(bo->tbo.bdev);
 | 
						bo_adev = amdgpu_ttm_adev(bo->tbo.bdev);
 | 
				
			||||||
	coherent = bo->flags & AMDGPU_GEM_CREATE_COHERENT;
 | 
						coherent = bo->flags & AMDGPU_GEM_CREATE_COHERENT;
 | 
				
			||||||
	is_system = bo->tbo.resource->mem_type == TTM_PL_SYSTEM;
 | 
						is_system = (bo->tbo.resource->mem_type == TTM_PL_TT) ||
 | 
				
			||||||
 | 
							(bo->tbo.resource->mem_type == AMDGPU_PL_PREEMPT);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* WA for HW bug */
 | 
						/* WA for HW bug */
 | 
				
			||||||
	if (is_system || ((bo_adev != adev) && coherent))
 | 
						if (is_system || ((bo_adev != adev) && coherent))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue