<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">
<p style="font-family:Arial;font-size:10pt;color:#0000FF;margin:5pt;" align="Left">
[AMD Official Use Only]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
We can probably just make these dev_dbg().  The vast majority of cards are non-RAS.  No need to print this at all in most cases.</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);">
Alex</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<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> Tuikov, Luben <Luben.Tuikov@amd.com><br>
<b>Sent:</b> Thursday, February 3, 2022 5:14 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Tuikov, Luben <Luben.Tuikov@amd.com>; Deucher, Alexander <Alexander.Deucher@amd.com>; Zhang, Hawking <Hawking.Zhang@amd.com>; Clements, John <John.Clements@amd.com>; Zhou1, Tao <Tao.Zhou1@amd.com>; Chai, Thomas <YiPeng.Chai@amd.com><br>
<b>Subject:</b> [PATCH] drm/amdgpu: Print once if RAS unsupported</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">MESA polls for errors every 2-3 seconds. Printing with dev_info() causes<br>
the dmesg log to fill up with the same message, e.g,<br>
<br>
[18028.206676] amdgpu 0000:0b:00.0: amdgpu: df doesn't config ras function.<br>
<br>
Make it dev_info_once(), as it isn't something correctible during boot, so<br>
printing just once is sufficient. Also sanitize the message.<br>
<br>
Cc: Alex Deucher <Alexander.Deucher@amd.com><br>
Cc: Hawking Zhang <Hawking.Zhang@amd.com><br>
Cc: John Clements <john.clements@amd.com><br>
Cc: Tao Zhou <tao.zhou1@amd.com><br>
Cc: yipechai <YiPeng.Chai@amd.com><br>
Fixes: e93ea3d0cf434b ("drm/amdgpu: Modify gfx block to fit for the unified ras block data and ops")<br>
Signed-off-by: Luben Tuikov <luben.tuikov@amd.com><br>
---<br>
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 16 ++++++++--------<br>
 1 file changed, 8 insertions(+), 8 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c<br>
index 9d7c778c1a2d8e..cddbfbb1d6447a 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c<br>
@@ -952,8 +952,8 @@ int amdgpu_ras_query_error_status(struct amdgpu_device *adev,<br>
         } else {<br>
                 block_obj = amdgpu_ras_get_ras_block(adev, info->head.block, 0);<br>
                 if (!block_obj || !block_obj->hw_ops)   {<br>
-                       dev_info(adev->dev, "%s doesn't config ras function.\n",<br>
-                                       get_ras_block_str(&info->head));<br>
+                       dev_info_once(adev->dev, "%s doesn't config RAS function\n",<br>
+                                     get_ras_block_str(&info->head));<br>
                         return -EINVAL;<br>
                 }<br>
 <br>
@@ -1028,8 +1028,8 @@ int amdgpu_ras_reset_error_status(struct amdgpu_device *adev,<br>
                 return -EINVAL;<br>
 <br>
         if (!block_obj || !block_obj->hw_ops)   {<br>
-               dev_info(adev->dev, "%s doesn't config ras function.\n",<br>
-                               ras_block_str(block));<br>
+               dev_info_once(adev->dev, "%s doesn't config RAS function\n",<br>
+                             ras_block_str(block));<br>
                 return -EINVAL;<br>
         }<br>
 <br>
@@ -1066,8 +1066,8 @@ int amdgpu_ras_error_inject(struct amdgpu_device *adev,<br>
                 return -EINVAL;<br>
 <br>
         if (!block_obj || !block_obj->hw_ops)   {<br>
-               dev_info(adev->dev, "%s doesn't config ras function.\n",<br>
-                                       get_ras_block_str(&info->head));<br>
+               dev_info_once(adev->dev, "%s doesn't config RAS function\n",<br>
+                             get_ras_block_str(&info->head));<br>
                 return -EINVAL;<br>
         }<br>
 <br>
@@ -1717,8 +1717,8 @@ static void amdgpu_ras_error_status_query(struct amdgpu_device *adev,<br>
                                         info->head.sub_block_index);<br>
 <br>
         if (!block_obj || !block_obj->hw_ops) {<br>
-               dev_info(adev->dev, "%s doesn't config ras function.\n",<br>
-                       get_ras_block_str(&info->head));<br>
+               dev_info_once(adev->dev, "%s doesn't config RAS function\n",<br>
+                             get_ras_block_str(&info->head));<br>
                 return;<br>
         }<br>
 <br>
<br>
base-commit: cf33ae90884f254d683436fc2538b99dc4932447<br>
-- <br>
2.35.0.3.gb23dac905b<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>