drm/amdgpu: disable page reservation when amdgpu_bad_page_threshold = 0
authorGuchun Chen <guchun.chen@amd.com>
Mon, 27 Jul 2020 06:56:27 +0000 (14:56 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 4 Aug 2020 21:27:20 +0000 (17:27 -0400)
When amdgpu_bad_page_threshold = 0, bad page reservation stuffs
are skipped in either UMC ECC irq or page retirement calling of
sync flood isr.

Signed-off-by: Guchun Chen <guchun.chen@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c

index 3949470edbb018585823e38d2f04e97824cfe3ca..89cb0ae9da9d4fd2e4f31521db9f6005f9436c92 100644 (file)
@@ -1676,7 +1676,7 @@ static int amdgpu_ras_load_bad_pages(struct amdgpu_device *adev)
        int ret = 0;
 
        /* no bad page record, skip eeprom access */
-       if (!control->num_recs)
+       if (!control->num_recs || (amdgpu_bad_page_threshold == 0))
                return ret;
 
        bps = kcalloc(control->num_recs, sizeof(*bps), GFP_KERNEL);
@@ -1780,7 +1780,8 @@ int amdgpu_ras_reserve_bad_pages(struct amdgpu_device *adev)
        struct amdgpu_bo *bo = NULL;
        int i, ret = 0;
 
-       if (!con || !con->eh_data)
+       /* Not reserve bad page when amdgpu_bad_page_threshold == 0. */
+       if (!con || !con->eh_data || (amdgpu_bad_page_threshold == 0))
                return 0;
 
        mutex_lock(&con->recovery_lock);
index af1b1ccf613c98589a266e609951ada186af7ddb..262baf0f61ea0a70c2c8e5b7e2913b3de9468f86 100644 (file)
@@ -125,8 +125,9 @@ int amdgpu_umc_process_ras_data_cb(struct amdgpu_device *adev,
                                "detected in UMC block\n",
                                err_data->ue_count);
 
-               if (err_data->err_addr_cnt &&
-                   amdgpu_ras_add_bad_pages(adev, err_data->err_addr,
+               if ((amdgpu_bad_page_threshold != 0) &&
+                       err_data->err_addr_cnt &&
+                       amdgpu_ras_add_bad_pages(adev, err_data->err_addr,
                                                err_data->err_addr_cnt))
                        dev_warn(adev->dev, "Failed to add ras bad page!\n");