Some cleanups related to missing microcode
Subsystems (3)
cover Some cleanups related to missing microcode
I recently found a noisier experience than I expected with missing microcode. As a result I found that some microcode wasn't being loaded in early_init and some messages were unnecessary.
Mario Limonciello (8):
drm/amd: Drop error message about failing to load DMUB firmware drm/amd: Drop error message about failing to load SDMA firmware drm/amd: Move microcode init from sw_init to early_init for SDMA v5.0 drm/amd: Move microcode init from sw_init to early_init for SDMA v6.0 drm/amd: Move microcode init from sw_init to early_init for SDMA v5.2 drm/amd: Move microcode init from sw_init to early_init for SDMA v3.0 drm/amd: Move microcode init from sw_init to early_init for SDMA v2.4 drm/amd: Move microcode init from sw_init to early_init for CIK SDMA
drivers/gpu/drm/amd/amdgpu/cik_sdma.c | 11 +++++------ drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 11 +++++------ drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 11 +++++------ drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 4 +--- drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c | 4 +--- drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 11 +++++------ drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 11 +++++------ drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c | 11 +++++------ drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 -- 9 files changed, 32 insertions(+), 44 deletions(-)
Signature · 1 line
2.34.1
PATCH 1/8 drm/amd: Drop error message about failing to load DMUB firmware
The error path for DMUB firmware loading is unnecessarily noisy. When a firmware is missing 3 errors show up:
``` amdgpu 0000:07:00.0: Direct firmware load for amdgpu/green_sardine_dmcub.bin failed with error -2 [drm:dm_early_init [amdgpu]] *ERROR* DMUB firmware loading failed: -19 [drm:amdgpu_device_init [amdgpu]] *ERROR* early_init of IP block <dm> failed -19 ```
The error code for the device init is bubbled up already, remove the second one.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 -- 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -2
@@ -4758,8 +4758,6 @@ static int dm_init_microcode(struct amdgpu_device *adev)return 0 ; } r =amdgpu_ucode_request (adev, &adev->dm.dmub_fw, fw_name_dmub); -if (r) -DRM_ERROR ("DMUB firmware loading failed: %d\n" , r);return r; }
Signature · 1 line
2.34.1
PATCH 2/8 drm/amd: Drop error message about failing to load SDMA firmware
In reply to Mario LimoncielloThe error path for SDMA firmware loading is unnecessarily noisy. When a firmware is missing 3 errors show up:
``` amdgpu 0000:07:00.0: Direct firmware load for amdgpu/green_sardine_sdma.bin failed with error -2 [drm:sdma_v4_0_early_init [amdgpu]] *ERROR* Failed to load sdma firmware! [drm:amdgpu_device_init [amdgpu]] *ERROR* early_init of IP block <sdma_v4_0> failed -19 ```
The error code for the device init is bubbled up already, remove the second one.
--- drivers/gpu/drm/amd/amdgpu/cik_sdma.c | 4 +--- drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 4 +--- drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 4 +--- drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 4 +--- drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c | 4 +--- drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 4 +--- drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 4 +--- drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c | 4 +--- 8 files changed, 8 insertions(+), 24 deletions(-)
drivers/gpu/drm/amd/amdgpu/cik_sdma.c +1 -3
@@ -943,10 +943,8 @@ static int cik_sdma_sw_init(void *handle)int r, i; r =cik_sdma_init_microcode (adev); -if (r) { -DRM_ERROR ("Failed to load sdma firmware!\n" ); +if (r)return r; - }/* SDMA trap event */ r = amdgpu_irq_add_id(adev, AMDGPU_IRQ_CLIENTID_LEGACY, 224,
drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c +1 -3
@@ -852,10 +852,8 @@ static int sdma_v2_4_sw_init(void *handle)return r; r =sdma_v2_4_init_microcode (adev); -if (r) { -DRM_ERROR ("Failed to load sdma firmware!\n" ); +if (r)return r; - }for (i =0 ; i < adev->sdma.num_instances; i++) { ring = &adev->sdma.instance[i].ring;
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c +1 -3
@@ -1130,10 +1130,8 @@ static int sdma_v3_0_sw_init(void *handle)return r; r =sdma_v3_0_init_microcode (adev); -if (r) { -DRM_ERROR ("Failed to load sdma firmware!\n" ); +if (r)return r; - }for (i =0 ; i < adev->sdma.num_instances; i++) { ring = &adev->sdma.instance[i].ring;
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +1 -3
@@ -1720,10 +1720,8 @@ static int sdma_v4_0_early_init(void *handle)int r; r =sdma_v4_0_init_microcode (adev); -if (r) { -DRM_ERROR ("Failed to load sdma firmware!\n" ); +if (r)return r; - }/* TODO: Page queue breaks driver reload under SRIOV */ if ((amdgpu_ip_version(adev, SDMA0_HWIP, 0) == IP_VERSION(4, 0, 0)) &&
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c +1 -3
@@ -1246,10 +1246,8 @@ static int sdma_v4_4_2_early_init(void *handle)int r; r =sdma_v4_4_2_init_microcode (adev); -if (r) { -DRM_ERROR ("Failed to load sdma firmware!\n" ); +if (r)return r; - }/* TODO: Page queue breaks driver reload under SRIOV */ if (sdma_v4_4_2_fw_support_paging_queue (adev))
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c +1 -3
@@ -1368,10 +1368,8 @@ static int sdma_v5_0_sw_init(void *handle)return r; r =sdma_v5_0_init_microcode (adev); -if (r) { -DRM_ERROR ("Failed to load sdma firmware!\n" ); +if (r)return r; - }for (i =0 ; i < adev->sdma.num_instances; i++) { ring = &adev->sdma.instance[i].ring;
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c +1 -3
@@ -1232,10 +1232,8 @@ static int sdma_v5_2_sw_init(void *handle) } r =amdgpu_sdma_init_microcode (adev,0 , true); -if (r) { -DRM_ERROR ("Failed to load sdma firmware!\n" ); +if (r)return r; - }for (i =0 ; i < adev->sdma.num_instances; i++) { ring = &adev->sdma.instance[i].ring;
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +1 -3
@@ -1283,10 +1283,8 @@ static int sdma_v6_0_sw_init(void *handle)return r; r =amdgpu_sdma_init_microcode (adev,0 , true); -if (r) { -DRM_ERROR ("Failed to load sdma firmware!\n" ); +if (r)return r; - }for (i =0 ; i < adev->sdma.num_instances; i++) { ring = &adev->sdma.instance[i].ring;
Signature · 1 line
2.34.1
PATCH 3/8 drm/amd: Move microcode init from sw_init to early_init for SDMA v5.0
In reply to Mario LimoncielloAs part of IP discovery early_init is run for all HW IP blocks. During this phase all firmware is supposed to be identified that may be missing so that the driver can avoid releasing resources used by the EFI framebuffer or simpledrm until the last possible moment.
Move microcode loading from sw_init to early_init.
--- drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c +5 -4
@@ -1336,6 +1336,11 @@ static void sdma_v5_0_ring_emit_reg_write_reg_wait(struct amdgpu_ring *ring,static int sdma_v5_0_early_init (void *handle) {struct amdgpu_device *adev = (struct amdgpu_device *)handle; +int r; + + r =sdma_v5_0_init_microcode (adev); +if (r) +return r;sdma_v5_0_set_ring_funcs (adev);sdma_v5_0_set_buffer_funcs (adev);
@@ -1367,10 +1372,6 @@ static int sdma_v5_0_sw_init(void *handle)if (r)return r; - r =sdma_v5_0_init_microcode (adev); -if (r) -return r; -for (i =0 ; i < adev->sdma.num_instances; i++) { ring = &adev->sdma.instance[i].ring; ring->ring_obj =NULL ;
Signature · 1 line
2.34.1
PATCH 4/8 drm/amd: Move microcode init from sw_init to early_init for SDMA v6.0
In reply to Mario LimoncielloAs part of IP discovery early_init is run for all HW IP blocks. During this phase all firmware is supposed to be identified that may be missing so that the driver can avoid releasing resources used by the EFI framebuffer or simpledrm until the last possible moment.
Move microcode loading from sw_init to early_init.
--- drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +5 -4
@@ -1258,6 +1258,11 @@ static void sdma_v6_0_set_ras_funcs(struct amdgpu_device *adev)static int sdma_v6_0_early_init (void *handle) {struct amdgpu_device *adev = (struct amdgpu_device *)handle; +int r; + + r =amdgpu_sdma_init_microcode (adev,0 , true); +if (r) +return r;sdma_v6_0_set_ring_funcs (adev);sdma_v6_0_set_buffer_funcs (adev);
@@ -1282,10 +1287,6 @@ static int sdma_v6_0_sw_init(void *handle)if (r)return r; - r =amdgpu_sdma_init_microcode (adev,0 , true); -if (r) -return r; -for (i =0 ; i < adev->sdma.num_instances; i++) { ring = &adev->sdma.instance[i].ring; ring->ring_obj =NULL ;
Signature · 1 line
2.34.1
PATCH 5/8 drm/amd: Move microcode init from sw_init to early_init for SDMA v5.2
In reply to Mario LimoncielloAs part of IP discovery early_init is run for all HW IP blocks. During this phase all firmware is supposed to be identified that may be missing so that the driver can avoid releasing resources used by the EFI framebuffer or simpledrm until the last possible moment.
Move microcode loading from sw_init to early_init.
--- drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c +5 -4
@@ -1172,6 +1172,11 @@ static void sdma_v5_2_ring_emit_reg_write_reg_wait(struct amdgpu_ring *ring,static int sdma_v5_2_early_init (void *handle) {struct amdgpu_device *adev = (struct amdgpu_device *)handle; +int r; + + r =amdgpu_sdma_init_microcode (adev,0 , true); +if (r) +return r;sdma_v5_2_set_ring_funcs (adev);sdma_v5_2_set_buffer_funcs (adev);
@@ -1231,10 +1236,6 @@ static int sdma_v5_2_sw_init(void *handle)return r; } - r =amdgpu_sdma_init_microcode (adev,0 , true); -if (r) -return r; -for (i =0 ; i < adev->sdma.num_instances; i++) { ring = &adev->sdma.instance[i].ring; ring->ring_obj =NULL ;
Signature · 1 line
2.34.1
PATCH 6/8 drm/amd: Move microcode init from sw_init to early_init for SDMA v3.0
In reply to Mario LimoncielloAs part of IP discovery early_init is run for all HW IP blocks. During this phase all firmware is supposed to be identified that may be missing so that the driver can avoid releasing resources used by the EFI framebuffer or simpledrm until the last possible moment.
Move microcode loading from sw_init to early_init.
--- drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c +5 -4
@@ -1087,6 +1087,7 @@ static void sdma_v3_0_ring_emit_wreg(struct amdgpu_ring *ring,static int sdma_v3_0_early_init (void *handle) {struct amdgpu_device *adev = (struct amdgpu_device *)handle; +int r;switch (adev->asic_type) {case CHIP_STONEY :
@@ -1097,6 +1098,10 @@ static int sdma_v3_0_early_init(void *handle)break ; } + r =sdma_v3_0_init_microcode (adev); +if (r) +return r; +sdma_v3_0_set_ring_funcs (adev);sdma_v3_0_set_buffer_funcs (adev);sdma_v3_0_set_vm_pte_funcs (adev);
@@ -1129,10 +1134,6 @@ static int sdma_v3_0_sw_init(void *handle)if (r)return r; - r =sdma_v3_0_init_microcode (adev); -if (r) -return r; -for (i =0 ; i < adev->sdma.num_instances; i++) { ring = &adev->sdma.instance[i].ring; ring->ring_obj =NULL ;
Signature · 1 line
2.34.1
PATCH 7/8 drm/amd: Move microcode init from sw_init to early_init for SDMA v2.4
In reply to Mario LimoncielloAs part of IP discovery early_init is run for all HW IP blocks. During this phase all firmware is supposed to be identified that may be missing so that the driver can avoid releasing resources used by the EFI framebuffer or simpledrm until the last possible moment.
Move microcode loading from sw_init to early_init.
--- drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c +5 -4
@@ -816,6 +816,11 @@ static void sdma_v2_4_ring_emit_wreg(struct amdgpu_ring *ring,static int sdma_v2_4_early_init (void *handle) {struct amdgpu_device *adev = (struct amdgpu_device *)handle; +int r; + + r =sdma_v2_4_init_microcode (adev); +if (r) +return r; adev->sdma.num_instances =SDMA_MAX_INSTANCE ;
@@ -851,10 +856,6 @@ static int sdma_v2_4_sw_init(void *handle)if (r)return r; - r =sdma_v2_4_init_microcode (adev); -if (r) -return r; -for (i =0 ; i < adev->sdma.num_instances; i++) { ring = &adev->sdma.instance[i].ring; ring->ring_obj =NULL ;
Signature · 1 line
2.34.1
PATCH 8/8 drm/amd: Move microcode init from sw_init to early_init for CIK SDMA
In reply to Mario LimoncielloAs part of IP discovery early_init is run for all HW IP blocks. During this phase all firmware is supposed to be identified that may be missing so that the driver can avoid releasing resources used by the EFI framebuffer or simpledrm until the last possible moment.
Move microcode loading from sw_init to early_init.
--- drivers/gpu/drm/amd/amdgpu/cik_sdma.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/cik_sdma.c +5 -4
@@ -925,9 +925,14 @@ static void cik_enable_sdma_mgls(struct amdgpu_device *adev,static int cik_sdma_early_init (void *handle) {struct amdgpu_device *adev = (struct amdgpu_device *)handle; +int r; adev->sdma.num_instances =SDMA_MAX_INSTANCE ; + r =cik_sdma_init_microcode (adev); +if (r) +return r; +cik_sdma_set_ring_funcs (adev);cik_sdma_set_irq_funcs (adev);cik_sdma_set_buffer_funcs (adev);
@@ -942,10 +947,6 @@ static int cik_sdma_sw_init(void *handle)struct amdgpu_device *adev = (struct amdgpu_device *)handle;int r, i; - r =cik_sdma_init_microcode (adev); -if (r) -return r; -/* SDMA trap event */ r =amdgpu_irq_add_id (adev,AMDGPU_IRQ_CLIENTID_LEGACY ,224 , &adev->sdma.trap_irq);
Signature · 1 line
2.34.1
Quoted 4 lines · Mario Limonciello
I recently found a noisier experience than I expected with missing microcode. As a result I found that some microcode wasn't being loaded in
early_initand some messages were unnecessary.
Series is:
Quoted 25 lines
Mario Limonciello (8):
drm/amd: Drop error message about failing to load DMUB firmware drm/amd: Drop error message about failing to load SDMA firmware drm/amd: Move microcode init fromsw_inittoearly_initfor SDMA v5.0 drm/amd: Move microcode init fromsw_inittoearly_initfor SDMA v6.0 drm/amd: Move microcode init fromsw_inittoearly_initfor SDMA v5.2 drm/amd: Move microcode init fromsw_inittoearly_initfor SDMA v3.0 drm/amd: Move microcode init fromsw_inittoearly_initfor SDMA v2.4 drm/amd: Move microcode init fromsw_inittoearly_initfor CIK SDMAdrivers/gpu/drm/amd/amdgpu/cik_sdma.c | 11 +++++------ drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 11 +++++------ drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 11 +++++------ drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 4 +--- drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c | 4 +--- drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 11 +++++------ drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 11 +++++------ drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c | 11 +++++------ drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 -- 9 files changed, 32 insertions(+), 44 deletions(-)--
2.34.1