mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
drm/amdgpu/pm: fix SmartShift bias sysfs store PM refcount on parse error
Return the parse error before acquiring PM access. Signed-off-by: Candice Li <candice.li@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
d288e4ba09
commit
a4b0c3f5d2
|
|
@ -1886,12 +1886,12 @@ static ssize_t amdgpu_set_smartshift_bias(struct device *dev,
|
|||
{
|
||||
struct drm_device *ddev = dev_get_drvdata(dev);
|
||||
struct amdgpu_device *adev = drm_to_adev(ddev);
|
||||
int r = 0;
|
||||
int r;
|
||||
int bias = 0;
|
||||
|
||||
r = kstrtoint(buf, 10, &bias);
|
||||
if (r)
|
||||
goto out;
|
||||
return r;
|
||||
|
||||
r = amdgpu_pm_get_access(adev);
|
||||
if (r < 0)
|
||||
|
|
@ -1903,14 +1903,12 @@ static ssize_t amdgpu_set_smartshift_bias(struct device *dev,
|
|||
bias = AMDGPU_SMARTSHIFT_MIN_BIAS;
|
||||
|
||||
amdgpu_smartshift_bias = bias;
|
||||
r = count;
|
||||
|
||||
/* TODO: update bias level with SMU message */
|
||||
|
||||
out:
|
||||
amdgpu_pm_put_access(adev);
|
||||
|
||||
return r;
|
||||
return count;
|
||||
}
|
||||
|
||||
static int ss_power_attr_update(struct amdgpu_device *adev, struct amdgpu_device_attr *attr,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user