aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
diff options
context:
space:
mode:
authorTrigger Huang <trigger.huang@amd.com>2017-04-11 01:56:36 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-04-28 17:32:14 -0400
commitbc108ec78e2af5c7a5f6ef27e264b8093bd60e3b (patch)
treef3ece0da5d244572495b0331e84d8bdc731faee6 /drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
parentcbcbea982af59d0a4c40dacfb6ff164a533fd1d9 (diff)
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>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
index a1891c93cdbf..dfd1c98efa7c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
@@ -382,10 +382,14 @@ int amdgpu_ucode_init_bo(struct amdgpu_device *adev)
382 * if SMU loaded firmware, it needn't add SMC, UVD, and VCE 382 * if SMU loaded firmware, it needn't add SMC, UVD, and VCE
383 * ucode info here 383 * ucode info here
384 */ 384 */
385 if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP) 385 if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP) {
386 adev->firmware.max_ucodes = AMDGPU_UCODE_ID_MAXIMUM - 4; 386 if (amdgpu_sriov_vf(adev))
387 else 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 adev->firmware.max_ucodes = AMDGPU_UCODE_ID_MAXIMUM; 391 adev->firmware.max_ucodes = AMDGPU_UCODE_ID_MAXIMUM;
392 }
389 393
390 for (i = 0; i < adev->firmware.max_ucodes; i++) { 394 for (i = 0; i < adev->firmware.max_ucodes; i++) {
391 ucode = &adev->firmware.ucode[i]; 395 ucode = &adev->firmware.ucode[i];