]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.0-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 31 Oct 2022 06:29:24 +0000 (07:29 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 31 Oct 2022 06:29:24 +0000 (07:29 +0100)
added patches:
drm-amdgpu-fix-for-bo-move-issue.patch
drm-amdgpu-fix-vram-bo-swap-issue.patch

queue-6.0/drm-amdgpu-fix-for-bo-move-issue.patch [new file with mode: 0644]
queue-6.0/drm-amdgpu-fix-vram-bo-swap-issue.patch [new file with mode: 0644]
queue-6.0/series

diff --git a/queue-6.0/drm-amdgpu-fix-for-bo-move-issue.patch b/queue-6.0/drm-amdgpu-fix-for-bo-move-issue.patch
new file mode 100644 (file)
index 0000000..0d97b9b
--- /dev/null
@@ -0,0 +1,42 @@
+From 8273b4048664fff356fd10059033f0e2f5a422a1 Mon Sep 17 00:00:00 2001
+From: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
+Date: Tue, 18 Oct 2022 07:08:38 -0700
+Subject: drm/amdgpu: Fix for BO move issue
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
+
+commit 8273b4048664fff356fd10059033f0e2f5a422a1 upstream.
+
+A user reported a bug on CAPE VERDE system where uvd_v3_1
+IP component failed to initialize as there is an issue with
+BO move code from one memory to other.
+
+In function amdgpu_mem_visible() called by amdgpu_bo_move(),
+when there are no blocks to compare or if we have a single
+block then break the loop.
+
+Fixes: 312b4dc11d4f ("drm/amdgpu: Fix VRAM BO swap issue")
+Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
+Reviewed-by: Christian König <christian.koenig@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Cc: "Limonciello, Mario" <Mario.Limonciello@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+@@ -439,6 +439,9 @@ static bool amdgpu_mem_visible(struct am
+       while (cursor.remaining) {
+               amdgpu_res_next(&cursor, cursor.size);
++              if (!cursor.remaining)
++                      break;
++
+               /* ttm_resource_ioremap only supports contiguous memory */
+               if (end != cursor.start)
+                       return false;
diff --git a/queue-6.0/drm-amdgpu-fix-vram-bo-swap-issue.patch b/queue-6.0/drm-amdgpu-fix-vram-bo-swap-issue.patch
new file mode 100644 (file)
index 0000000..37072c3
--- /dev/null
@@ -0,0 +1,69 @@
+From 312b4dc11d4f74bfe03ea25ffe04c1f2fdd13cb9 Mon Sep 17 00:00:00 2001
+From: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
+Date: Tue, 4 Oct 2022 07:33:39 -0700
+Subject: drm/amdgpu: Fix VRAM BO swap issue
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
+
+commit 312b4dc11d4f74bfe03ea25ffe04c1f2fdd13cb9 upstream.
+
+DRM buddy manager allocates the contiguous memory requests in
+a single block or multiple blocks. So for the ttm move operation
+(incase of low vram memory) we should consider all the blocks to
+compute the total memory size which compared with the struct
+ttm_resource num_pages in order to verify that the blocks are
+contiguous for the eviction process.
+
+v2: Added a Fixes tag
+v3: Rewrite the code to save a bit of calculations and
+    variables (Christian)
+
+Fixes: c9cad937c0c5 ("drm/amdgpu: add drm buddy support to amdgpu")
+Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
+Reviewed-by: Christian König <christian.koenig@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Cc: "Limonciello, Mario" <Mario.Limonciello@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c |   17 ++++++++++++-----
+ 1 file changed, 12 insertions(+), 5 deletions(-)
+
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+@@ -424,8 +424,9 @@ error:
+ static bool amdgpu_mem_visible(struct amdgpu_device *adev,
+                              struct ttm_resource *mem)
+ {
+-      uint64_t mem_size = (u64)mem->num_pages << PAGE_SHIFT;
++      u64 mem_size = (u64)mem->num_pages << PAGE_SHIFT;
+       struct amdgpu_res_cursor cursor;
++      u64 end;
+       if (mem->mem_type == TTM_PL_SYSTEM ||
+           mem->mem_type == TTM_PL_TT)
+@@ -434,12 +435,18 @@ static bool amdgpu_mem_visible(struct am
+               return false;
+       amdgpu_res_first(mem, 0, mem_size, &cursor);
++      end = cursor.start + cursor.size;
++      while (cursor.remaining) {
++              amdgpu_res_next(&cursor, cursor.size);
+-      /* ttm_resource_ioremap only supports contiguous memory */
+-      if (cursor.size != mem_size)
+-              return false;
++              /* ttm_resource_ioremap only supports contiguous memory */
++              if (end != cursor.start)
++                      return false;
++
++              end = cursor.start + cursor.size;
++      }
+-      return cursor.start + cursor.size <= adev->gmc.visible_vram_size;
++      return end <= adev->gmc.visible_vram_size;
+ }
+ /*
index 383f4f76c9dcd21bb3ea994a18c0416b8533c381..57f6db5190682d3b69fcbf87aabd0968d441f206 100644 (file)
@@ -55,3 +55,5 @@ fs-binfmt_elf-fix-memory-leak-in-load_elf_binary.patch
 exec-copy-oldsighand-action-under-spin-lock.patch
 mac802154-fix-lqi-recording.patch
 scsi-qla2xxx-use-transport-defined-speed-mask-for-supported_speeds.patch
+drm-amdgpu-fix-vram-bo-swap-issue.patch
+drm-amdgpu-fix-for-bo-move-issue.patch