Merge tag 'drm-misc-next-2020-10-27' of git://anongit.freedesktop.org/drm/drm-misc...
[sfrench/cifs-2.6.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_gmc.c
index 0e35023b5703f051d8b8e63a6f4fff1fd54550d2..cc86f431a3d4023c0106bfb6b818e5606fe1cd5a 100644 (file)
@@ -409,6 +409,44 @@ void amdgpu_gmc_tmz_set(struct amdgpu_device *adev)
        }
 }
 
+/**
+ * amdgpu_noretry_set -- set per asic noretry defaults
+ * @adev: amdgpu_device pointer
+ *
+ * Set a per asic default for the no-retry parameter.
+ *
+ */
+void amdgpu_gmc_noretry_set(struct amdgpu_device *adev)
+{
+       struct amdgpu_gmc *gmc = &adev->gmc;
+
+       switch (adev->asic_type) {
+       case CHIP_RAVEN:
+               /* Raven currently has issues with noretry
+                * regardless of what we decide for other
+                * asics, we should leave raven with
+                * noretry = 0 until we root cause the
+                * issues.
+                */
+               if (amdgpu_noretry == -1)
+                       gmc->noretry = 0;
+               else
+                       gmc->noretry = amdgpu_noretry;
+               break;
+       default:
+               /* default this to 0 for now, but we may want
+                * to change this in the future for certain
+                * GPUs as it can increase performance in
+                * certain cases.
+                */
+               if (amdgpu_noretry == -1)
+                       gmc->noretry = 0;
+               else
+                       gmc->noretry = amdgpu_noretry;
+               break;
+       }
+}
+
 void amdgpu_gmc_set_vm_fault_masks(struct amdgpu_device *adev, int hub_type,
                                   bool enable)
 {