summaryrefslogtreecommitdiff
path: root/drivers/xen/events/events_base.c
diff options
context:
space:
mode:
authorRoss Lagerwall <ross.lagerwall@citrix.com>2015-07-31 13:30:42 (GMT)
committerDavid Vrabel <david.vrabel@citrix.com>2015-08-04 14:41:59 (GMT)
commitfcdf31a7c162de0c93a2bee51df4688ab0a348f8 (patch)
treea93d841ce0104c8e19e6e37253df8512e0113a6e /drivers/xen/events/events_base.c
parent929423fa83e5b75e94101b280738b9a5a376a0e1 (diff)
downloadlinux-fcdf31a7c162de0c93a2bee51df4688ab0a348f8.tar.xz
xen/events/fifo: Handle linked events when closing a port
An event channel bound to a CPU that was offlined may still be linked on that CPU's queue. If this event channel is closed and reused, subsequent events will be lost because the event channel is never unlinked and thus cannot be linked onto the correct queue. When a channel is closed and the event is still linked into a queue, ensure that it is unlinked before completing. If the CPU to which the event channel bound is online, spin until the event is handled by that CPU. If that CPU is offline, it can't handle the event, so clear the event queue during the close, dropping the events. This fixes the missing interrupts (and subsequent disk stalls etc.) when offlining a CPU. Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com> Cc: <stable@vger.kernel.org> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Diffstat (limited to 'drivers/xen/events/events_base.c')
-rw-r--r--drivers/xen/events/events_base.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
index 96093ae..1495ecc 100644
--- a/drivers/xen/events/events_base.c
+++ b/drivers/xen/events/events_base.c
@@ -452,10 +452,12 @@ static void xen_free_irq(unsigned irq)
irq_free_desc(irq);
}
-static void xen_evtchn_close(unsigned int port)
+static void xen_evtchn_close(unsigned int port, unsigned int cpu)
{
struct evtchn_close close;
+ xen_evtchn_op_close(port, cpu);
+
close.port = port;
if (HYPERVISOR_event_channel_op(EVTCHNOP_close, &close) != 0)
BUG();
@@ -544,7 +546,7 @@ out:
err:
pr_err("irq%d: Failed to set port to irq mapping (%d)\n", irq, rc);
- xen_evtchn_close(evtchn);
+ xen_evtchn_close(evtchn, NR_CPUS);
return 0;
}
@@ -565,7 +567,7 @@ static void shutdown_pirq(struct irq_data *data)
return;
mask_evtchn(evtchn);
- xen_evtchn_close(evtchn);
+ xen_evtchn_close(evtchn, cpu_from_evtchn(evtchn));
xen_irq_info_cleanup(info);
}
@@ -609,7 +611,7 @@ static void __unbind_from_irq(unsigned int irq)
if (VALID_EVTCHN(evtchn)) {
unsigned int cpu = cpu_from_irq(irq);
- xen_evtchn_close(evtchn);
+ xen_evtchn_close(evtchn, cpu);
switch (type_from_irq(irq)) {
case IRQT_VIRQ: