diff options
author | cperciva <cperciva@FreeBSD.org> | 2010-12-30 01:28:56 +0000 |
---|---|---|
committer | cperciva <cperciva@FreeBSD.org> | 2010-12-30 01:28:56 +0000 |
commit | d34b4913e63be3c0b206a84bd66770349126026e (patch) | |
tree | af53349aea829dc588b013ab57a3abc4404f704b | |
parent | 28ac9ef7428c98a4ea1492f2275367f44192e470 (diff) | |
download | FreeBSD-src-d34b4913e63be3c0b206a84bd66770349126026e.zip FreeBSD-src-d34b4913e63be3c0b206a84bd66770349126026e.tar.gz |
Add xenpic_dynirq_disable_intr and set it as the .pic_disable_intr method
for xenpic_dynirq_template. This fixes a panic when a virtual disk is
removed, since that results in an interrupt channel being disabled and
NULL isn't very good function for disabling interrupts.
We should probably have a xenpic_pirq_disable_intr as well; I'm not adding
that here because (a) I'm not sure what uses pirqs so I don't have a test
case, and (b) the xenpic_pirq_enable_intr code is significantly more
complex than the xenpic_dynirq_enable_intr code, so I'm not sure what
should go into a xenpic_pirq_disable_intr routine.
PR: kern/153511
MFC after: 3 days
-rw-r--r-- | sys/xen/evtchn/evtchn.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/xen/evtchn/evtchn.c b/sys/xen/evtchn/evtchn.c index 3ad2e2c..b4053eb 100644 --- a/sys/xen/evtchn/evtchn.c +++ b/sys/xen/evtchn/evtchn.c @@ -628,6 +628,7 @@ static void xenpic_dynirq_enable_source(struct intsrc *isrc); static void xenpic_dynirq_disable_source(struct intsrc *isrc, int); static void xenpic_dynirq_eoi_source(struct intsrc *isrc); static void xenpic_dynirq_enable_intr(struct intsrc *isrc); +static void xenpic_dynirq_disable_intr(struct intsrc *isrc); static void xenpic_pirq_enable_source(struct intsrc *isrc); static void xenpic_pirq_disable_source(struct intsrc *isrc, int); @@ -647,6 +648,7 @@ struct pic xenpic_dynirq_template = { .pic_disable_source = xenpic_dynirq_disable_source, .pic_eoi_source = xenpic_dynirq_eoi_source, .pic_enable_intr = xenpic_dynirq_enable_intr, + .pic_disable_intr = xenpic_dynirq_disable_intr, .pic_vector = xenpic_vector, .pic_source_pending = xenpic_source_pending, .pic_suspend = xenpic_suspend, @@ -716,6 +718,20 @@ xenpic_dynirq_enable_intr(struct intsrc *isrc) } static void +xenpic_dynirq_disable_intr(struct intsrc *isrc) +{ + unsigned int irq; + struct xenpic_intsrc *xp; + + xp = (struct xenpic_intsrc *)isrc; + mtx_lock_spin(&irq_mapping_update_lock); + irq = xenpic_vector(isrc); + mask_evtchn(evtchn_from_irq(irq)); + xp->xp_masked = 1; + mtx_unlock_spin(&irq_mapping_update_lock); +} + +static void xenpic_dynirq_eoi_source(struct intsrc *isrc) { unsigned int irq; |