summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu
diff options
context:
space:
mode:
authorMario Limonciello <mario.limonciello@amd.com>2023-09-25 14:02:22 -0500
committerAlex Deucher <alexander.deucher@amd.com>2023-09-28 15:38:17 -0400
commit93499bd6cdcbb89008f6e04c5b5691e49968e3bd (patch)
treec34504780a01e1b51c70113479e2b2363ab7a634 /drivers/gpu/drm/amd/amdgpu
parent751e293f2c998eda03004f9b351b0b6bdc335bd9 (diff)
downloadlinux-stable-93499bd6cdcbb89008f6e04c5b5691e49968e3bd.tar.gz
linux-stable-93499bd6cdcbb89008f6e04c5b5691e49968e3bd.tar.bz2
linux-stable-93499bd6cdcbb89008f6e04c5b5691e49968e3bd.zip
drm/amd: Move microcode init from sw_init to early_init for CIK SDMA
As 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. Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/cik_sdma.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
index 4193289ae82f..ee5dce6f6043 100644
--- a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
+++ b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
@@ -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);