NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

re: kern/57537: radeon drm hangs with multiple glxgears active



i realised that i've been near this problem before, i've got
a patch that printf()s instead of panic()s here, and it's
firing in dmesg:

ww_mutex_lock_wait_sig:408: nopanic: ww mutex class mismatch: 0xffffffff8109e4c0 != 0xffffffff804b89d6

see patch below.  i'll work on getting more info (stack trace
at the very least).


.mrg.


Index: sys/external/bsd/drm2/linux/linux_ww_mutex.c
===================================================================
RCS file: /cvsroot/src/sys/external/bsd/drm2/linux/linux_ww_mutex.c,v
retrieving revision 1.14
diff -p -u -r1.14 linux_ww_mutex.c
--- sys/external/bsd/drm2/linux/linux_ww_mutex.c	18 Mar 2022 23:33:41 -0000	1.14
+++ sys/external/bsd/drm2/linux/linux_ww_mutex.c	22 Jul 2023 06:57:19 -0000
@@ -398,9 +398,16 @@ ww_mutex_lock_wait_sig(struct ww_mutex *
 	KASSERT((mutex->wwm_state == WW_CTX) ||
 	    (mutex->wwm_state == WW_WANTOWN));
 	KASSERT(mutex->wwm_u.ctx != ctx);
+#if 0
 	KASSERTMSG((ctx->wwx_class == mutex->wwm_u.ctx->wwx_class),
 	    "ww mutex class mismatch: %p != %p",
 	    ctx->wwx_class, mutex->wwm_u.ctx->wwx_class);
+#else
+	if (ctx->wwx_class != mutex->wwm_u.ctx->wwx_class)
+		printf("%s:%d: nopanic: ww mutex class mismatch: %p != %p\n",
+		    __func__, __LINE__,
+		    ctx->wwx_class, mutex->wwm_u.ctx->wwx_class);
+#endif
 	KASSERTMSG((mutex->wwm_u.ctx->wwx_ticket != ctx->wwx_ticket),
 	    "ticket number reused: %"PRId64" (%p) %"PRId64" (%p)",
 	    ctx->wwx_ticket, ctx,
@@ -751,9 +758,16 @@ retry:	switch (mutex->wwm_state) {
 		 * Owned by a higher-priority party.  Tell the caller
 		 * to unlock everything and start over.
 		 */
+#if 0
 		KASSERTMSG((ctx->wwx_class == mutex->wwm_u.ctx->wwx_class),
 		    "ww mutex class mismatch: %p != %p",
 		    ctx->wwx_class, mutex->wwm_u.ctx->wwx_class);
+#else
+		if (!(ctx->wwx_class == mutex->wwm_u.ctx->wwx_class))
+			printf("%s:%d: nopanic: ww mutex class mismatch: %p != %p\n",
+			    __func__, __LINE__,
+			    ctx->wwx_class, mutex->wwm_u.ctx->wwx_class);
+#endif
 		ret = -EDEADLK;
 		goto out_unlock;
 	}


Home | Main Index | Thread Index | Old Index