<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:10pt;color:#0078D7;margin:15pt;" align="Left">
[AMD Official Use Only - Internal Distribution Only]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
please add a detailed description of the reason for this patch,<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
after finshed, the patch is</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Reviewed-by: Kevin Wang <kevin1.wang@amd.com></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Best Regards,<br>
Kevin</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Hua Zhang <hua.zhang@amd.com><br>
<b>Sent:</b> Friday, May 22, 2020 1:31 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Zhang, Hua <Hua.Zhang@amd.com><br>
<b>Subject:</b> [PATCH] drm/amd/powerplay: skip i2c eeprom init/fini under sriov mode</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">i2c eeprom init/fini is only needed under bare mental mode.<br>
<br>
Signed-off-by: Hua Zhang <hua.zhang@amd.com><br>
---<br>
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 24 +++++++++++++---------<br>
1 file changed, 14 insertions(+), 10 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c<br>
index 8017386d3c33..a78a1f542ea9 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c<br>
@@ -1363,9 +1363,11 @@ static int smu_hw_init(void *handle)<br>
if (ret)<br>
goto failed;<br>
<br>
- ret = smu_i2c_eeprom_init(smu, &adev->pm.smu_i2c);<br>
- if (ret)<br>
- goto failed;<br>
+ if (!amdgpu_sriov_vf(adev)) {<br>
+ ret = smu_i2c_eeprom_init(smu, &adev->pm.smu_i2c);<br>
+ if (ret)<br>
+ goto failed;<br>
+ }<br>
<br>
adev->pm.dpm_enabled = true;<br>
<br>
@@ -1406,9 +1408,9 @@ static int smu_hw_fini(void *handle)<br>
<br>
adev->pm.dpm_enabled = false;<br>
<br>
- smu_i2c_eeprom_fini(smu, &adev->pm.smu_i2c);<br>
-<br>
if (!amdgpu_sriov_vf(adev)){<br>
+ smu_i2c_eeprom_fini(smu, &adev->pm.smu_i2c);<br>
+<br>
ret = smu_stop_thermal_control(smu);<br>
if (ret) {<br>
pr_warn("Fail to stop thermal control!\n");<br>
@@ -1549,9 +1551,9 @@ static int smu_suspend(void *handle)<br>
<br>
adev->pm.dpm_enabled = false;<br>
<br>
- smu_i2c_eeprom_fini(smu, &adev->pm.smu_i2c);<br>
+ if (!amdgpu_sriov_vf(adev)) {<br>
+ smu_i2c_eeprom_fini(smu, &adev->pm.smu_i2c);<br>
<br>
- if(!amdgpu_sriov_vf(adev)) {<br>
ret = smu_disable_dpm(smu);<br>
if (ret)<br>
return ret;<br>
@@ -1596,9 +1598,11 @@ static int smu_resume(void *handle)<br>
if (ret)<br>
goto failed;<br>
<br>
- ret = smu_i2c_eeprom_init(smu, &adev->pm.smu_i2c);<br>
- if (ret)<br>
- goto failed;<br>
+ if (!amdgpu_sriov_vf(adev)) {<br>
+ ret = smu_i2c_eeprom_init(smu, &adev->pm.smu_i2c);<br>
+ if (ret)<br>
+ goto failed;<br>
+ }<br>
<br>
if (smu->is_apu)<br>
smu_set_gfx_cgpg(&adev->smu, true);<br>
-- <br>
2.25.1<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7CKevin1.Wang%40amd.com%7Cc8e0d6a298474263093c08d7fe115797%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637257222795940615&sdata=LR7lQJ3I2XorNFokkz%2FRe6JK6H3TT3hlprc6EWHNPpI%3D&reserved=0">https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7CKevin1.Wang%40amd.com%7Cc8e0d6a298474263093c08d7fe115797%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637257222795940615&sdata=LR7lQJ3I2XorNFokkz%2FRe6JK6H3TT3hlprc6EWHNPpI%3D&reserved=0</a><br>
</div>
</span></font></div>
</div>
</body>
</html>