summaryrefslogtreecommitdiff
path: root/sys/dev/pv
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2020-02-13 15:39:03 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2020-02-13 15:39:03 +0000
commitbcd0d64d25d8dfda5e99eacc9d4eb0ed3ac754f2 (patch)
treed27a7b6cb4a6085131a5ef3885d7e3b0d913c28c /sys/dev/pv
parent7b60674d0db5f49b38d2c4271b21bbf832656506 (diff)
Resolve a few issues with interrupt handling
Upon a failed task_add, the adjusted reference counter needs to be decremented. xen_intr_schedule should follow the same logic as xen_intr. Tested by Niklas Hallqvist. Ok mpi@
Diffstat (limited to 'sys/dev/pv')
-rw-r--r--sys/dev/pv/xen.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/pv/xen.c b/sys/dev/pv/xen.c
index 1257b2a9a9e..16fcee3d48b 100644
--- a/sys/dev/pv/xen.c
+++ b/sys/dev/pv/xen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xen.c,v 1.94 2019/12/13 02:16:53 mikeb Exp $ */
+/* $OpenBSD: xen.c,v 1.95 2020/02/13 15:39:02 mikeb Exp $ */
/*
* Copyright (c) 2015, 2016, 2017 Mike Belopuhov
@@ -704,7 +704,8 @@ xen_intr(void)
}
xi->xi_evcnt.ec_count++;
xen_intr_mask_acquired(sc, xi);
- task_add(xi->xi_taskq, &xi->xi_task);
+ if (!task_add(xi->xi_taskq, &xi->xi_task))
+ xen_intsrc_release(sc, xi);
}
}
}
@@ -716,6 +717,7 @@ xen_intr_schedule(xen_intr_handle_t xih)
struct xen_intsrc *xi;
if ((xi = xen_intsrc_acquire(sc, (evtchn_port_t)xih)) != NULL) {
+ xen_intr_mask_acquired(sc, xi);
if (!task_add(xi->xi_taskq, &xi->xi_task))
xen_intsrc_release(sc, xi);
}