aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
diff options
context:
space:
mode:
authorPixel Ding <Pixel.Ding@amd.com>2017-11-07 22:03:14 -0500
committerAlex Deucher <alexander.deucher@amd.com>2017-12-06 12:47:18 -0500
commit1daee8b472e896f477e490ca66e58d1f8f0f4e61 (patch)
tree19d16782e0eab09d312a21e002947724cecbc775 /drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
parentbaef9a196f00b30400443fd56455b8ed9a6a4173 (diff)
drm/amdgpu: revise retry init to fully cleanup driver
Retry at drm_dev_register instead of amdgpu_device_init. Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Pixel Ding <Pixel.Ding@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index 9ed1bee0fd64..f55021ae788d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
@@ -84,7 +84,7 @@ done_free:
84int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags) 84int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags)
85{ 85{
86 struct amdgpu_device *adev; 86 struct amdgpu_device *adev;
87 int r, acpi_status, retry = 0; 87 int r, acpi_status;
88 88
89#ifdef CONFIG_DRM_AMDGPU_SI 89#ifdef CONFIG_DRM_AMDGPU_SI
90 if (!amdgpu_si_support) { 90 if (!amdgpu_si_support) {
@@ -120,7 +120,6 @@ int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags)
120 } 120 }
121 } 121 }
122#endif 122#endif
123retry_init:
124 123
125 adev = kzalloc(sizeof(struct amdgpu_device), GFP_KERNEL); 124 adev = kzalloc(sizeof(struct amdgpu_device), GFP_KERNEL);
126 if (adev == NULL) { 125 if (adev == NULL) {
@@ -143,17 +142,7 @@ retry_init:
143 * VRAM allocation 142 * VRAM allocation
144 */ 143 */
145 r = amdgpu_device_init(adev, dev, dev->pdev, flags); 144 r = amdgpu_device_init(adev, dev, dev->pdev, flags);
146 if (r == -EAGAIN && ++retry <= 3) { 145 if (r) {
147 adev->virt.caps &= ~AMDGPU_SRIOV_CAPS_RUNTIME;
148 adev->virt.ops = NULL;
149 amdgpu_device_fini(adev);
150 kfree(adev);
151 dev->dev_private = NULL;
152 /* Don't request EX mode too frequently which is attacking */
153 msleep(5000);
154 dev_err(&dev->pdev->dev, "retry init %d\n", retry);
155 goto retry_init;
156 } else if (r) {
157 dev_err(&dev->pdev->dev, "Fatal error during GPU init\n"); 146 dev_err(&dev->pdev->dev, "Fatal error during GPU init\n");
158 goto out; 147 goto out;
159 } 148 }