public inbox for amd-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>,
	Huang Rui <ray.huang-5C7GfCeVMHo@public.gmane.org>
Subject: [PATCH 10/16] drm/amdgpu: fix the VM fault while write at the top of the invisible vram
Date: Wed, 12 Sep 2018 14:29:27 -0500	[thread overview]
Message-ID: <20180912192933.28712-11-alexander.deucher@amd.com> (raw)
In-Reply-To: <20180912192933.28712-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>

From: Huang Rui <ray.huang@amd.com>

Raven2 has a HW issue that it is unable to use the vram which is out of
MC_VM_SYSTEM_APERTURE_HIGH_ADDR. So here is the workaround that increase system
aperture high address to get rid of the VM fault and hardware hang.

Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c | 15 +++++++++++++--
 drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c  | 15 +++++++++++++--
 2 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c b/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c
index ffd0ec9586d1..65f58ebcf835 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c
@@ -73,8 +73,19 @@ static void gfxhub_v1_0_init_system_aperture_regs(struct amdgpu_device *adev)
 	/* Program the system aperture low logical page number. */
 	WREG32_SOC15(GC, 0, mmMC_VM_SYSTEM_APERTURE_LOW_ADDR,
 		     min(adev->gmc.vram_start, adev->gmc.agp_start) >> 18);
-	WREG32_SOC15(GC, 0, mmMC_VM_SYSTEM_APERTURE_HIGH_ADDR,
-		     max(adev->gmc.vram_end, adev->gmc.agp_end) >> 18);
+
+	if (adev->asic_type == CHIP_RAVEN && adev->rev_id >= 0x8)
+		/*
+		 * Raven2 has a HW issue that it is unable to use the vram which
+		 * is out of MC_VM_SYSTEM_APERTURE_HIGH_ADDR. So here is the
+		 * workaround that increase system aperture high address (add 1)
+		 * to get rid of the VM fault and hardware hang.
+		 */
+		WREG32_SOC15(GC, 0, mmMC_VM_SYSTEM_APERTURE_HIGH_ADDR,
+			     (max(adev->gmc.vram_end, adev->gmc.agp_end) >> 18) + 0x1);
+	else
+		WREG32_SOC15(GC, 0, mmMC_VM_SYSTEM_APERTURE_HIGH_ADDR,
+			     max(adev->gmc.vram_end, adev->gmc.agp_end) >> 18);
 
 	/* Set default page address. */
 	value = adev->vram_scratch.gpu_addr - adev->gmc.vram_start
diff --git a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
index b121eb6a0ad4..2a126c6950c7 100644
--- a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
@@ -91,8 +91,19 @@ static void mmhub_v1_0_init_system_aperture_regs(struct amdgpu_device *adev)
 	/* Program the system aperture low logical page number. */
 	WREG32_SOC15(MMHUB, 0, mmMC_VM_SYSTEM_APERTURE_LOW_ADDR,
 		     min(adev->gmc.vram_start, adev->gmc.agp_start) >> 18);
-	WREG32_SOC15(MMHUB, 0, mmMC_VM_SYSTEM_APERTURE_HIGH_ADDR,
-		     max(adev->gmc.vram_end, adev->gmc.agp_end) >> 18);
+
+	if (adev->asic_type == CHIP_RAVEN && adev->rev_id >= 0x8)
+		/*
+		 * Raven2 has a HW issue that it is unable to use the vram which
+		 * is out of MC_VM_SYSTEM_APERTURE_HIGH_ADDR. So here is the
+		 * workaround that increase system aperture high address (add 1)
+		 * to get rid of the VM fault and hardware hang.
+		 */
+		WREG32_SOC15(MMHUB, 0, mmMC_VM_SYSTEM_APERTURE_HIGH_ADDR,
+			     (max(adev->gmc.vram_end, adev->gmc.agp_end) >> 18) + 0x1);
+	else
+		WREG32_SOC15(MMHUB, 0, mmMC_VM_SYSTEM_APERTURE_HIGH_ADDR,
+			     max(adev->gmc.vram_end, adev->gmc.agp_end) >> 18);
 
 	/* Set default page address. */
 	value = adev->vram_scratch.gpu_addr - adev->gmc.vram_start +
-- 
2.13.6

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

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

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-12 19:29 [PATCH 00/16] Add support for Raven2 Alex Deucher
     [not found] ` <20180912192933.28712-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2018-09-12 19:29   ` [PATCH 01/16] drm/amdgpu: move get_rev_id at first before load gpu_info firmware Alex Deucher
2018-09-12 19:29   ` [PATCH 02/16] drm/amdgpu: set external rev id for raven2 Alex Deucher
2018-09-12 19:29   ` [PATCH 03/16] drm/amdgpu: add raven2 to gpu_info firmware Alex Deucher
2018-09-12 19:29   ` [PATCH 04/16] drm/amdgpu: add raven2 vcn firmware support Alex Deucher
2018-09-12 19:29   ` [PATCH 05/16] drm/amdgpu: add psp support for raven2 Alex Deucher
2018-09-12 19:29   ` [PATCH 06/16] drm/amdgpu/sdma4: specify raven2 firmware Alex Deucher
2018-09-12 19:29   ` [PATCH 07/16] drm/amdgpu/sdma4: Add raven2 golden setting Alex Deucher
2018-09-12 19:29   ` [PATCH 08/16] drm/amdgpu/gfx9: add support for raven2 gfx firmware Alex Deucher
2018-09-12 19:29   ` [PATCH 09/16] drm/amdgpu/gfx9: add raven2 golden setting Alex Deucher
2018-09-12 19:29   ` Alex Deucher [this message]
2018-09-12 19:29   ` [PATCH 11/16] drm/amd/display: Add Raven2 definitions in dc Alex Deucher
     [not found]     ` <20180912192933.28712-12-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2018-09-12 20:10       ` Alex Deucher
     [not found]         ` <CADnq5_PsBONPZyirw5BVGNb=sf5_9njE6=jXBm0d7RjqC8=i+g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-09-12 20:43           ` Harry Wentland
     [not found]             ` <4a0826ff-d3a2-4f6f-2c74-d262e6ec70b3-5C7GfCeVMHo@public.gmane.org>
2018-09-12 20:56               ` Alex Deucher
2018-09-12 19:29   ` [PATCH 12/16] drm/amd/display: Add DC config flag for Raven2 (v2) Alex Deucher
2018-09-12 19:29   ` [PATCH 13/16] drm/amd/powerplay: update smu10_verify_smc_interface() to be raven2 compatible Alex Deucher
2018-09-12 19:29   ` [PATCH 14/16] drm/amd/powerplay: round up the Mhz convertion (v2) Alex Deucher
2018-09-12 19:29   ` [PATCH 15/16] drm/amd/powerplay: disable raven2 force dpm level support (v2) Alex Deucher
2018-09-12 19:29   ` [PATCH 16/16] drm/amdgpu: set CG flags for raven2 (v2) 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=20180912192933.28712-11-alexander.deucher@amd.com \
    --to=alexdeucher-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=alexander.deucher-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=ray.huang-5C7GfCeVMHo@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox