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

drm/amdgpu: Fix firmware UCODE_ID_STORAGE issue (v2)

In Tonga's virtualization environment, for firmware UCODE_ID_STORAGE,
there is no actual firmware data, but we still need alloc a BO and
tell the BO's mc address to HW, or world switch will hang on VFs.

v2: fix coding style (Alex)

Signed-off-by: Trigger Huang <trigger.huang@amd.com>
Reviewed-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
Reviewed-by: Monk Liu <monk.liu@amd.com>
Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Trigger Huang and committed by
Alex Deucher
bc108ec7 cbcbea98

+7 -3
+7 -3
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
··· 382 382 * if SMU loaded firmware, it needn't add SMC, UVD, and VCE 383 383 * ucode info here 384 384 */ 385 - if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP) 386 - adev->firmware.max_ucodes = AMDGPU_UCODE_ID_MAXIMUM - 4; 387 - else 385 + if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP) { 386 + if (amdgpu_sriov_vf(adev)) 387 + adev->firmware.max_ucodes = AMDGPU_UCODE_ID_MAXIMUM - 3; 388 + else 389 + adev->firmware.max_ucodes = AMDGPU_UCODE_ID_MAXIMUM - 4; 390 + } else { 388 391 adev->firmware.max_ucodes = AMDGPU_UCODE_ID_MAXIMUM; 392 + } 389 393 390 394 for (i = 0; i < adev->firmware.max_ucodes; i++) { 391 395 ucode = &adev->firmware.ucode[i];