drm/amdgpu/pp/smu7: use a local variable for toc indexing
Subsystems (3)
PATCH 1/4 drm/amdgpu/pp/smu7: use a local variable for toc indexing
Rather than using the index variable stored in vram. If the device fails to come back online after a resume cycle, reads from vram will return all 1s which will cause a segfault. Based on a patch from Thomas Martitz <[email protected]>. This avoids the segfault, but we still need to sort out why the GPU does not come back online after a resume.
--- drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c | 23 +++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c +12 -11
@@ -381,6 +381,7 @@ int smu7_request_smu_load_fw(struct pp_hwmgr *hwmgr)uint32_t fw_to_load;int result =0 ;struct SMU_DRAMData_TOC *toc; +uint32_t num_entries =0 ;if (!hwmgr->reload_fw) {pr_info ("skip reloading...\n" );
@@ -422,41 +423,41 @@ int smu7_request_smu_load_fw(struct pp_hwmgr *hwmgr) } toc = (struct SMU_DRAMData_TOC *)smu_data->header; - toc->num_entries =0 ; toc->structure_version =1 ;PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_RLC_G , &toc->entry[toc->num_entries++]), +UCODE_ID_RLC_G , &toc->entry[num_entries++]),"Failed to Get Firmware Entry." , return -EINVAL );PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_CP_CE , &toc->entry[toc->num_entries++]), +UCODE_ID_CP_CE , &toc->entry[num_entries++]),"Failed to Get Firmware Entry." , return -EINVAL );PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_CP_PFP , &toc->entry[toc->num_entries++]), +UCODE_ID_CP_PFP , &toc->entry[num_entries++]),"Failed to Get Firmware Entry." , return -EINVAL );PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_CP_ME , &toc->entry[toc->num_entries++]), +UCODE_ID_CP_ME , &toc->entry[num_entries++]),"Failed to Get Firmware Entry." , return -EINVAL );PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_CP_MEC , &toc->entry[toc->num_entries++]), +UCODE_ID_CP_MEC , &toc->entry[num_entries++]),"Failed to Get Firmware Entry." , return -EINVAL );PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_CP_MEC_JT1 , &toc->entry[toc->num_entries++]), +UCODE_ID_CP_MEC_JT1 , &toc->entry[num_entries++]),"Failed to Get Firmware Entry." , return -EINVAL );PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_CP_MEC_JT2 , &toc->entry[toc->num_entries++]), +UCODE_ID_CP_MEC_JT2 , &toc->entry[num_entries++]),"Failed to Get Firmware Entry." , return -EINVAL );PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_SDMA0 , &toc->entry[toc->num_entries++]), +UCODE_ID_SDMA0 , &toc->entry[num_entries++]),"Failed to Get Firmware Entry." , return -EINVAL );PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_SDMA1 , &toc->entry[toc->num_entries++]), +UCODE_ID_SDMA1 , &toc->entry[num_entries++]),"Failed to Get Firmware Entry." , return -EINVAL );if (!hwmgr->not_vf)PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_MEC_STORAGE , &toc->entry[toc->num_entries++]), +UCODE_ID_MEC_STORAGE , &toc->entry[num_entries++]),"Failed to Get Firmware Entry." , return -EINVAL ); + toc->num_entries = num_entries;smu7_send_msg_to_smc_with_parameter (hwmgr,PPSMC_MSG_DRV_DRAM_ADDR_HI ,upper_32_bits (smu_data->header_buffer.mc_addr));smu7_send_msg_to_smc_with_parameter (hwmgr,PPSMC_MSG_DRV_DRAM_ADDR_LO ,lower_32_bits (smu_data->header_buffer.mc_addr));
Signature · 1 line
2.13.6
A message that is not in the archive (sent off-list or not yet received): 20180712143941.28977-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org
PATCH 2/4 drm/amdgpu/pp/smu7: drop unused values in smu data structure
use kaddr directly rather than secondary variable.
--- drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c | 3 +-- drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.h | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c +1 -2
@@ -422,7 +422,7 @@ int smu7_request_smu_load_fw(struct pp_hwmgr *hwmgr) +UCODE_ID_CP_MEC_JT2_MASK ; } - toc = (struct SMU_DRAMData_TOC *)smu_data->header; + toc = (struct SMU_DRAMData_TOC *)smu_data->header_buffer.kaddr; toc->structure_version =1 ; PP_ASSERT_WITH_CODE(0 == smu7_populate_single_firmware_entry(hwmgr,
@@ -591,7 +591,6 @@ int smu7_init(struct pp_hwmgr *hwmgr)if (r)return -EINVAL ; - smu_data->header = smu_data->header_buffer.kaddr; smu_data->header_buffer.mc_addr = mc_addr;if (!hwmgr->not_vf)
drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.h +0 -2
@@ -37,8 +37,6 @@ struct smu7_buffer_entry { };struct smu7_smumgr { -uint8_t *header; -uint8_t *mec_image;struct smu7_buffer_entry smu_buffer;struct smu7_buffer_entry header_buffer;
Signature · 6 lines
2.13.6 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/4 drm/amdgpu/pp/smu7: remove local mc_addr variable
In reply to a message not in the archiveuse the structure member directly.
--- drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c +2 -6
@@ -571,7 +571,6 @@ int smu7_setup_pwr_virus(struct pp_hwmgr *hwmgr)int smu7_init (struct pp_hwmgr *hwmgr) {struct smu7_smumgr *smu_data; -uint64_t mc_addr =0 ;int r;/* Allocate memory for backend private data */ smu_data = (struct smu7_smumgr *)(hwmgr->smu_backend);
@@ -585,14 +584,12 @@ int smu7_init(struct pp_hwmgr *hwmgr)PAGE_SIZE ,AMDGPU_GEM_DOMAIN_VRAM , &smu_data->header_buffer.handle, - &mc_addr, + &smu_data->header_buffer.mc_addr, &smu_data->header_buffer.kaddr);if (r)return -EINVAL ; - smu_data->header_buffer.mc_addr = mc_addr; -if (!hwmgr->not_vf)return 0 ;
@@ -602,7 +599,7 @@ int smu7_init(struct pp_hwmgr *hwmgr)PAGE_SIZE ,AMDGPU_GEM_DOMAIN_VRAM , &smu_data->smu_buffer.handle, - &mc_addr, + &smu_data->smu_buffer.mc_addr, &smu_data->smu_buffer.kaddr);if (r) {
@@ -611,7 +608,6 @@ int smu7_init(struct pp_hwmgr *hwmgr) &smu_data->header_buffer.kaddr);return -EINVAL ; } - smu_data->smu_buffer.mc_addr = mc_addr;if (smum_is_hw_avfs_present (hwmgr)) hwmgr->avfs_supported = true;
Signature · 6 lines
2.13.6 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/4 drm/amdgpu/pp/smu7: cache smu firmware toc
In reply to a message not in the archiveRather than calculating it everytime we rebuild the toc buffer, calculate it once initially and then just copy the cached results to the vram buffer.
--- drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c | 92 +++++++++++++--------- drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.h | 1 + 2 files changed, 54 insertions(+), 39 deletions(-)
drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c +53 -39
@@ -379,9 +379,7 @@ int smu7_request_smu_load_fw(struct pp_hwmgr *hwmgr) {struct smu7_smumgr *smu_data = (struct smu7_smumgr *)(hwmgr->smu_backend);uint32_t fw_to_load; -int result =0 ; -struct SMU_DRAMData_TOC *toc; -uint32_t num_entries =0 ; +int r =0 ;if (!hwmgr->reload_fw) {pr_info ("skip reloading...\n" );
@@ -422,49 +420,62 @@ int smu7_request_smu_load_fw(struct pp_hwmgr *hwmgr) +UCODE_ID_CP_MEC_JT2_MASK ; } - toc = (struct SMU_DRAMData_TOC *)smu_data->header_buffer.kaddr; - toc->structure_version =1 ; - -PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_RLC_G , &toc->entry[num_entries++]), -"Failed to Get Firmware Entry." , return -EINVAL ); -PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_CP_CE , &toc->entry[num_entries++]), -"Failed to Get Firmware Entry." , return -EINVAL ); -PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_CP_PFP , &toc->entry[num_entries++]), -"Failed to Get Firmware Entry." , return -EINVAL ); -PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_CP_ME , &toc->entry[num_entries++]), -"Failed to Get Firmware Entry." , return -EINVAL ); -PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_CP_MEC , &toc->entry[num_entries++]), -"Failed to Get Firmware Entry." , return -EINVAL ); -PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_CP_MEC_JT1 , &toc->entry[num_entries++]), -"Failed to Get Firmware Entry." , return -EINVAL ); -PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_CP_MEC_JT2 , &toc->entry[num_entries++]), -"Failed to Get Firmware Entry." , return -EINVAL ); -PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_SDMA0 , &toc->entry[num_entries++]), -"Failed to Get Firmware Entry." , return -EINVAL ); -PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_SDMA1 , &toc->entry[num_entries++]), -"Failed to Get Firmware Entry." , return -EINVAL ); -if (!hwmgr->not_vf) -PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_MEC_STORAGE , &toc->entry[num_entries++]), -"Failed to Get Firmware Entry." , return -EINVAL ); +if (!smu_data->toc) { +struct SMU_DRAMData_TOC *toc; - toc->num_entries = num_entries; + smu_data->toc =kzalloc (sizeof (struct SMU_DRAMData_TOC ),GFP_KERNEL ); +if (!smu_data->toc) +return -ENOMEM ; + toc = smu_data->toc; + toc->num_entries =0 ; + toc->structure_version =1 ; + +PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, +UCODE_ID_RLC_G , &toc->entry[toc->num_entries++]), + "Failed to Get Firmware Entry.", r = -EINVAL; goto failed); +PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, +UCODE_ID_CP_CE , &toc->entry[toc->num_entries++]), + "Failed to Get Firmware Entry.", r = -EINVAL; goto failed); +PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, +UCODE_ID_CP_PFP , &toc->entry[toc->num_entries++]), + "Failed to Get Firmware Entry.", r = -EINVAL; goto failed); +PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, +UCODE_ID_CP_ME , &toc->entry[toc->num_entries++]), + "Failed to Get Firmware Entry.", r = -EINVAL; goto failed); +PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, +UCODE_ID_CP_MEC , &toc->entry[toc->num_entries++]), + "Failed to Get Firmware Entry.", r = -EINVAL; goto failed); +PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, +UCODE_ID_CP_MEC_JT1 , &toc->entry[toc->num_entries++]), + "Failed to Get Firmware Entry.", r = -EINVAL; goto failed); +PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, +UCODE_ID_CP_MEC_JT2 , &toc->entry[toc->num_entries++]), + "Failed to Get Firmware Entry.", r = -EINVAL; goto failed); +PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, +UCODE_ID_SDMA0 , &toc->entry[toc->num_entries++]), + "Failed to Get Firmware Entry.", r = -EINVAL; goto failed); +PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, +UCODE_ID_SDMA1 , &toc->entry[toc->num_entries++]), + "Failed to Get Firmware Entry.", r = -EINVAL; goto failed); +if (!hwmgr->not_vf) +PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, +UCODE_ID_MEC_STORAGE , &toc->entry[toc->num_entries++]), + "Failed to Get Firmware Entry.", r = -EINVAL; goto failed); + } +memcpy_toio (smu_data->header_buffer.kaddr, smu_data->toc, +sizeof (struct SMU_DRAMData_TOC ));smu7_send_msg_to_smc_with_parameter (hwmgr,PPSMC_MSG_DRV_DRAM_ADDR_HI ,upper_32_bits (smu_data->header_buffer.mc_addr));smu7_send_msg_to_smc_with_parameter (hwmgr,PPSMC_MSG_DRV_DRAM_ADDR_LO ,lower_32_bits (smu_data->header_buffer.mc_addr));if (smu7_send_msg_to_smc_with_parameter (hwmgr, PPSMC_MSG_LoadUcodes, fw_to_load))pr_err ("Fail to Request SMU Load uCode" ); -return result; +return r; + +failed: +kfree (smu_data->toc); + smu_data->toc =NULL ; +return r; }/* Check if the FW has been loaded, SMU will not return if loading has not finished. */
@@ -629,6 +640,9 @@ int smu7_smu_fini(struct pp_hwmgr *hwmgr) &smu_data->smu_buffer.mc_addr, &smu_data->smu_buffer.kaddr); + +kfree (smu_data->toc); + smu_data->toc =NULL ;kfree (hwmgr->smu_backend); hwmgr->smu_backend =NULL ;return 0 ;
drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.h +1 -0
@@ -39,6 +39,7 @@ struct smu7_buffer_entry {struct smu7_smumgr {struct smu7_buffer_entry smu_buffer;struct smu7_buffer_entry header_buffer; +struct SMU_DRAMData_TOC *toc;uint32_t soft_regs_start;uint32_t dpm_table_start;
Signature · 6 lines
2.13.6 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Zhu, Rex
Reviewed-by Rex ZhuSeries is:
Best Regards
Rex
?? Outlook for Android<https://aka.ms/ghei36>
________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Alex Deucher <[email protected]>
Sent: Thursday, July 12, 2018 10:39:38 PM
To: [email protected]
Cc: Deucher, Alexander; [email protected]
Subject: [PATCH 1/4] drm/amdgpu/pp/smu7: use a local variable for toc indexing
Rather than using the index variable stored in vram. If
the device fails to come back online after a resume cycle,
reads from vram will return all 1s which will cause a
segfault. Based on a patch from Thomas Martitz <[email protected]>. This avoids the segfault, but we still need to sort out
why the GPU does not come back online after a resume.
--- drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c | 23 +++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c +12 -11
@@ -381,6 +381,7 @@ int smu7_request_smu_load_fw(struct pp_hwmgr *hwmgr)uint32_t fw_to_load;int result =0 ;struct SMU_DRAMData_TOC *toc; +uint32_t num_entries =0 ;if (!hwmgr->reload_fw) {pr_info ("skip reloading...\n" );
@@ -422,41 +423,41 @@ int smu7_request_smu_load_fw(struct pp_hwmgr *hwmgr) } toc = (struct SMU_DRAMData_TOC *)smu_data->header; - toc->num_entries =0 ; toc->structure_version =1 ;PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_RLC_G , &toc->entry[toc->num_entries++]), +UCODE_ID_RLC_G , &toc->entry[num_entries++]),"Failed to Get Firmware Entry." , return -EINVAL );PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_CP_CE , &toc->entry[toc->num_entries++]), +UCODE_ID_CP_CE , &toc->entry[num_entries++]),"Failed to Get Firmware Entry." , return -EINVAL );PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_CP_PFP , &toc->entry[toc->num_entries++]), +UCODE_ID_CP_PFP , &toc->entry[num_entries++]),"Failed to Get Firmware Entry." , return -EINVAL );PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_CP_ME , &toc->entry[toc->num_entries++]), +UCODE_ID_CP_ME , &toc->entry[num_entries++]),"Failed to Get Firmware Entry." , return -EINVAL );PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_CP_MEC , &toc->entry[toc->num_entries++]), +UCODE_ID_CP_MEC , &toc->entry[num_entries++]),"Failed to Get Firmware Entry." , return -EINVAL );PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_CP_MEC_JT1 , &toc->entry[toc->num_entries++]), +UCODE_ID_CP_MEC_JT1 , &toc->entry[num_entries++]),"Failed to Get Firmware Entry." , return -EINVAL );PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_CP_MEC_JT2 , &toc->entry[toc->num_entries++]), +UCODE_ID_CP_MEC_JT2 , &toc->entry[num_entries++]),"Failed to Get Firmware Entry." , return -EINVAL );PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_SDMA0 , &toc->entry[toc->num_entries++]), +UCODE_ID_SDMA0 , &toc->entry[num_entries++]),"Failed to Get Firmware Entry." , return -EINVAL );PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_SDMA1 , &toc->entry[toc->num_entries++]), +UCODE_ID_SDMA1 , &toc->entry[num_entries++]),"Failed to Get Firmware Entry." , return -EINVAL );if (!hwmgr->not_vf)PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_MEC_STORAGE , &toc->entry[toc->num_entries++]), +UCODE_ID_MEC_STORAGE , &toc->entry[num_entries++]),"Failed to Get Firmware Entry." , return -EINVAL ); + toc->num_entries = num_entries;smu7_send_msg_to_smc_with_parameter (hwmgr,PPSMC_MSG_DRV_DRAM_ADDR_HI ,upper_32_bits (smu_data->header_buffer.mc_addr));smu7_send_msg_to_smc_with_parameter (hwmgr,PPSMC_MSG_DRV_DRAM_ADDR_LO ,lower_32_bits (smu_data->header_buffer.mc_addr));
--
2.13.6
_______________________________________________
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
Am 12.07.2018 um 16:39 schrieb Alex Deucher:
Quoted 10 lines
Rather than using the index variable stored in vram. If the device fails to come back online after a resume cycle, reads from vram will return all 1s which will cause a segfault. Based on a patch from Thomas Martitz <[email protected]>. This avoids the segfault, but we still need to sort out why the GPU does not come back online after a resume.
Quoted 69 lines
--- drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c | 23 +++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-)drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c +12
-11@@ -381,6 +381,7 @@ int smu7_request_smu_load_fw(struct pp_hwmgr *hwmgr)uint32_t fw_to_load;int result =0 ;struct SMU_DRAMData_TOC *toc; +uint32_t num_entries =0 ;if (!hwmgr->reload_fw) {pr_info ("skip reloading...\n" );@@ -422,41 +423,41 @@ int smu7_request_smu_load_fw(struct pp_hwmgr *hwmgr) } toc = (struct SMU_DRAMData_TOC *)smu_data->header; - toc->num_entries =0 ; toc->structure_version =1 ;PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_RLC_G , &toc->entry[toc->num_entries++]), +UCODE_ID_RLC_G , &toc->entry[num_entries++]),"Failed to Get Firmware Entry." , return -EINVAL );PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_CP_CE , &toc->entry[toc->num_entries++]), +UCODE_ID_CP_CE , &toc->entry[num_entries++]),"Failed to Get Firmware Entry." , return -EINVAL );PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_CP_PFP , &toc->entry[toc->num_entries++]), +UCODE_ID_CP_PFP , &toc->entry[num_entries++]),"Failed to Get Firmware Entry." , return -EINVAL );PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_CP_ME , &toc->entry[toc->num_entries++]), +UCODE_ID_CP_ME , &toc->entry[num_entries++]),"Failed to Get Firmware Entry." , return -EINVAL );PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_CP_MEC , &toc->entry[toc->num_entries++]), +UCODE_ID_CP_MEC , &toc->entry[num_entries++]),"Failed to Get Firmware Entry." , return -EINVAL );PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_CP_MEC_JT1 , &toc->entry[toc->num_entries++]), +UCODE_ID_CP_MEC_JT1 , &toc->entry[num_entries++]),"Failed to Get Firmware Entry." , return -EINVAL );PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_CP_MEC_JT2 , &toc->entry[toc->num_entries++]), +UCODE_ID_CP_MEC_JT2 , &toc->entry[num_entries++]),"Failed to Get Firmware Entry." , return -EINVAL );PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_SDMA0 , &toc->entry[toc->num_entries++]), +UCODE_ID_SDMA0 , &toc->entry[num_entries++]),"Failed to Get Firmware Entry." , return -EINVAL );PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_SDMA1 , &toc->entry[toc->num_entries++]), +UCODE_ID_SDMA1 , &toc->entry[num_entries++]),"Failed to Get Firmware Entry." , return -EINVAL );if (!hwmgr->not_vf)PP_ASSERT_WITH_CODE (0 ==smu7_populate_single_firmware_entry (hwmgr, -UCODE_ID_MEC_STORAGE , &toc->entry[toc->num_entries++]), +UCODE_ID_MEC_STORAGE , &toc->entry[num_entries++]),"Failed to Get Firmware Entry." , return -EINVAL ); + toc->num_entries = num_entries;smu7_send_msg_to_smc_with_parameter (hwmgr,PPSMC_MSG_DRV_DRAM_ADDR_HI ,upper_32_bits (smu_data->header_buffer.mc_addr));smu7_send_msg_to_smc_with_parameter (hwmgr,PPSMC_MSG_DRV_DRAM_ADDR_LO ,lower_32_bits (smu_data->header_buffer.mc_addr));