<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<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);">
Hi Tom,</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);">
<i style="font-family: Calibri, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255)"><u>drm/amdgpu: fix uninit-value in arcturus_log_thermal_throttling_event()</u></i><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<i style="font-family: Calibri, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255)"><u><br>
</u></i></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
the fixed patch has been merged into drm-next branch.</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>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</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 Quan, Evan <Evan.Quan@amd.com><br>
<b>Sent:</b> Thursday, August 13, 2020 10:07 AM<br>
<b>To:</b> StDenis, Tom <Tom.StDenis@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> StDenis, Tom <Tom.StDenis@amd.com><br>
<b>Subject:</b> RE: [PATCH] drm/amd/powerplay: Fix uninitialized warning in arcturus ppt driver</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">[AMD Official Use Only - Internal Distribution Only]<br>
<br>
[AMD Official Use Only - Internal Distribution Only]<br>
<br>
Your change below should be able to suppress the compile warning.<br>
-arcturus_get_smu_metrics_data(smu,<br>
+ret = arcturus_get_smu_metrics_data(smu,<br>
METRICS_THROTTLER_STATUS,<br>
&throttler_status);<br>
<br>
+if (ret) {<br>
+dev_err(adev->dev, "Could not read from arcturus_get_smu_metrics_data()\n");<br>
+return;<br>
+}<br>
+<br>
Setting *value as 0 may be unnecessary. However anyway this patch is reviewed-by: Evan Quan <evan.quan@amd.com><br>
<br>
BR<br>
Evan<br>
-----Original Message-----<br>
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Tom St Denis<br>
Sent: Wednesday, August 12, 2020 8:21 PM<br>
To: amd-gfx@lists.freedesktop.org<br>
Cc: StDenis, Tom <Tom.StDenis@amd.com><br>
Subject: [PATCH] drm/amd/powerplay: Fix uninitialized warning in arcturus ppt driver<br>
<br>
Fixes:<br>
<br>
CC [M] drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_mst_types.o<br>
drivers/gpu/drm/amd/amdgpu/../powerplay/arcturus_ppt.c: In function ‘arcturus_log_thermal_throttling_event’:<br>
drivers/gpu/drm/amd/amdgpu/../powerplay/arcturus_ppt.c:2223:24: warning: ‘throttler_status’ may be used uninitialized in this function [-Wmaybe-uninitialized]<br>
2223 | if (throttler_status & logging_label[throttler_idx].feature_mask) {<br>
<br>
by making arcturus_get_smu_metrics_data() assign a default value (of zero) before any possible return point as well as simply error out of arcturus_log_thermal_throttling_event() if it fails.<br>
<br>
Signed-off-by: Tom St Denis <tom.stdenis@amd.com><br>
---<br>
drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 12 ++++++++++--<br>
1 file changed, 10 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c b/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c<br>
index 8b1025dc54fd..78f7ec95e4f5 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c<br>
@@ -551,6 +551,9 @@ static int arcturus_get_smu_metrics_data(struct smu_context *smu,<br>
<br>
mutex_lock(&smu->metrics_lock);<br>
<br>
+// assign default value<br>
+*value = 0;<br>
+<br>
ret = smu_cmn_get_metrics_table_locked(smu,<br>
NULL,<br>
false);<br>
@@ -2208,15 +2211,20 @@ static const struct throttling_logging_label { }; static void arcturus_log_thermal_throttling_event(struct smu_context *smu) {<br>
-int throttler_idx, throtting_events = 0, buf_idx = 0;<br>
+int throttler_idx, throtting_events = 0, buf_idx = 0, ret;<br>
struct amdgpu_device *adev = smu->adev;<br>
uint32_t throttler_status;<br>
char log_buf[256];<br>
<br>
-arcturus_get_smu_metrics_data(smu,<br>
+ret = arcturus_get_smu_metrics_data(smu,<br>
METRICS_THROTTLER_STATUS,<br>
&throttler_status);<br>
<br>
+if (ret) {<br>
+dev_err(adev->dev, "Could not read from arcturus_get_smu_metrics_data()\n");<br>
+return;<br>
+}<br>
+<br>
memset(log_buf, 0, sizeof(log_buf));<br>
for (throttler_idx = 0; throttler_idx < ARRAY_SIZE(logging_label);<br>
throttler_idx++) {<br>
--<br>
2.26.2<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%7Cf47512097dfc40168e1a08d83f2db359%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637328812813110771&sdata=xedbRrZeOi0PK3EM%2FKBYhfXxdfpOkocXPjQjcQ5ErI0%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%7Cf47512097dfc40168e1a08d83f2db359%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637328812813110771&sdata=xedbRrZeOi0PK3EM%2FKBYhfXxdfpOkocXPjQjcQ5ErI0%3D&reserved=0</a><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%7Cf47512097dfc40168e1a08d83f2db359%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637328812813110771&sdata=xedbRrZeOi0PK3EM%2FKBYhfXxdfpOkocXPjQjcQ5ErI0%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%7Cf47512097dfc40168e1a08d83f2db359%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637328812813110771&sdata=xedbRrZeOi0PK3EM%2FKBYhfXxdfpOkocXPjQjcQ5ErI0%3D&reserved=0</a><br>
</div>
</span></font></div>
</div>
</body>
</html>