提交 0f2287ad 编写于 作者: J Jeremy Fitzhardinge 提交者: Thomas Gleixner

xen: fix unbind_from_irq()

Rearrange the tests in unbind_from_irq() so that we can still unbind
an irq even if the underlying event channel is bad.  This allows a
device driver to shuffle its irqs on save/restore before the
underlying event channels have been fixed up.
Signed-off-by: NJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
上级 eb1e305f
......@@ -355,7 +355,7 @@ static void unbind_from_irq(unsigned int irq)
spin_lock(&irq_mapping_update_lock);
if (VALID_EVTCHN(evtchn) && (--irq_bindcount[irq] == 0)) {
if ((--irq_bindcount[irq] == 0) && VALID_EVTCHN(evtchn)) {
close.port = evtchn;
if (HYPERVISOR_event_channel_op(EVTCHNOP_close, &close) != 0)
BUG();
......@@ -375,7 +375,7 @@ static void unbind_from_irq(unsigned int irq)
evtchn_to_irq[evtchn] = -1;
irq_info[irq] = IRQ_UNBOUND;
dynamic_irq_init(irq);
dynamic_irq_cleanup(irq);
}
spin_unlock(&irq_mapping_update_lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册