<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Reviewed-by: Alex Deucher <alexander.deucher@amd.com><br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Rex Zhu <Rex.Zhu@amd.com><br>
<b>Sent:</b> Friday, September 28, 2018 5:23:38 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Zhu, Rex<br>
<b>Subject:</b> [PATCH v2] drm/amd/pp: Remove useless code in smu</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">the condition always false and the code<br>
path never be executed. so remove them.<br>
<br>
v2: add comments<br>
<br>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com><br>
---<br>
 drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c        | 1 -<br>
 drivers/gpu/drm/amd/powerplay/inc/hwmgr.h          | 1 -<br>
 drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c | 5 -----<br>
 drivers/gpu/drm/amd/powerplay/smumgr/smu8_smumgr.c | 5 -----<br>
 4 files changed, 12 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c<br>
index 7500a3e..7844256 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c<br>
@@ -89,7 +89,6 @@ int hwmgr_early_init(struct pp_hwmgr *hwmgr)<br>
         hwmgr_init_default_caps(hwmgr);<br>
         hwmgr_set_user_specify_caps(hwmgr);<br>
         hwmgr->fan_ctrl_is_in_default_mode = true;<br>
-       hwmgr->reload_fw = 1;<br>
         hwmgr_init_workload_prority(hwmgr);<br>
 <br>
         switch (hwmgr->chip_family) {<br>
diff --git a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h<br>
index d1183b1..b691fca 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h<br>
+++ b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h<br>
@@ -733,7 +733,6 @@ struct pp_hwmgr {<br>
         void *smu_backend;<br>
         const struct pp_smumgr_func *smumgr_funcs;<br>
         bool is_kicker;<br>
-       bool reload_fw;<br>
 <br>
         enum PP_DAL_POWERLEVEL dal_power_level;<br>
         struct phm_dynamic_state_info dyn_state;<br>
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c<br>
index 186dafc..10eb967 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c<br>
@@ -381,11 +381,6 @@ int smu7_request_smu_load_fw(struct pp_hwmgr *hwmgr)<br>
         uint32_t fw_to_load;<br>
         int r = 0;<br>
 <br>
-       if (!hwmgr->reload_fw) {<br>
-               pr_info("skip reloading...\n");<br>
-               return 0;<br>
-       }<br>
-<br>
         if (smu_data->soft_regs_start)<br>
                 cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC,<br>
                                         smu_data->soft_regs_start + smum_get_offsetof(hwmgr,<br>
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/smu8_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/smu8_smumgr.c<br>
index a74c5be..7a4c425 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/smumgr/smu8_smumgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/smu8_smumgr.c<br>
@@ -659,11 +659,6 @@ static int smu8_request_smu_load_fw(struct pp_hwmgr *hwmgr)<br>
         struct smu8_smumgr *smu8_smu = hwmgr->smu_backend;<br>
         uint32_t smc_address;<br>
 <br>
-       if (!hwmgr->reload_fw) {<br>
-               pr_info("skip reloading...\n");<br>
-               return 0;<br>
-       }<br>
-<br>
         smu8_smu_populate_firmware_entries(hwmgr);<br>
 <br>
         smu8_smu_construct_toc(hwmgr);<br>
-- <br>
1.9.1<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font></div>
</body>
</html>