<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:#317100;margin:15pt;" align="Left">
[AMD Public Use]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
No need to apologize, it was a good catch.  Something to double check in the future if something similar ends up getting applied again.</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);">
Thanks!</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<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 Matt Coffin <mcoffin13@gmail.com><br>
<b>Sent:</b> Friday, August 14, 2020 3:13 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Quan, Evan <Evan.Quan@amd.com>; Koenig, Christian <Christian.Koenig@amd.com>; Li, Dennis <Dennis.Li@amd.com><br>
<b>Subject:</b> Re: [PATCH] drm/amdgpu: Fix incorrect return value in sysfs for pp_od_clk_voltage</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Hi all,<br>
<br>
As of 026acaeac2d205f22c0f682cc1c7b1a85b9ccd00 ("drm/amdgpu: revert "fix<br>
system hang issue during GPU reset""), this patch is no longer needed,<br>
and won't apply, because the badly-behaving code was removed; I'll<br>
withdraw this patch for now.<br>
<br>
Sorry to those who wasted their time reviewing.<br>
<br>
Cheers,<br>
Matt<br>
<br>
On 8/13/20 7:15 PM, Matt Coffin wrote:<br>
> The changes in edad8312cbbf9a33c86873fc4093664f150dd5c1 introduced an<br>
> issue with the sysfs interface for pp_od_clk_voltage. It overwrites the<br>
> return value to 0 when it calls another function, then returns 0. The<br>
> intended behavior is that a positive return value indicates the number<br>
> of bytes from the buffer that you processed in that call.<br>
> <br>
> With the 0 return value, clients would submit the same value to be<br>
> written over and over again, resulting in an infinite loop.<br>
> <br>
> This is resolved by returning the count of bytes read (in this case the<br>
> whole message), when the desired return is 0 (success).<br>
> <br>
> Fixes: edad8312cbbf ("drm/amdgpu: fix system hang issue during GPU")<br>
> Bug: <a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fdrm%2Famd%2F-%2Fissues%2F1245&amp;data=02%7C01%7Calexander.deucher%40amd.com%7C3fb1fd9f95ad441a88a208d840862e80%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637330292979204288&amp;sdata=iABLxfzQVQa5zBK6a0JozvRYl%2Fg5eTFnfOS86r0g9rU%3D&amp;reserved=0">
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fdrm%2Famd%2F-%2Fissues%2F1245&amp;data=02%7C01%7Calexander.deucher%40amd.com%7C3fb1fd9f95ad441a88a208d840862e80%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637330292979204288&amp;sdata=iABLxfzQVQa5zBK6a0JozvRYl%2Fg5eTFnfOS86r0g9rU%3D&amp;reserved=0</a><br>
> Signed-off-by: Matt Coffin <mcoffin13@gmail.com><br>
> ---<br>
>  drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 6 +++++-<br>
>  1 file changed, 5 insertions(+), 1 deletion(-)<br>
> <br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c<br>
> index 1705e328c6fc..f00c7ed361d4 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c<br>
> @@ -937,7 +937,11 @@ static ssize_t amdgpu_set_pp_od_clk_voltage(struct device *dev,<br>
>  <br>
>  pro_end:<br>
>        up_read(&adev->reset_sem);<br>
> -     return ret;<br>
> +     if (ret) {<br>
> +             return ret;<br>
> +     } else {<br>
> +             return count;<br>
> +     }<br>
>  }<br>
>  <br>
>  static ssize_t amdgpu_get_pp_od_clk_voltage(struct device *dev,<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&amp;data=02%7C01%7Calexander.deucher%40amd.com%7C3fb1fd9f95ad441a88a208d840862e80%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637330292979204288&amp;sdata=GLWlbhgo0grFjcOh5ZAJWhXGxSm6Ufw8eDFDHZf95Uk%3D&amp;reserved=0">https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Calexander.deucher%40amd.com%7C3fb1fd9f95ad441a88a208d840862e80%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637330292979204288&amp;sdata=GLWlbhgo0grFjcOh5ZAJWhXGxSm6Ufw8eDFDHZf95Uk%3D&amp;reserved=0</a><br>
</div>
</span></font></div>
</div>
</body>
</html>