[AMD Public Use]
No need to apologize, it was a good catch. Something to double check in the future if something similar ends up getting applied again.
Thanks!
Alex
From: amd-gfx <amd-gfx-bounces@xxxxxxxxxxxxxxxxxxxxx> on behalf of Matt Coffin <mcoffin13@xxxxxxxxx>
Sent: Friday, August 14, 2020 3:13 PM To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx <amd-gfx@xxxxxxxxxxxxxxxxxxxxx> Cc: Quan, Evan <Evan.Quan@xxxxxxx>; Koenig, Christian <Christian.Koenig@xxxxxxx>; Li, Dennis <Dennis.Li@xxxxxxx> Subject: Re: [PATCH] drm/amdgpu: Fix incorrect return value in sysfs for pp_od_clk_voltage Hi all,
As of 026acaeac2d205f22c0f682cc1c7b1a85b9ccd00 ("drm/amdgpu: revert "fix system hang issue during GPU reset""), this patch is no longer needed, and won't apply, because the badly-behaving code was removed; I'll withdraw this patch for now. Sorry to those who wasted their time reviewing. Cheers, Matt On 8/13/20 7:15 PM, Matt Coffin wrote: > The changes in edad8312cbbf9a33c86873fc4093664f150dd5c1 introduced an > issue with the sysfs interface for pp_od_clk_voltage. It overwrites the > return value to 0 when it calls another function, then returns 0. The > intended behavior is that a positive return value indicates the number > of bytes from the buffer that you processed in that call. > > With the 0 return value, clients would submit the same value to be > written over and over again, resulting in an infinite loop. > > This is resolved by returning the count of bytes read (in this case the > whole message), when the desired return is 0 (success). > > Fixes: edad8312cbbf ("drm/amdgpu: fix system hang issue during GPU") > Bug: https://nam11.safelinks.protection.outlook.com/?url=""> > Signed-off-by: Matt Coffin <mcoffin13@xxxxxxxxx> > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c > index 1705e328c6fc..f00c7ed361d4 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c > @@ -937,7 +937,11 @@ static ssize_t amdgpu_set_pp_od_clk_voltage(struct device *dev, > > pro_end: > up_read(&adev->reset_sem); > - return ret; > + if (ret) { > + return ret; > + } else { > + return count; > + } > } > > static ssize_t amdgpu_get_pp_od_clk_voltage(struct device *dev, > _______________________________________________ amd-gfx mailing list amd-gfx@xxxxxxxxxxxxxxxxxxxxx https://nam11.safelinks.protection.outlook.com/?url=""> |
_______________________________________________ amd-gfx mailing list amd-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/amd-gfx