From: jsg Date: Wed, 19 Jan 2022 05:36:54 +0000 (+0000) Subject: go back to rev 1.5 of irq_work.h with tasks on system_wq X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=99460583ddada9416a826be9bb28815f6690c1ab;p=openbsd go back to rev 1.5 of irq_work.h with tasks on system_wq this may further help people with recent gen intel machines --- diff --git a/sys/dev/pci/drm/include/linux/irq_work.h b/sys/dev/pci/drm/include/linux/irq_work.h index 5360ad99b87..d0d637a0534 100644 --- a/sys/dev/pci/drm/include/linux/irq_work.h +++ b/sys/dev/pci/drm/include/linux/irq_work.h @@ -1,4 +1,4 @@ -/* $OpenBSD: irq_work.h,v 1.7 2022/01/17 12:42:30 jsg Exp $ */ +/* $OpenBSD: irq_work.h,v 1.8 2022/01/19 05:36:54 jsg Exp $ */ /* * Copyright (c) 2015 Mark Kettenis * @@ -20,11 +20,15 @@ #include #include -#include -#include /* for CPU_BUSY_CYCLE() */ +#include + +struct workqueue_struct; + +extern struct workqueue_struct *system_wq; struct irq_work { - struct timeout to; + struct task task; + struct taskq *tq; }; typedef void (*irq_work_func_t)(struct irq_work *); @@ -32,20 +36,20 @@ typedef void (*irq_work_func_t)(struct irq_work *); static inline void init_irq_work(struct irq_work *work, irq_work_func_t func) { - /* process context as intel gen 9 sleeps in irq work */ - timeout_set_proc(&work->to, (void (*)(void *))func, work); + work->tq = (struct taskq *)system_wq; + task_set(&work->task, (void (*)(void *))func, work); } static inline bool irq_work_queue(struct irq_work *work) { - return timeout_add(&work->to, 1); + return task_add(work->tq, &work->task); } static inline void irq_work_sync(struct irq_work *work) { - timeout_del_barrier(&work->to); + taskq_barrier(work->tq); } #endif