diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2022-01-19 05:36:55 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2022-01-19 05:36:55 +0000 |
commit | dbf83eed4eab2249fb21f61066ddb200efb8a1d6 (patch) | |
tree | 5638a80d0af053b10123ea68d09bbe5f0e4f96f8 /sys/dev/pci | |
parent | c1c06a2e6ebb309b6764db20635410475c473053 (diff) |
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
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/drm/include/linux/irq_work.h | 20 |
1 files changed, 12 insertions, 8 deletions
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 <sys/param.h> #include <sys/systm.h> -#include <sys/timeout.h> -#include <machine/cpu.h> /* for CPU_BUSY_CYCLE() */ +#include <sys/task.h> + +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 |