Commit 49abb266 authored by Alex Deucher's avatar Alex Deucher

drm/radeon: don't try to recreate sysfs entries on resume

Fixes a harmless error message caused by:
51a4726bSigned-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
parent 5c92d87d
......@@ -1658,6 +1658,7 @@ struct radeon_pm {
u8 fan_max_rpm;
/* dpm */
bool dpm_enabled;
bool sysfs_initialized;
struct radeon_dpm dpm;
};
......
......@@ -1528,6 +1528,7 @@ int radeon_pm_late_init(struct radeon_device *rdev)
if (rdev->pm.pm_method == PM_METHOD_DPM) {
if (rdev->pm.dpm_enabled) {
if (!rdev->pm.sysfs_initialized) {
ret = device_create_file(rdev->dev, &dev_attr_power_dpm_state);
if (ret)
DRM_ERROR("failed to create device file for dpm state\n");
......@@ -1541,6 +1542,9 @@ int radeon_pm_late_init(struct radeon_device *rdev)
ret = device_create_file(rdev->dev, &dev_attr_power_method);
if (ret)
DRM_ERROR("failed to create device file for power method\n");
if (!ret)
rdev->pm.sysfs_initialized = true;
}
mutex_lock(&rdev->pm.mutex);
ret = radeon_dpm_late_enable(rdev);
......@@ -1556,7 +1560,8 @@ int radeon_pm_late_init(struct radeon_device *rdev)
}
}
} else {
if (rdev->pm.num_power_states > 1) {
if ((rdev->pm.num_power_states > 1) &&
(!rdev->pm.sysfs_initialized)) {
/* where's the best place to put these? */
ret = device_create_file(rdev->dev, &dev_attr_power_profile);
if (ret)
......@@ -1564,6 +1569,8 @@ int radeon_pm_late_init(struct radeon_device *rdev)
ret = device_create_file(rdev->dev, &dev_attr_power_method);
if (ret)
DRM_ERROR("failed to create device file for power method\n");
if (!ret)
rdev->pm.sysfs_initialized = true;
}
}
return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment