AMD-GFX Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] drm/amd/powerplay: skip i2c eeprom init/fini under sriov mode
@ 2020-05-22  5:31 Hua Zhang
  2020-05-22  5:39 ` Wang, Kevin(Yang)
  0 siblings, 1 reply; 2+ messages in thread
From: Hua Zhang @ 2020-05-22  5:31 UTC (permalink / raw)
  To: amd-gfx; +Cc: Hua Zhang

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/amd/powerplay: skip i2c eeprom init/fini under sriov mode
  2020-05-22  5:31 [PATCH] drm/amd/powerplay: skip i2c eeprom init/fini under sriov mode Hua Zhang
@ 2020-05-22  5:39 ` Wang, Kevin(Yang)
  0 siblings, 0 replies; 2+ messages in thread
From: Wang, Kevin(Yang) @ 2020-05-22  5:39 UTC (permalink / raw)
  To: Zhang, Hua, amd-gfx

[-- Attachment #1.1: Type: text/plain, Size: 3270 bytes --]

[AMD Official Use Only - Internal Distribution Only]

please add a detailed description of the reason for this patch,
after finshed, the patch is

Reviewed-by: Kevin Wang <kevin1.wang@amd.com>

Best Regards,
Kevin
________________________________
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Hua Zhang <hua.zhang@amd.com>
Sent: Friday, May 22, 2020 1:31 PM
To: amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>
Cc: Zhang, Hua <Hua.Zhang@amd.com>
Subject: [PATCH] drm/amd/powerplay: skip i2c eeprom init/fini under sriov mode

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://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7CKevin1.Wang%40amd.com%7Cc8e0d6a298474263093c08d7fe115797%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637257222795940615&amp;sdata=LR7lQJ3I2XorNFokkz%2FRe6JK6H3TT3hlprc6EWHNPpI%3D&amp;reserved=0

[-- Attachment #1.2: Type: text/html, Size: 7849 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-22  5:31 [PATCH] drm/amd/powerplay: skip i2c eeprom init/fini under sriov mode Hua Zhang
2020-05-22  5:39 ` Wang, Kevin(Yang)

AMD-GFX Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/amd-gfx/0 amd-gfx/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 amd-gfx amd-gfx/ https://lore.kernel.org/amd-gfx \
		amd-gfx@lists.freedesktop.org
	public-inbox-index amd-gfx

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.freedesktop.lists.amd-gfx


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git