aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
diff options
context:
space:
mode:
authorAndrey Grodzovsky <andrey.grodzovsky@amd.com>2019-03-06 16:16:28 -0500
committerAlex Deucher <alexander.deucher@amd.com>2019-03-19 16:36:49 -0400
commit533aed278afeaa68bb5d0600856ab02268cfa3b8 (patch)
tree14cf517762ab1438b506386e07b5c5d6cb22fa6b /drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
parentc6ade4ee7375c0bb47ba25be53918eaa842ae263 (diff)
drm/amdgpu: Move IB pool init and fini v2
Problem: Using SDMA for TLB invalidation in certain ASICs exposed a problem of IB pool not being ready while SDMA already up on Init and already shutt down while SDMA still running on Fini. This caused IB allocation failure. Temproary fix was commited into a bringup branch but this is the generic fix. Fix: Init IB pool rigth after GMC is ready but before SDMA is ready. Do th opposite for Fini. v2: Remove restriction on SDMA early init and move amdgpu_ib_pool_fini Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_device.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_device.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 1de5b2a9921b..fa4c457914f6 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1681,6 +1681,13 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
1681 } 1681 }
1682 } 1682 }
1683 1683
1684 r = amdgpu_ib_pool_init(adev);
1685 if (r) {
1686 dev_err(adev->dev, "IB initialization failed (%d).\n", r);
1687 amdgpu_vf_error_put(adev, AMDGIM_ERROR_VF_IB_INIT_FAIL, 0, r);
1688 goto init_failed;
1689 }
1690
1684 r = amdgpu_ucode_create_bo(adev); /* create ucode bo when sw_init complete*/ 1691 r = amdgpu_ucode_create_bo(adev); /* create ucode bo when sw_init complete*/
1685 if (r) 1692 if (r)
1686 goto init_failed; 1693 goto init_failed;
@@ -1917,6 +1924,7 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev)
1917 amdgpu_free_static_csa(&adev->virt.csa_obj); 1924 amdgpu_free_static_csa(&adev->virt.csa_obj);
1918 amdgpu_device_wb_fini(adev); 1925 amdgpu_device_wb_fini(adev);
1919 amdgpu_device_vram_scratch_fini(adev); 1926 amdgpu_device_vram_scratch_fini(adev);
1927 amdgpu_ib_pool_fini(adev);
1920 } 1928 }
1921 1929
1922 r = adev->ip_blocks[i].version->funcs->sw_fini((void *)adev); 1930 r = adev->ip_blocks[i].version->funcs->sw_fini((void *)adev);
@@ -2645,13 +2653,6 @@ fence_driver_init:
2645 /* Get a log2 for easy divisions. */ 2653 /* Get a log2 for easy divisions. */
2646 adev->mm_stats.log2_max_MBps = ilog2(max(1u, max_MBps)); 2654 adev->mm_stats.log2_max_MBps = ilog2(max(1u, max_MBps));
2647 2655
2648 r = amdgpu_ib_pool_init(adev);
2649 if (r) {
2650 dev_err(adev->dev, "IB initialization failed (%d).\n", r);
2651 amdgpu_vf_error_put(adev, AMDGIM_ERROR_VF_IB_INIT_FAIL, 0, r);
2652 goto failed;
2653 }
2654
2655 amdgpu_fbdev_init(adev); 2656 amdgpu_fbdev_init(adev);
2656 2657
2657 r = amdgpu_pm_sysfs_init(adev); 2658 r = amdgpu_pm_sysfs_init(adev);
@@ -2729,7 +2730,6 @@ void amdgpu_device_fini(struct amdgpu_device *adev)
2729 else 2730 else
2730 drm_atomic_helper_shutdown(adev->ddev); 2731 drm_atomic_helper_shutdown(adev->ddev);
2731 } 2732 }
2732 amdgpu_ib_pool_fini(adev);
2733 amdgpu_fence_driver_fini(adev); 2733 amdgpu_fence_driver_fini(adev);
2734 amdgpu_pm_sysfs_fini(adev); 2734 amdgpu_pm_sysfs_fini(adev);
2735 amdgpu_fbdev_fini(adev); 2735 amdgpu_fbdev_fini(adev);