]> git.hungrycats.org Git - linux/commitdiff
drm/amdgpu: don't try to recreate sysfs entries on resume
authorAlex Deucher <alexander.deucher@amd.com>
Fri, 23 Oct 2015 14:45:14 +0000 (10:45 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 Nov 2015 22:37:34 +0000 (14:37 -0800)
commit c86f5ebfbd147d1a228ab89ee1658e18939bd7ad upstream.

Fixes an error on resume caused by:
fa022a9b65d2886486a022fd66b20c823cd76ad9

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c

index f7b49d5ce4b81d471fa3c84280560b9d0e774c78..e3305a5aedfd1cafe2a8e22cbc8c17b64680b77d 100644 (file)
@@ -1583,6 +1583,7 @@ struct amdgpu_pm {
        u8                      fan_max_rpm;
        /* dpm */
        bool                    dpm_enabled;
+       bool                    sysfs_initialized;
        struct amdgpu_dpm       dpm;
        const struct firmware   *fw;    /* SMC firmware */
        uint32_t                fw_version;
index ed13baa7c976632de924671854a3c2eef7ef883e..91c7556a365afae464a4c6982e42ded0b7f320a6 100644 (file)
@@ -693,6 +693,9 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device *adev)
 {
        int ret;
 
+       if (adev->pm.sysfs_initialized)
+               return 0;
+
        if (adev->pm.funcs->get_temperature == NULL)
                return 0;
        adev->pm.int_hwmon_dev = hwmon_device_register_with_groups(adev->dev,
@@ -721,6 +724,8 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device *adev)
                return ret;
        }
 
+       adev->pm.sysfs_initialized = true;
+
        return 0;
 }