All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [PATCH 4/7] drm/amdgpu: initialize GDS/GWS/OA domains even when they are zero sized
Date: Fri, 14 Sep 2018 21:12:43 +0200	[thread overview]
Message-ID: <20180914191246.1609-4-christian.koenig@amd.com> (raw)
In-Reply-To: <20180914191246.1609-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>

Stops crashing on SI.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 48 +++++++++++++--------------------
 1 file changed, 18 insertions(+), 30 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 3e450159fe1f..710e7751c567 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -1843,34 +1843,25 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
 		 (unsigned)(gtt_size / (1024 * 1024)));
 
 	/* Initialize various on-chip memory pools */
-	/* GDS Memory */
-	if (adev->gds.mem.total_size) {
-		r = ttm_bo_init_mm(&adev->mman.bdev, AMDGPU_PL_GDS,
-				   adev->gds.mem.total_size);
-		if (r) {
-			DRM_ERROR("Failed initializing GDS heap.\n");
-			return r;
-		}
+	r = ttm_bo_init_mm(&adev->mman.bdev, AMDGPU_PL_GDS,
+			   adev->gds.mem.total_size);
+	if (r) {
+		DRM_ERROR("Failed initializing GDS heap.\n");
+		return r;
 	}
 
-	/* GWS */
-	if (adev->gds.gws.total_size) {
-		r = ttm_bo_init_mm(&adev->mman.bdev, AMDGPU_PL_GWS,
-				   adev->gds.gws.total_size);
-		if (r) {
-			DRM_ERROR("Failed initializing gws heap.\n");
-			return r;
-		}
+	r = ttm_bo_init_mm(&adev->mman.bdev, AMDGPU_PL_GWS,
+			   adev->gds.gws.total_size);
+	if (r) {
+		DRM_ERROR("Failed initializing gws heap.\n");
+		return r;
 	}
 
-	/* OA */
-	if (adev->gds.oa.total_size) {
-		r = ttm_bo_init_mm(&adev->mman.bdev, AMDGPU_PL_OA,
-				   adev->gds.oa.total_size);
-		if (r) {
-			DRM_ERROR("Failed initializing oa heap.\n");
-			return r;
-		}
+	r = ttm_bo_init_mm(&adev->mman.bdev, AMDGPU_PL_OA,
+			   adev->gds.oa.total_size);
+	if (r) {
+		DRM_ERROR("Failed initializing oa heap.\n");
+		return r;
 	}
 
 	/* Register debugfs entries for amdgpu_ttm */
@@ -1907,12 +1898,9 @@ void amdgpu_ttm_fini(struct amdgpu_device *adev)
 
 	ttm_bo_clean_mm(&adev->mman.bdev, TTM_PL_VRAM);
 	ttm_bo_clean_mm(&adev->mman.bdev, TTM_PL_TT);
-	if (adev->gds.mem.total_size)
-		ttm_bo_clean_mm(&adev->mman.bdev, AMDGPU_PL_GDS);
-	if (adev->gds.gws.total_size)
-		ttm_bo_clean_mm(&adev->mman.bdev, AMDGPU_PL_GWS);
-	if (adev->gds.oa.total_size)
-		ttm_bo_clean_mm(&adev->mman.bdev, AMDGPU_PL_OA);
+	ttm_bo_clean_mm(&adev->mman.bdev, AMDGPU_PL_GDS);
+	ttm_bo_clean_mm(&adev->mman.bdev, AMDGPU_PL_GWS);
+	ttm_bo_clean_mm(&adev->mman.bdev, AMDGPU_PL_OA);
 	ttm_bo_device_release(&adev->mman.bdev);
 	amdgpu_ttm_global_fini(adev);
 	adev->mman.initialized = false;
-- 
2.14.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2018-09-14 19:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-14 19:12 [PATCH 1/7] drm/amdgpu: add GDS, GWS and OA debugfs files Christian König
     [not found] ` <20180914191246.1609-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-09-14 19:12   ` [PATCH 2/7] drm/amdgpu: fix up GDS/GWS/OA shifting Christian König
     [not found]     ` <20180914191246.1609-2-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-09-14 20:26       ` Alex Deucher
     [not found]         ` <CADnq5_PjhBf1_DB6bgTiafPf=DE_g3AY+FsuZ0pj+4VDNPhRJg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-09-15  7:52           ` Christian König
     [not found]             ` <aac8a166-b879-2694-6938-f7104f1903b9-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-09-17 12:27               ` Christian König
2018-09-17 14:32               ` Deucher, Alexander
2018-09-14 19:12   ` [PATCH 3/7] drm/amdgpu: stop crashing on GDS/GWS/OA eviction Christian König
     [not found]     ` <20180914191246.1609-3-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-09-14 20:07       ` Alex Deucher
2018-09-14 19:12   ` Christian König [this message]
     [not found]     ` <20180914191246.1609-4-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-09-14 20:14       ` [PATCH 4/7] drm/amdgpu: initialize GDS/GWS/OA domains even when they are zero sized Alex Deucher
     [not found]         ` <CADnq5_OEi6MBaHp7qx_0dS9SbxCrXiyKPSx5xKdq-3FwtTBsNg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-09-17 12:25           ` Christian König
2018-09-14 19:12   ` [PATCH 5/7] drm/amdgpu: don't allocate zero sized kernel BOs Christian König
     [not found]     ` <20180914191246.1609-5-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-09-14 20:16       ` Alex Deucher
2018-09-14 19:12   ` [PATCH 6/7] drm/amdgpu: drop size check Christian König
     [not found]     ` <20180914191246.1609-6-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-09-14 20:17       ` Alex Deucher
2018-09-14 19:12   ` [PATCH 7/7] drm/amdgpu: move reserving GDS/GWS/OA into common code Christian König
     [not found]     ` <20180914191246.1609-7-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-09-14 20:18       ` Alex Deucher
2018-09-14 20:07   ` [PATCH 1/7] drm/amdgpu: add GDS, GWS and OA debugfs files Alex Deucher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180914191246.1609-4-christian.koenig@amd.com \
    --to=ckoenig.leichtzumerken-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.