From 84c523292244494691deda47d15c21f33fb47cf0 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 13 May 2024 13:35:26 +0200 Subject: [PATCH] 6.1-stable patches added patches: reapply-drm-qxl-simplify-qxl_fence_wait.patch --- ...pply-drm-qxl-simplify-qxl_fence_wait.patch | 126 ++++++++++++++++++ queue-6.1/series | 1 + 2 files changed, 127 insertions(+) create mode 100644 queue-6.1/reapply-drm-qxl-simplify-qxl_fence_wait.patch diff --git a/queue-6.1/reapply-drm-qxl-simplify-qxl_fence_wait.patch b/queue-6.1/reapply-drm-qxl-simplify-qxl_fence_wait.patch new file mode 100644 index 00000000000..d7c8ab12f3f --- /dev/null +++ b/queue-6.1/reapply-drm-qxl-simplify-qxl_fence_wait.patch @@ -0,0 +1,126 @@ +From 3628e0383dd349f02f882e612ab6184e4bb3dc10 Mon Sep 17 00:00:00 2001 +From: Linus Torvalds +Date: Mon, 6 May 2024 13:28:59 -0700 +Subject: Reapply "drm/qxl: simplify qxl_fence_wait" + +From: Linus Torvalds + +commit 3628e0383dd349f02f882e612ab6184e4bb3dc10 upstream. + +This reverts commit 07ed11afb68d94eadd4ffc082b97c2331307c5ea. + +Stephen Rostedt reports: + "I went to run my tests on my VMs and the tests hung on boot up. + Unfortunately, the most I ever got out was: + + [ 93.607888] Testing event system initcall: OK + [ 93.667730] Running tests on all trace events: + [ 93.669757] Testing all events: OK + [ 95.631064] ------------[ cut here ]------------ + Timed out after 60 seconds" + +and further debugging points to a possible circular locking dependency +between the console_owner locking and the worker pool locking. + +Reverting the commit allows Steve's VM to boot to completion again. + +[ This may obviously result in the "[TTM] Buffer eviction failed" + messages again, which was the reason for that original revert. But at + this point this seems preferable to a non-booting system... ] + +Reported-and-bisected-by: Steven Rostedt +Link: https://lore.kernel.org/all/20240502081641.457aa25f@gandalf.local.home/ +Acked-by: Maxime Ripard +Cc: Alex Constantino +Cc: Maxime Ripard +Cc: Timo Lindfors +Cc: Dave Airlie +Cc: Gerd Hoffmann +Cc: Maarten Lankhorst +Cc: Thomas Zimmermann +Cc: Daniel Vetter +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/qxl/qxl_release.c | 50 +++----------------------------------- + include/linux/dma-fence.h | 7 ----- + 2 files changed, 5 insertions(+), 52 deletions(-) + +--- a/drivers/gpu/drm/qxl/qxl_release.c ++++ b/drivers/gpu/drm/qxl/qxl_release.c +@@ -58,56 +58,16 @@ static long qxl_fence_wait(struct dma_fe + signed long timeout) + { + struct qxl_device *qdev; +- struct qxl_release *release; +- int count = 0, sc = 0; +- bool have_drawable_releases; + unsigned long cur, end = jiffies + timeout; + + qdev = container_of(fence->lock, struct qxl_device, release_lock); +- release = container_of(fence, struct qxl_release, base); +- have_drawable_releases = release->type == QXL_RELEASE_DRAWABLE; + +-retry: +- sc++; +- +- if (dma_fence_is_signaled(fence)) +- goto signaled; +- +- qxl_io_notify_oom(qdev); +- +- for (count = 0; count < 11; count++) { +- if (!qxl_queue_garbage_collect(qdev, true)) +- break; +- +- if (dma_fence_is_signaled(fence)) +- goto signaled; +- } +- +- if (dma_fence_is_signaled(fence)) +- goto signaled; +- +- if (have_drawable_releases || sc < 4) { +- if (sc > 2) +- /* back off */ +- usleep_range(500, 1000); +- +- if (time_after(jiffies, end)) +- return 0; +- +- if (have_drawable_releases && sc > 300) { +- DMA_FENCE_WARN(fence, +- "failed to wait on release %llu after spincount %d\n", +- fence->context & ~0xf0000000, sc); +- goto signaled; +- } +- goto retry; +- } +- /* +- * yeah, original sync_obj_wait gave up after 3 spins when +- * have_drawable_releases is not set. +- */ ++ if (!wait_event_timeout(qdev->release_event, ++ (dma_fence_is_signaled(fence) || ++ (qxl_io_notify_oom(qdev), 0)), ++ timeout)) ++ return 0; + +-signaled: + cur = jiffies; + if (time_after(cur, end)) + return 0; +--- a/include/linux/dma-fence.h ++++ b/include/linux/dma-fence.h +@@ -659,11 +659,4 @@ static inline bool dma_fence_is_containe + return dma_fence_is_array(fence) || dma_fence_is_chain(fence); + } + +-#define DMA_FENCE_WARN(f, fmt, args...) \ +- do { \ +- struct dma_fence *__ff = (f); \ +- pr_warn("f %llu#%llu: " fmt, __ff->context, __ff->seqno,\ +- ##args); \ +- } while (0) +- + #endif /* __LINUX_DMA_FENCE_H */ diff --git a/queue-6.1/series b/queue-6.1/series index 23bc0afb763..c708577eeb2 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -184,3 +184,4 @@ maintainers-add-leah-to-6.1-maintainers-file.patch drm-amdgpu-once-more-fix-the-call-oder-in-amdgpu_ttm_move-v2.patch btrfs-fix-kvcalloc-arguments-order-in-btrfs_ioctl_send.patch firewire-nosy-ensure-user_length-is-taken-into-account-when-fetching-packet-contents.patch +reapply-drm-qxl-simplify-qxl_fence_wait.patch -- 2.47.2