[AMD Public Use] We shall check ras ta firmware image size or/and ras ta binary start address to exclude ASICs that don't support ras. Introduce asic type check here is unnecessary and the functional also need to be modified every time we add a new asic with ras capablility. Kernel message that indicates ras ta, and other ta are optional one seems no harm to me. this is not limited to ras, but also hdcp/dtm.etc. If people have concern on this kind of messages, we can leverage amdgpu_ras_checked_support to only allow the message for ASICs that support RAS, although I don't think that is necessary. Regards, Hawking -----Original Message----- From: Chen, Guchun <Guchun.Chen@xxxxxxx> Sent: Monday, January 4, 2021 12:58 To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx; Deucher, Alexander <Alexander.Deucher@xxxxxxx>; Zhang, Hawking <Hawking.Zhang@xxxxxxx>; Yang, Stanley <Stanley.Yang@xxxxxxx>; Li, Dennis <Dennis.Li@xxxxxxx>; Zhou1, Tao <Tao.Zhou1@xxxxxxx>; Clements, John <John.Clements@xxxxxxx> Cc: Chen, Guchun <Guchun.Chen@xxxxxxx> Subject: [PATCH] drm/amdgpu: drop ras ta firmware loading for non-ras asic Otherwise, below confused message is always printed during boot for asics without ras feature, but with common ta firmware. amdgpu: RAS: optional ras ta ucode is not available Signed-off-by: Guchun Chen <guchun.chen@xxxxxxx> --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 5 +++-- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 22 ++++++++++++---------- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h | 2 ++ 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index eb19ae734396..730bc1fe2036 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c @@ -1135,9 +1135,10 @@ static int psp_ras_initialize(struct psp_context *psp) int ret; /* - * TODO: bypass the initialize in sriov for now + * TODO: bypass the initialize in sriov and non-ras case */ - if (amdgpu_sriov_vf(psp->adev)) + if (amdgpu_sriov_vf(psp->adev) || + !amdgpu_ras_check_enablement_by_asic(psp->adev)) return 0; if (!psp->adev->psp.ta_ras_ucode_size || diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c index c136bd449744..41d97e56271e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c @@ -1897,15 +1897,17 @@ int amdgpu_ras_request_reset_on_boot(struct amdgpu_device *adev, return 0; } -static int amdgpu_ras_check_asic_type(struct amdgpu_device *adev) -{ - if (adev->asic_type != CHIP_VEGA10 && - adev->asic_type != CHIP_VEGA20 && - adev->asic_type != CHIP_ARCTURUS && - adev->asic_type != CHIP_SIENNA_CICHLID) - return 1; - else - return 0; +bool amdgpu_ras_check_enablement_by_asic(struct amdgpu_device *adev) { + switch (adev->asic_type) { + case CHIP_VEGA10: + case CHIP_VEGA20: + case CHIP_ARCTURUS: + case CHIP_SIENNA_CICHLID: + return true; + default: + return false; + } } /* @@ -1924,7 +1926,7 @@ static void amdgpu_ras_check_supported(struct amdgpu_device *adev, *supported = 0; if (amdgpu_sriov_vf(adev) || !adev->is_atom_fw || - amdgpu_ras_check_asic_type(adev)) + !amdgpu_ras_check_enablement_by_asic(adev)) return; if (amdgpu_atomfirmware_mem_ecc_supported(adev)) { diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h index 762f5e46c007..06b5f9d14bea 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h @@ -629,4 +629,6 @@ void amdgpu_ras_global_ras_isr(struct amdgpu_device *adev); void amdgpu_ras_set_error_query_ready(struct amdgpu_device *adev, bool ready); bool amdgpu_ras_need_emergency_restart(struct amdgpu_device *adev); + +bool amdgpu_ras_check_enablement_by_asic(struct amdgpu_device *adev); #endif -- 2.17.1 _______________________________________________ amd-gfx mailing list amd-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/amd-gfx