On 7/26/22 8:43 AM, Jonathan Gray wrote:
On Mon, Jul 25, 2022 at 09:34:14PM +0100, Chris Narkiewicz wrote:
On Mon, Jul 25, 2022 at 03:48:19PM -0400, Nick Holland wrote:
> Sigh.  collect info, leave out most basic part: what I mean
> by "X quit working"...

I checked your Xorg.0.log and it looks familiar. Please look for post
"X11 hangs on StarLabs Mk IV - snapshot 06-06-2022" in the bugs@
archive and recent discussion in t...@openbsd.org:
"Xorg hanging on StarLabs Lite IV - infinite sleep in ioctl 
drm_syncobj_array_wait_timeout"

this reminds me of Xorg being stuck on schto when running the intel xorg
driver on recent hardware

here is a diff which fixes some llist iterators, which makes the intel
xorg driver work on broadwell

does this also help these machines?

It doesn't seem to. Is there any more info I can give you to help?

Nick.


Index: sys/dev/pci/drm/include/linux/irq_work.h
===================================================================
RCS file: /cvs/src/sys/dev/pci/drm/include/linux/irq_work.h,v
retrieving revision 1.8
diff -u -p -r1.8 irq_work.h
--- sys/dev/pci/drm/include/linux/irq_work.h    19 Jan 2022 05:36:54 -0000      
1.8
+++ sys/dev/pci/drm/include/linux/irq_work.h    26 Jul 2022 12:24:19 -0000
@@ -22,13 +22,20 @@
  #include <sys/systm.h>
  #include <sys/task.h>
+#include <linux/llist.h>
+
  struct workqueue_struct;
extern struct workqueue_struct *system_wq; +struct irq_node {
+       struct llist_node llist;
+};
+
  struct irq_work {
        struct task task;
        struct taskq *tq;
+       struct irq_node node;
  };
typedef void (*irq_work_func_t)(struct irq_work *);
Index: sys/dev/pci/drm/include/linux/llist.h
===================================================================
RCS file: /cvs/src/sys/dev/pci/drm/include/linux/llist.h,v
retrieving revision 1.2
diff -u -p -r1.2 llist.h
--- sys/dev/pci/drm/include/linux/llist.h       8 Jun 2020 04:48:14 -0000       
1.2
+++ sys/dev/pci/drm/include/linux/llist.h       26 Jul 2022 12:19:00 -0000
@@ -13,8 +13,7 @@ struct llist_head {
        struct llist_node *first;
  };
-#define llist_entry(ptr, type, member) \
-       ((ptr) ? container_of(ptr, type, member) : NULL)
+#define llist_entry(ptr, type, member) container_of(ptr, type, member)
static inline struct llist_node *
  llist_del_all(struct llist_head *head)
@@ -82,13 +81,13 @@ llist_empty(struct llist_head *head)
#define llist_for_each_entry_safe(pos, n, node, member) \
        for (pos = llist_entry((node), __typeof(*pos), member);         \
-           pos != NULL &&                                              \
+           ((char *)(pos) + offsetof(typeof(*(pos)), member)) != NULL && \
            (n = llist_entry(pos->member.next, __typeof(*pos), member), pos); \
            pos = n)
#define llist_for_each_entry(pos, node, member) \
        for ((pos) = llist_entry((node), __typeof(*(pos)), member);     \
-           (pos) != NULL;                                              \
+           ((char *)(pos) + offsetof(typeof(*(pos)), member)) != NULL; \
            (pos) = llist_entry((pos)->member.next, __typeof(*(pos)), member))
#endif
Index: sys/dev/pci/drm/i915/i915_request.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/drm/i915/i915_request.c,v
retrieving revision 1.10
diff -u -p -r1.10 i915_request.c
--- sys/dev/pci/drm/i915/i915_request.c 30 Jan 2022 23:18:20 -0000      1.10
+++ sys/dev/pci/drm/i915/i915_request.c 26 Jul 2022 12:21:38 -0000
@@ -165,7 +165,7 @@ static void irq_execute_cb(struct irq_wo
        struct execute_cb *cb = container_of(wrk, typeof(*cb), work);
i915_sw_fence_complete(cb->fence);
-#ifdef notyet
+#ifdef __linux__
        kmem_cache_free(slab_execute_cbs, cb);
  #else
        pool_put(&slab_execute_cbs, cb);
@@ -180,13 +180,10 @@ __notify_execute_cb(struct i915_request
        if (llist_empty(&rq->execute_cb))
                return;
- STUB();
-#ifdef notyet
        llist_for_each_entry_safe(cb, cn,
                                  llist_del_all(&rq->execute_cb),
                                  work.node.llist)
                fn(&cb->work);
-#endif
  }
static void __notify_execute_cb_irq(struct i915_request *rq)
@@ -196,10 +193,11 @@ static void __notify_execute_cb_irq(stru
static bool irq_work_imm(struct irq_work *wrk)
  {
-#ifdef notyet
+#ifdef __linux__
        wrk->func(wrk);
  #else
        STUB();
+       //irq_work_sync(wrk);
  #endif
        return false;
  }
@@ -506,11 +504,6 @@ __await_execution(struct i915_request *r
        if (i915_request_is_active(signal))
                return 0;
- STUB();
-       i915_sw_fence_await(&rq->submit);
-       return -ENOSYS;
-#ifdef notyet
-
  #ifdef __linux__
        cb = kmem_cache_alloc(slab_execute_cbs, gfp);
  #else
@@ -544,7 +537,6 @@ __await_execution(struct i915_request *r
        }
return 0;
-#endif
  }
static bool fatal_error(int error)


Reply via email to