From: Hua Zhang <hua.zhang@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Hua Zhang <hua.zhang@amd.com>
Subject: [PATCH] drm/amd/powerplay: skip i2c eeprom init/fini under sriov mode
Date: Fri, 22 May 2020 13:31:02 +0800 [thread overview]
Message-ID: <20200522053102.17307-1-hua.zhang@amd.com> (raw)
i2c eeprom init/fini is only needed under bare mental mode.
Signed-off-by: Hua Zhang <hua.zhang@amd.com>
---
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 24 +++++++++++++---------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
index 8017386d3c33..a78a1f542ea9 100644
--- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
@@ -1363,9 +1363,11 @@ static int smu_hw_init(void *handle)
if (ret)
goto failed;
- ret = smu_i2c_eeprom_init(smu, &adev->pm.smu_i2c);
- if (ret)
- goto failed;
+ if (!amdgpu_sriov_vf(adev)) {
+ ret = smu_i2c_eeprom_init(smu, &adev->pm.smu_i2c);
+ if (ret)
+ goto failed;
+ }
adev->pm.dpm_enabled = true;
@@ -1406,9 +1408,9 @@ static int smu_hw_fini(void *handle)
adev->pm.dpm_enabled = false;
- smu_i2c_eeprom_fini(smu, &adev->pm.smu_i2c);
-
if (!amdgpu_sriov_vf(adev)){
+ smu_i2c_eeprom_fini(smu, &adev->pm.smu_i2c);
+
ret = smu_stop_thermal_control(smu);
if (ret) {
pr_warn("Fail to stop thermal control!\n");
@@ -1549,9 +1551,9 @@ static int smu_suspend(void *handle)
adev->pm.dpm_enabled = false;
- smu_i2c_eeprom_fini(smu, &adev->pm.smu_i2c);
+ if (!amdgpu_sriov_vf(adev)) {
+ smu_i2c_eeprom_fini(smu, &adev->pm.smu_i2c);
- if(!amdgpu_sriov_vf(adev)) {
ret = smu_disable_dpm(smu);
if (ret)
return ret;
@@ -1596,9 +1598,11 @@ static int smu_resume(void *handle)
if (ret)
goto failed;
- ret = smu_i2c_eeprom_init(smu, &adev->pm.smu_i2c);
- if (ret)
- goto failed;
+ if (!amdgpu_sriov_vf(adev)) {
+ ret = smu_i2c_eeprom_init(smu, &adev->pm.smu_i2c);
+ if (ret)
+ goto failed;
+ }
if (smu->is_apu)
smu_set_gfx_cgpg(&adev->smu, true);
--
2.25.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next reply other threads:[~2020-05-22 5:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-22 5:31 Hua Zhang [this message]
2020-05-22 5:39 ` [PATCH] drm/amd/powerplay: skip i2c eeprom init/fini under sriov mode Wang, Kevin(Yang)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200522053102.17307-1-hua.zhang@amd.com \
--to=hua.zhang@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).