Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu: Program IH_VMID_LUT_INDEX register on GFX 12.1

For querying VMID <-> PASID mapping on GFX 12.1, we need to first
program the IH_VMID_LUT_INDEX before fetching the LUT mapping. Without
this TLB flush may not work.

Signed-off-by: Mukul Joshi <mukul.joshi@amd.com>
Reviewed-by: Michael Chen <michael.chen@amd.com>
Reviewed-by: Alex Sierra <alex.sierra@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Mukul Joshi and committed by
Alex Deucher
44fc86f2 d3336c93

+12 -2
+12 -2
drivers/gpu/drm/amd/amdgpu/gmc_v12_1.c
··· 230 230 } 231 231 232 232 static bool gmc_v12_1_get_vmid_pasid_mapping_info(struct amdgpu_device *adev, 233 - uint8_t vmid, uint16_t *p_pasid) 233 + uint8_t vmid, uint8_t inst, 234 + uint16_t *p_pasid) 234 235 { 236 + uint16_t index; 237 + 238 + if (inst/4) 239 + index = 0xA + inst%4; 240 + else 241 + index = 0x2 + inst%4; 242 + 243 + WREG32(SOC15_REG_OFFSET(OSSSYS, 0, regIH_VMID_LUT_INDEX), index); 244 + 235 245 *p_pasid = RREG32(SOC15_REG_OFFSET(OSSSYS, 0, regIH_VMID_0_LUT) + vmid) & 0xffff; 236 246 237 247 return !!(*p_pasid); ··· 360 350 for (vmid = 1; vmid < 16; vmid++) { 361 351 bool valid; 362 352 363 - valid = gmc_v12_1_get_vmid_pasid_mapping_info(adev, vmid, 353 + valid = gmc_v12_1_get_vmid_pasid_mapping_info(adev, vmid, inst, 364 354 &queried); 365 355 if (!valid || queried != pasid) 366 356 continue;