drm/amdgpu/psp11: TA firmware is optional (v3)
Subsystems (2)
PATCH 1/1 drm/amdgpu/psp11: TA firmware is optional (v3)
Don't warn or fail if it's missing.
v2: handle xgmi case more gracefully.
v3: handle older kernels properly
--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 9 ++++++-- drivers/gpu/drm/amd/amdgpu/psp_v11_0.c | 28 ++++++++++++++----------- 2 files changed, 23 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +7 -2
@@ -90,8 +90,10 @@ static int psp_sw_fini(void *handle) adev->psp.sos_fw =NULL ;release_firmware (adev->psp.asd_fw); adev->psp.asd_fw =NULL ; -release_firmware (adev->psp.ta_fw); - adev->psp.ta_fw =NULL ; +if (adev->psp.ta_fw) { +release_firmware (adev->psp.ta_fw); + adev->psp.ta_fw =NULL ; + }return 0 ; }
@@ -435,6 +437,9 @@ static int psp_xgmi_initialize(struct psp_context *psp)struct ta_xgmi_shared_memory *xgmi_cmd;int ret; +if (!psp->adev->psp.ta_fw) +return -ENOENT ; +if (!psp->xgmi_context.initialized) { ret =psp_xgmi_init_shared_buf (psp);if (ret)
drivers/gpu/drm/amd/amdgpu/psp_v11_0.c +16 -12
@@ -152,18 +152,22 @@ static int psp_v11_0_init_microcode(struct psp_context *psp)snprintf (fw_name,sizeof (fw_name),"amdgpu/%s_ta.bin" , chip_name); err =request_firmware (&adev->psp.ta_fw, fw_name, adev->dev); -if (err) - goto out2; - - err =amdgpu_ucode_validate (adev->psp.ta_fw); -if (err) - goto out2; - - ta_hdr = (const struct ta_firmware_header_v1_0 *)adev->psp.ta_fw->data; - adev->psp.ta_xgmi_ucode_version =le32_to_cpu (ta_hdr->ta_xgmi_ucode_version); - adev->psp.ta_xgmi_ucode_size =le32_to_cpu (ta_hdr->ta_xgmi_size_bytes); - adev->psp.ta_xgmi_start_addr = (uint8_t *)ta_hdr + -le32_to_cpu (ta_hdr->header.ucode_array_offset_bytes); +if (err) { +release_firmware (adev->psp.ta_fw); + adev->psp.ta_fw =NULL ; +dev_info (adev->dev, +"psp v11.0: Failed to load firmware \"%s\"\n" , fw_name); + }else { + err =amdgpu_ucode_validate (adev->psp.ta_fw); +if (err) + goto out2; + + ta_hdr = (const struct ta_firmware_header_v1_0 *)adev->psp.ta_fw->data; + adev->psp.ta_xgmi_ucode_version =le32_to_cpu (ta_hdr->ta_xgmi_ucode_version); + adev->psp.ta_xgmi_ucode_size =le32_to_cpu (ta_hdr->ta_xgmi_size_bytes); + adev->psp.ta_xgmi_start_addr = (uint8_t *)ta_hdr + +le32_to_cpu (ta_hdr->header.ucode_array_offset_bytes); + }return 0 ;
Signature · 6 lines
2.20.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20190212211047.16894-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org
Zhang, Hawking
Reviewed-by Hawking ZhangRegards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher via amd-gfx
Sent: 2019年2月13日 5:11
To: [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH] drm/amdgpu/psp11: TA firmware is optional (v3)
Don't warn or fail if it's missing.
v2: handle xgmi case more gracefully.
v3: handle older kernels properly
--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 9 ++++++-- drivers/gpu/drm/amd/amdgpu/psp_v11_0.c | 28 ++++++++++++++----------- 2 files changed, 23 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +7 -2
@@ -90,8 +90,10 @@ static int psp_sw_fini(void *handle) adev->psp.sos_fw =NULL ;release_firmware (adev->psp.asd_fw); adev->psp.asd_fw =NULL ; -release_firmware (adev->psp.ta_fw); - adev->psp.ta_fw =NULL ; +if (adev->psp.ta_fw) { +release_firmware (adev->psp.ta_fw); + adev->psp.ta_fw =NULL ; + }return 0 ; }
@@ -435,6 +437,9 @@ static int psp_xgmi_initialize(struct psp_context *psp)struct ta_xgmi_shared_memory *xgmi_cmd;int ret; +if (!psp->adev->psp.ta_fw) +return -ENOENT ; +if (!psp->xgmi_context.initialized) { ret =psp_xgmi_init_shared_buf (psp);if (ret)
drivers/gpu/drm/amd/amdgpu/psp_v11_0.c +16 -12
@@ -152,18 +152,22 @@ static int psp_v11_0_init_microcode(struct psp_context *psp)snprintf (fw_name,sizeof (fw_name),"amdgpu/%s_ta.bin" , chip_name); err =request_firmware (&adev->psp.ta_fw, fw_name, adev->dev); -if (err) - goto out2; - - err =amdgpu_ucode_validate (adev->psp.ta_fw); -if (err) - goto out2; - - ta_hdr = (const struct ta_firmware_header_v1_0 *)adev->psp.ta_fw->data; - adev->psp.ta_xgmi_ucode_version =le32_to_cpu (ta_hdr->ta_xgmi_ucode_version); - adev->psp.ta_xgmi_ucode_size =le32_to_cpu (ta_hdr->ta_xgmi_size_bytes); - adev->psp.ta_xgmi_start_addr = (uint8_t *)ta_hdr + -le32_to_cpu (ta_hdr->header.ucode_array_offset_bytes); +if (err) { +release_firmware (adev->psp.ta_fw); + adev->psp.ta_fw =NULL ; +dev_info (adev->dev, +"psp v11.0: Failed to load firmware \"%s\"\n" , fw_name); + }else { + err =amdgpu_ucode_validate (adev->psp.ta_fw); +if (err) + goto out2; + + ta_hdr = (const struct ta_firmware_header_v1_0 *)adev->psp.ta_fw->data; + adev->psp.ta_xgmi_ucode_version =le32_to_cpu (ta_hdr->ta_xgmi_ucode_version); + adev->psp.ta_xgmi_ucode_size =le32_to_cpu (ta_hdr->ta_xgmi_size_bytes); + adev->psp.ta_xgmi_start_addr = (uint8_t *)ta_hdr + +le32_to_cpu (ta_hdr->header.ucode_array_offset_bytes); + }return 0 ;
--
2.20.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): BYAPR12MB263267B5A8CC64B2A6E7E90FFC660-ZGDeBxoHBPk+ukJnzp2+RQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
This patch is
Quoted 90 lines · Hawking
Reviewed-by Hawking Zhang <[email protected]>Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher via amd-gfx
Sent: 2019年2月13日 5:11
To: [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH] drm/amdgpu/psp11: TA firmware is optional (v3)Don't warn or fail if it's missing.
v2: handle xgmi case more gracefully.
v3: handle older kernels properlySigned-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 9 ++++++-- drivers/gpu/drm/amd/amdgpu/psp_v11_0.c | 28 ++++++++++++++----------- 2 files changed, 23 insertions(+), 14 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +7
-2@@ -90,8 +90,10 @@ static int psp_sw_fini(void *handle) adev->psp.sos_fw =NULL ;release_firmware (adev->psp.asd_fw); adev->psp.asd_fw =NULL ; -release_firmware (adev->psp.ta_fw); - adev->psp.ta_fw =NULL ; +if (adev->psp.ta_fw) { +release_firmware (adev->psp.ta_fw); + adev->psp.ta_fw =NULL ; + }return 0 ; }@@ -435,6 +437,9 @@ static int psp_xgmi_initialize(struct psp_context *psp)struct ta_xgmi_shared_memory *xgmi_cmd;int ret; +if (!psp->adev->psp.ta_fw) +return -ENOENT ; +if (!psp->xgmi_context.initialized) { ret =psp_xgmi_init_shared_buf (psp);if (ret)drivers/gpu/drm/amd/amdgpu/psp_v11_0.c +16
-13@@ -152,18 +152,22 @@ static int psp_v11_0_init_microcode(struct psp_context *psp)snprintf (fw_name,sizeof (fw_name),"amdgpu/%s_ta.bin" , chip_name); err =request_firmware (&adev->psp.ta_fw, fw_name, adev->dev); -if (err) - goto out2; - - err =amdgpu_ucode_validate (adev->psp.ta_fw); -if (err) - goto out2; - - ta_hdr = (const struct ta_firmware_header_v1_0 *)adev->psp.ta_fw->data; - adev->psp.ta_xgmi_ucode_version =le32_to_cpu (ta_hdr->ta_xgmi_ucode_version); - adev->psp.ta_xgmi_ucode_size =le32_to_cpu (ta_hdr->ta_xgmi_size_bytes); - adev->psp.ta_xgmi_start_addr = (uint8_t *)ta_hdr + -le32_to_cpu (ta_hdr->header.ucode_array_offset_bytes); +if (err) { +release_firmware (adev->psp.ta_fw); + adev->psp.ta_fw =NULL ; +dev_info (adev->dev, +"psp v11.0: Failed to load firmware \"%s\"\n" , fw_name); + }else { + err =amdgpu_ucode_validate (adev->psp.ta_fw); +if (err) + goto out2; + + ta_hdr = (const struct ta_firmware_header_v1_0 *)adev->psp.ta_fw->data; + adev->psp.ta_xgmi_ucode_version =le32_to_cpu (ta_hdr->ta_xgmi_ucode_version); + adev->psp.ta_xgmi_ucode_size =le32_to_cpu (ta_hdr->ta_xgmi_size_bytes); + adev->psp.ta_xgmi_start_addr = (uint8_t *)ta_hdr + +le32_to_cpu (ta_hdr->header.ucode_array_offset_bytes); + }return 0 ; --2.20.1
Quoted 8 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx