drm/amdgpu: fix init save/restore list in gfx_v8.0
authorRex Zhu <Rex.Zhu@amd.com>
Wed, 7 Dec 2016 09:44:20 +0000 (17:44 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 15 Dec 2016 20:16:23 +0000 (15:16 -0500)
set valid data to mmRLC_SRM_INDEX_CNTL_ADDRx/DATAx.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c

index 2dbe6a1d897392b6e219d53fbfd6a84d1f5e3494..2e65ccbb91be23828dcd6b753c5f068ec613ca1a 100644 (file)
@@ -3949,8 +3949,12 @@ static int gfx_v8_0_init_save_restore_list(struct amdgpu_device *adev)
        temp = mmRLC_SRM_INDEX_CNTL_ADDR_0;
        data = mmRLC_SRM_INDEX_CNTL_DATA_0;
        for (i = 0; i < sizeof(unique_indices) / sizeof(int); i++) {
-               amdgpu_mm_wreg(adev, temp + i, unique_indices[i] & 0x3FFFF, false);
-               amdgpu_mm_wreg(adev, data + i, unique_indices[i] >> 20, false);
+               if (unique_indices[i] != 0) {
+                       amdgpu_mm_wreg(adev, temp + i,
+                                       unique_indices[i] & 0x3FFFF, false);
+                       amdgpu_mm_wreg(adev, data + i,
+                                       unique_indices[i] >> 20, false);
+               }
        }
        kfree(register_list_format);