]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Aug 2023 06:53:12 +0000 (08:53 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Aug 2023 06:53:12 +0000 (08:53 +0200)
added patches:
drm-ttm-make-ttm_bo_unpin-more-defensive.patch

queue-5.10/drm-ttm-make-ttm_bo_unpin-more-defensive.patch [new file with mode: 0644]
queue-5.10/series

diff --git a/queue-5.10/drm-ttm-make-ttm_bo_unpin-more-defensive.patch b/queue-5.10/drm-ttm-make-ttm_bo_unpin-more-defensive.patch
new file mode 100644 (file)
index 0000000..fad5405
--- /dev/null
@@ -0,0 +1,38 @@
+From 6c5403173a13a08ff61dbdafa4c0ed4a9dedbfe0 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
+Date: Fri, 12 Mar 2021 09:34:39 +0100
+Subject: drm/ttm: make ttm_bo_unpin more defensive
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Christian König <christian.koenig@amd.com>
+
+commit 6c5403173a13a08ff61dbdafa4c0ed4a9dedbfe0 upstream.
+
+We seem to have some more driver bugs than thought.
+
+Signed-off-by: Christian König <christian.koenig@amd.com>
+Fixes: deb0814b43f3 ("drm/ttm: add ttm_bo_pin()/ttm_bo_unpin() v2")
+Acked-by: Matthew Auld <matthew.auld@intel.com>
+Link: https://patchwork.freedesktop.org/patch/msgid/20210312093810.2202-1-christian.koenig@amd.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ include/drm/ttm/ttm_bo_api.h |    6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/include/drm/ttm/ttm_bo_api.h
++++ b/include/drm/ttm/ttm_bo_api.h
+@@ -628,8 +628,10 @@ static inline void ttm_bo_pin(struct ttm
+ static inline void ttm_bo_unpin(struct ttm_buffer_object *bo)
+ {
+       dma_resv_assert_held(bo->base.resv);
+-      WARN_ON_ONCE(!bo->pin_count);
+-      --bo->pin_count;
++      if (bo->pin_count)
++              --bo->pin_count;
++      else
++              WARN_ON_ONCE(true);
+ }
+ int ttm_mem_evict_first(struct ttm_bo_device *bdev,
index 9a74107e1ce5d9f4a6f7732a3defe6812a51d43d..20f97d6b7482cf20b2f48d2b54bbe99c5d0c61af 100644 (file)
@@ -103,3 +103,4 @@ s390-dasd-fix-hanging-device-after-quiesce-resume.patch
 asoc-wm8904-fill-the-cache-for-wm8904_adc_test_0-register.patch
 ceph-never-send-metrics-if-disable_send_metrics-is-set.patch
 dm-cache-policy-smq-ensure-io-doesn-t-prevent-cleaner-policy-progress.patch
+drm-ttm-make-ttm_bo_unpin-more-defensive.patch