drm/amd/pm: move smu ppt->post_init() into smu_hw_init() stage
Subsystems (3)
PATCH 1/1 drm/amd/pm: move smu ppt->post_init() into smu_hw_init() stage
it is more reasonable to move smu post_init() from late_init() to hw_init() stage, beacuse the smu specific hw init should be done before call other ip block late_init funcs.
--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +6 -6
@@ -891,12 +891,6 @@ static int smu_late_init(struct amdgpu_ip_block *ip_block)if (!smu->pm_enabled)return 0 ; - ret =smu_post_init (smu); -if (ret) { -dev_err (adev->dev,"Failed to post smu init!\n" ); -return ret; - } -/* * Explicitly notify PMFW the power mode the system in. Since * the PMFW may boot the ASIC with a different mode.
@@ -1957,6 +1951,12 @@ static int smu_hw_init(struct amdgpu_ip_block *ip_block)return ret; } + ret =smu_post_init (smu); +if (ret) { +dev_err (adev->dev,"Failed to post smu init!\n" ); +return ret; + } + adev->pm.dpm_enabled = true;dev_info (adev->dev,"SMU is initialized successfully!\n" );
Signature · 1 line
2.34.1
[Public]
There needs to be a specific callback to do SOC specific things during late_init stage. Presently post_init is providing that, I don't think that should be moved.
Thanks,
Lijo
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Yang Wang
Sent: Friday, September 12, 2025 1:38 PM
To: [email protected]
Subject: [PATCH] drm/amd/pm: move smu ppt->post_init() into smu_hw_init() stage
it is more reasonable to move smu post_init() from late_init() to hw_init() stage, beacuse the smu specific hw init should be done before call other ip block late_init funcs.
--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +6 -6
@@ -891,12 +891,6 @@ static int smu_late_init(struct amdgpu_ip_block *ip_block)if (!smu->pm_enabled)return 0 ; - ret =smu_post_init (smu); -if (ret) { -dev_err (adev->dev,"Failed to post smu init!\n" ); -return ret; - } -/* * Explicitly notify PMFW the power mode the system in. Since * the PMFW may boot the ASIC with a different mode.
@@ -1957,6 +1951,12 @@ static int smu_hw_init(struct amdgpu_ip_block *ip_block)return ret; } + ret =smu_post_init (smu); +if (ret) { +dev_err (adev->dev,"Failed to post smu init!\n" ); +return ret; + } + adev->pm.dpm_enabled = true;dev_info (adev->dev,"SMU is initialized successfully!\n" );
--
2.34.1
[Public]
Quoted 1 line
Quoted 1 line
There needs to be a specific callback to do SOC specific things during
late_initstage. Presentlypost_initis providing that, I don't think that should be moved.
@post_init: Helper function for asic specific workarounds.
In the previous code, the "post_init" was mainly used to implement specific WA for smu. If you check these codes, it would be more reasonable to put them in the hw init stage.
Best Regards,
Kevin
-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Friday, September 12, 2025 17:04
To: Wang, Yang(Kevin) <[email protected]>; [email protected]
Subject: RE: [PATCH] drm/amd/pm: move smu ppt->post_init() into smu_hw_init() stage
[Public]
There needs to be a specific callback to do SOC specific things during late_init stage. Presently post_init is providing that, I don't think that should be moved.
Thanks,
Lijo
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Yang Wang
Sent: Friday, September 12, 2025 1:38 PM
To: [email protected]
Subject: [PATCH] drm/amd/pm: move smu ppt->post_init() into smu_hw_init() stage
it is more reasonable to move smu post_init() from late_init() to hw_init() stage, beacuse the smu specific hw init should be done before call other ip block late_init funcs.
--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +6 -6
@@ -891,12 +891,6 @@ static int smu_late_init(struct amdgpu_ip_block *ip_block)if (!smu->pm_enabled)return 0 ; - ret =smu_post_init (smu); -if (ret) { -dev_err (adev->dev,"Failed to post smu init!\n" ); -return ret; - } -/* * Explicitly notify PMFW the power mode the system in. Since * the PMFW may boot the ASIC with a different mode.
@@ -1957,6 +1951,12 @@ static int smu_hw_init(struct amdgpu_ip_block *ip_block)return ret; } + ret =smu_post_init (smu); +if (ret) { +dev_err (adev->dev,"Failed to post smu init!\n" ); +return ret; + } + adev->pm.dpm_enabled = true;dev_info (adev->dev,"SMU is initialized successfully!\n" );
--
2.34.1
[Public]
late_init is the right place to apply any late WA (after that there is no other opportunity). There are already multiple callbacks done during hw_init. Any other SOC specific thing can be done during one of them.
Thanks,
Lijo
-----Original Message-----
From: Wang, Yang(Kevin) <[email protected]>
Sent: Friday, September 12, 2025 2:57 PM
To: Lazar, Lijo <[email protected]>; [email protected]
Subject: RE: [PATCH] drm/amd/pm: move smu ppt->post_init() into smu_hw_init() stage
[Public]
Quoted 1 line
Quoted 1 line
There needs to be a specific callback to do SOC specific things during
late_initstage. Presentlypost_initis providing that, I don't think that should be moved.
@post_init: Helper function for asic specific workarounds.
In the previous code, the "post_init" was mainly used to implement specific WA for smu. If you check these codes, it would be more reasonable to put them in the hw init stage.
Best Regards,
Kevin
-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Friday, September 12, 2025 17:04
To: Wang, Yang(Kevin) <[email protected]>; [email protected]
Subject: RE: [PATCH] drm/amd/pm: move smu ppt->post_init() into smu_hw_init() stage
[Public]
There needs to be a specific callback to do SOC specific things during late_init stage. Presently post_init is providing that, I don't think that should be moved.
Thanks,
Lijo
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Yang Wang
Sent: Friday, September 12, 2025 1:38 PM
To: [email protected]
Subject: [PATCH] drm/amd/pm: move smu ppt->post_init() into smu_hw_init() stage
it is more reasonable to move smu post_init() from late_init() to hw_init() stage, beacuse the smu specific hw init should be done before call other ip block late_init funcs.
--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +6 -6
@@ -891,12 +891,6 @@ static int smu_late_init(struct amdgpu_ip_block *ip_block)if (!smu->pm_enabled)return 0 ; - ret =smu_post_init (smu); -if (ret) { -dev_err (adev->dev,"Failed to post smu init!\n" ); -return ret; - } -/* * Explicitly notify PMFW the power mode the system in. Since * the PMFW may boot the ASIC with a different mode.
@@ -1957,6 +1951,12 @@ static int smu_hw_init(struct amdgpu_ip_block *ip_block)return ret; } + ret =smu_post_init (smu); +if (ret) { +dev_err (adev->dev,"Failed to post smu init!\n" ); +return ret; + } + adev->pm.dpm_enabled = true;dev_info (adev->dev,"SMU is initialized successfully!\n" );
--
2.34.1