Skip to contentSkip to conversation

drm/radeon: remove init of CIK VMIDs 8-16 for amdkfd

PATCH Applied Oded Gabbay 4 participants 4 messages Nov 29, 2017 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/radeon: remove init of CIK VMIDs 8-16 for amdkfd

VMIDs 8-16 in Kaveri were reserved for use by the amdkfd driver. Because we removed amdkfd support from radeon, those VMIDs are now used by radeon and are initialized by radeon.

This patch removes the function that initialized those VMIDs for amdkfd use.
This initialization overridden the radeon initialization and caused GPU faults and GUI crashed.

This bug was found by Michel Dänzer.

---
 drivers/gpu/drm/radeon/cik.c | 24 ------------------------
 1 file changed, 24 deletions(-)
drivers/gpu/drm/radeon/cik.c +0 -24
index 898f9a0..a651191 100644
@@ -5451,28 +5451,6 @@ void cik_pcie_gart_tlb_flush(struct radeon_device *rdev)
 	WREG32(VM_INVALIDATE_REQUEST, 0x1);
 }
 
-static void cik_pcie_init_compute_vmid(struct radeon_device *rdev)
-{
-	int i;
-	uint32_t sh_mem_bases, sh_mem_config;
-
-	sh_mem_bases = 0x6000 | 0x6000 << 16;
-	sh_mem_config = ALIGNMENT_MODE(SH_MEM_ALIGNMENT_MODE_UNALIGNED);
-	sh_mem_config |= DEFAULT_MTYPE(MTYPE_NONCACHED);
-
-	mutex_lock(&rdev->srbm_mutex);
-	for (i = 8; i < 16; i++) {
-		cik_srbm_select(rdev, 0, 0, 0, i);
-		/* CP and shaders */
-		WREG32(SH_MEM_CONFIG, sh_mem_config);
-		WREG32(SH_MEM_APE1_BASE, 1);
-		WREG32(SH_MEM_APE1_LIMIT, 0);
-		WREG32(SH_MEM_BASES, sh_mem_bases);
-	}
-	cik_srbm_select(rdev, 0, 0, 0, 0);
-	mutex_unlock(&rdev->srbm_mutex);
-}
-
 /**
  * cik_pcie_gart_enable - gart enable
  *
@@ -5586,8 +5564,6 @@ static int cik_pcie_gart_enable(struct radeon_device *rdev)
 	cik_srbm_select(rdev, 0, 0, 0, 0);
 	mutex_unlock(&rdev->srbm_mutex);
 
-	cik_pcie_init_compute_vmid(rdev);
-
 	cik_pcie_gart_tlb_flush(rdev);
 	DRM_INFO("PCIE GART of %uM enabled (table at 0x%016llX).\n",
 		 (unsigned)(rdev->mc.gtt_size >> 20),
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#2 lore raw
In reply to a message not in the archive

Am 29.11.2017 um 16:23 schrieb Oded Gabbay:

Quoted 4 lines

VMIDs 8-16 in Kaveri were reserved for use by the amdkfd driver. Because we removed amdkfd support from radeon, those VMIDs are now used by radeon and are initialized by radeon.

Quoted 8 lines

This patch removes the function that initialized those VMIDs for amdkfd use.
This initialization overridden the radeon initialization and caused GPU faults and GUI crashed.

This bug was found by Michel Dänzer.

Quoted 38 lines
---
  drivers/gpu/drm/radeon/cik.c | 24 ------------------------
  1 file changed, 24 deletions(-)
drivers/gpu/drm/radeon/cik.c +0 -22
index 898f9a0..a651191 100644
@@ -5451,28 +5451,6 @@ void cik_pcie_gart_tlb_flush(struct radeon_device *rdev)
  	WREG32(VM_INVALIDATE_REQUEST, 0x1);
  }
 
-static void cik_pcie_init_compute_vmid(struct radeon_device *rdev)
-{
-	int i;
-	uint32_t sh_mem_bases, sh_mem_config;
-
-	sh_mem_bases = 0x6000 | 0x6000 << 16;
-	sh_mem_config = ALIGNMENT_MODE(SH_MEM_ALIGNMENT_MODE_UNALIGNED);
-	sh_mem_config |= DEFAULT_MTYPE(MTYPE_NONCACHED);
-
-	mutex_lock(&rdev->srbm_mutex);
-	for (i = 8; i < 16; i++) {
-		cik_srbm_select(rdev, 0, 0, 0, i);
-		/* CP and shaders */
-		WREG32(SH_MEM_CONFIG, sh_mem_config);
-		WREG32(SH_MEM_APE1_BASE, 1);
-		WREG32(SH_MEM_APE1_LIMIT, 0);
-		WREG32(SH_MEM_BASES, sh_mem_bases);
-	}
-	cik_srbm_select(rdev, 0, 0, 0, 0);
-	mutex_unlock(&rdev->srbm_mutex);
-}
-
  /**
   * cik_pcie_gart_enable - gart enable
   *

drivers/gpu/drm/radeon/cik.c static int cik_pcie_gart_enable(struct radeon_device *rdev) · line 5569

Quoted 8 lines
drivers/gpu/drm/radeon/cik.c +0 -2
@@ -5586,8 +5564,6 @@ static int cik_pcie_gart_enable(struct radeon_device *rdev)
  	cik_srbm_select(rdev, 0, 0, 0, 0);
  	mutex_unlock(&rdev->srbm_mutex);
 
-	cik_pcie_init_compute_vmid(rdev);
-
  	cik_pcie_gart_tlb_flush(rdev);
  	DRM_INFO("PCIE GART of %uM enabled (table at 0x%016llX).\n",
  		 (unsigned)(rdev->mc.gtt_size >> 20),

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#3 lore raw
In reply to a message not in the archive
Quoted 4 lines · Oded Gabbay

VMIDs 8-16 in Kaveri were reserved for use by the amdkfd driver. Because we removed amdkfd support from radeon, those VMIDs are now used by radeon and are initialized by radeon.

Quoted 8 lines

This patch removes the function that initialized those VMIDs for amdkfd use.
This initialization overridden the radeon initialization and caused GPU faults and GUI crashed.

This bug was found by Michel Dänzer.

Pushed to our internal amd-staging-drm-next branch, with some modifications to the tags in the commit log, thanks!

Alex, this needs to go into 4.15.

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#5 lore raw
In reply to a message not in the archive

I'll add it to my -fixes branch.

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Michel Dänzer <[email protected]>
Sent: Wednesday, November 29, 2017 11:57:26 AM
To: Oded Gabbay
Cc: Deucher, Alexander; [email protected]; amd-gfx-PD4FTy7X32lNgt0PjOBp9/[email protected]
Subject: Re: [PATCH] drm/radeon: remove init of CIK VMIDs 8-16 for amdkfd

Quoted 4 lines · Oded Gabbay

VMIDs 8-16 in Kaveri were reserved for use by the amdkfd driver. Because we removed amdkfd support from radeon, those VMIDs are now used by radeon and are initialized by radeon.

Quoted 8 lines

This patch removes the function that initialized those VMIDs for amdkfd use.
This initialization overridden the radeon initialization and caused GPU faults and GUI crashed.

This bug was found by Michel Dänzer.

Pushed to our internal amd-staging-drm-next branch, with some modifications to the tags in the commit log, thanks!

Alex, this needs to go into 4.15.

--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx