drm/amdgpu: Fix the null pointer about get vbios
Subsystems (2)
PATCH 1/1 drm/amdgpu: Fix the null pointer about get vbios
Move the get vbios only before SDMA block early init to fix null pointer about get vbios.
Signed-off-by Emily Deng <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +12 -11
@@ -1534,18 +1534,19 @@ static int amdgpu_device_ip_early_init(struct amdgpu_device *adev)if (amdgpu_sriov_vf (adev)) adev->pm.pp_feature &= ~PP_GFXOFF_MASK ; -/* Read BIOS */ -if (!amdgpu_get_bios (adev)) -return -EINVAL ; - - r =amdgpu_atombios_init (adev); -if (r) { -dev_err (adev->dev,"amdgpu_atombios_init failed\n" ); -amdgpu_vf_error_put (adev,AMDGIM_ERROR_VF_ATOMBIOS_INIT_FAIL ,0 ,0 ); -return r; - } -for (i =0 ; i < adev->num_ip_blocks; i++) { +if ( adev->ip_blocks[i].version->type ==AMD_IP_BLOCK_TYPE_SDMA ) { +/* Read BIOS */ +if (!amdgpu_get_bios (adev)) +return -EINVAL ; + + r =amdgpu_atombios_init (adev); +if (r) { +dev_err (adev->dev,"amdgpu_atombios_init failed\n" ); +amdgpu_vf_error_put (adev,AMDGIM_ERROR_VF_ATOMBIOS_INIT_FAIL ,0 ,0 ); +return r; + } + }if ((amdgpu_ip_block_mask & (1 << i)) ==0 ) {DRM_ERROR ("disabled ip block: %d <%s>\n" , i, adev->ip_blocks[i].version->funcs->name);
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx