<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 style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Acked-by: Alex Deucher <alexander.deucher@amd.com><br>
</div>
<div id="appendonsend"></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 Evan Quan <evan.quan@amd.com><br>
<b>Sent:</b> Thursday, November 14, 2019 2:33 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Quan, Evan <Evan.Quan@amd.com><br>
<b>Subject:</b> [PATCH] drm/amd/powerplay: issue no PPSMC_MSG_GetCurrPkgPwr on unsupported ASICs</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Otherwise, the error message prompted will confuse user.<br>
<br>
Change-Id: I44b9f870a8663714d715a1d5bf2aa24abe75bb8e<br>
Signed-off-by: Evan Quan <evan.quan@amd.com><br>
---<br>
.../gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 23 +++++++++++++++----<br>
1 file changed, 18 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c<br>
index d3c3b3512a16..5c6b71b356e7 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c<br>
@@ -3476,18 +3476,31 @@ static int smu7_get_pp_table_entry(struct pp_hwmgr *hwmgr,<br>
<br>
static int smu7_get_gpu_power(struct pp_hwmgr *hwmgr, u32 *query)<br>
{<br>
+ struct amdgpu_device *adev = hwmgr->adev;<br>
int i;<br>
u32 tmp = 0;<br>
<br>
if (!query)<br>
return -EINVAL;<br>
<br>
- smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_GetCurrPkgPwr, 0);<br>
- tmp = cgs_read_register(hwmgr->device, mmSMC_MSG_ARG_0);<br>
- *query = tmp;<br>
+ /*<br>
+ * PPSMC_MSG_GetCurrPkgPwr is not supported on:<br>
+ * - Hawaii<br>
+ * - Bonaire<br>
+ * - Fiji<br>
+ * - Tonga<br>
+ */<br>
+ if ((adev->asic_type != CHIP_HAWAII) &&<br>
+ (adev->asic_type != CHIP_BONAIRE) &&<br>
+ (adev->asic_type != CHIP_FIJI) &&<br>
+ (adev->asic_type != CHIP_TONGA)) {<br>
+ smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_GetCurrPkgPwr, 0);<br>
+ tmp = cgs_read_register(hwmgr->device, mmSMC_MSG_ARG_0);<br>
+ *query = tmp;<br>
<br>
- if (tmp != 0)<br>
- return 0;<br>
+ if (tmp != 0)<br>
+ return 0;<br>
+ }<br>
<br>
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_PmStatusLogStart);<br>
cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC,<br>
-- <br>
2.24.0<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></div>
</span></font></div>
</body>
</html>