All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/radeon: remove init of CIK VMIDs 8-16 for amdkfd
@ 2017-11-29 15:23 Oded Gabbay
       [not found] ` <1511969038-3094-1-git-send-email-oded.gabbay-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Oded Gabbay @ 2017-11-29 15:23 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, alexander.deucher-5C7GfCeVMHo
  Cc: deathsimple-ANTagKRnAhcb1SvskN2V4Q, michel-otUistvHUpPR7s880joybQ

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.

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
---
 drivers/gpu/drm/radeon/cik.c | 24 ------------------------
 1 file changed, 24 deletions(-)

diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
index 898f9a0..a651191 100644
--- a/drivers/gpu/drm/radeon/cik.c
+++ b/drivers/gpu/drm/radeon/cik.c
@@ -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),
-- 
2.7.4

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/radeon: remove init of CIK VMIDs 8-16 for amdkfd
       [not found] ` <1511969038-3094-1-git-send-email-oded.gabbay-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2017-11-29 15:27   ` Christian König
  2017-11-29 16:57   ` Michel Dänzer
  1 sibling, 0 replies; 4+ messages in thread
From: Christian König @ 2017-11-29 15:27 UTC (permalink / raw)
  To: Oded Gabbay, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	alexander.deucher-5C7GfCeVMHo
  Cc: deathsimple-ANTagKRnAhcb1SvskN2V4Q, michel-otUistvHUpPR7s880joybQ

Am 29.11.2017 um 16:23 schrieb 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.
>
> 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.
>
> Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>

Acked-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/radeon/cik.c | 24 ------------------------
>   1 file changed, 24 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
> index 898f9a0..a651191 100644
> --- a/drivers/gpu/drm/radeon/cik.c
> +++ b/drivers/gpu/drm/radeon/cik.c
> @@ -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),

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/radeon: remove init of CIK VMIDs 8-16 for amdkfd
       [not found] ` <1511969038-3094-1-git-send-email-oded.gabbay-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2017-11-29 15:27   ` Christian König
@ 2017-11-29 16:57   ` Michel Dänzer
       [not found]     ` <71a95f03-0775-f20a-d6df-2725fe212e80-otUistvHUpPR7s880joybQ@public.gmane.org>
  1 sibling, 1 reply; 4+ messages in thread
From: Michel Dänzer @ 2017-11-29 16:57 UTC (permalink / raw)
  To: Oded Gabbay
  Cc: alexander.deucher-5C7GfCeVMHo,
	deathsimple-ANTagKRnAhcb1SvskN2V4Q,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On 2017-11-29 04:23 PM, Oded Gabbay wrote:
> 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.
> 
> Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>

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
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/radeon: remove init of CIK VMIDs 8-16 for amdkfd
       [not found]     ` <71a95f03-0775-f20a-d6df-2725fe212e80-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2017-11-29 16:59       ` Deucher, Alexander
  0 siblings, 0 replies; 4+ messages in thread
From: Deucher, Alexander @ 2017-11-29 16:59 UTC (permalink / raw)
  To: Michel Dänzer, Oded Gabbay
  Cc: deathsimple-ANTagKRnAhcb1SvskN2V4Q,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1: Type: text/plain, Size: 1559 bytes --]

I'll add it to my -fixes branch.

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

On 2017-11-29 04:23 PM, Oded Gabbay wrote:
> 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.
>
> Signed-off-by: Oded Gabbay <oded.gabbay-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

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
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[-- Attachment #1.2: Type: text/html, Size: 2812 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-29 16:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-29 15:23 [PATCH] drm/radeon: remove init of CIK VMIDs 8-16 for amdkfd Oded Gabbay
     [not found] ` <1511969038-3094-1-git-send-email-oded.gabbay-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-11-29 15:27   ` Christian König
2017-11-29 16:57   ` Michel Dänzer
     [not found]     ` <71a95f03-0775-f20a-d6df-2725fe212e80-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-11-29 16:59       ` Deucher, Alexander

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.