aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.19.8/0641-drm-amdgpu-fix-the-VM-fault-while-write-at-the-top-o.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.19.8/0641-drm-amdgpu-fix-the-VM-fault-while-write-at-the-top-o.patch')
-rw-r--r--common/recipes-kernel/linux/linux-yocto-4.19.8/0641-drm-amdgpu-fix-the-VM-fault-while-write-at-the-top-o.patch95
1 files changed, 95 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.19.8/0641-drm-amdgpu-fix-the-VM-fault-while-write-at-the-top-o.patch b/common/recipes-kernel/linux/linux-yocto-4.19.8/0641-drm-amdgpu-fix-the-VM-fault-while-write-at-the-top-o.patch
new file mode 100644
index 00000000..380d1fa2
--- /dev/null
+++ b/common/recipes-kernel/linux/linux-yocto-4.19.8/0641-drm-amdgpu-fix-the-VM-fault-while-write-at-the-top-o.patch
@@ -0,0 +1,95 @@
+From ec9c8933b3c01936b6e4e4dbfcd72847d58df14b Mon Sep 17 00:00:00 2001
+From: Huang Rui <ray.huang@amd.com>
+Date: Tue, 16 Jan 2018 10:42:58 +0800
+Subject: [PATCH 0641/2940] drm/amdgpu: fix the VM fault while write at the top
+ of the invisible vram
+
+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>
+Signed-off-by: Chaudhary Amit Kumar <Chaudharyamit.Kumar@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c | 25 ++++++++++++------------
+ drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c | 25 ++++++++++++------------
+ 2 files changed, 24 insertions(+), 26 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c b/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c
+index ceb7847b504f..a4b76a4297f1 100644
+--- a/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c
++++ b/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c
+@@ -74,19 +74,18 @@ static void gfxhub_v1_0_init_system_aperture_regs(struct amdgpu_device *adev)
+ WREG32_SOC15(GC, 0, mmMC_VM_SYSTEM_APERTURE_LOW_ADDR,
+ min(adev->gmc.vram_start, adev->gmc.agp_start) >> 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 >> 18) + 0x1,
+- adev->gmc.agp_end >> 18));
+- else
+- 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 14649f8475f3..017f1a638373 100644
+--- a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
++++ b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
+@@ -92,19 +92,18 @@ static void mmhub_v1_0_init_system_aperture_regs(struct amdgpu_device *adev)
+ WREG32_SOC15(MMHUB, 0, mmMC_VM_SYSTEM_APERTURE_LOW_ADDR,
+ min(adev->gmc.vram_start, adev->gmc.agp_start) >> 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 >> 18) + 0x1,
+- adev->gmc.agp_end >> 18));
+- else
+- 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.17.1
+