diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2010-11-01 12:30:09 -0400 |
---|---|---|
committer | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2010-11-10 20:19:25 -0500 |
commit | 6903591f314b8947d0e362bda7715e90eb9df75e (patch) | |
tree | cb10990908ffebb46c1703db517a8e91e6e30e33 /drivers/xen | |
parent | a2d771c036eb8c040683089ca04c36dfb93a0e60 (diff) |
xen: events: do not unmask event channels on resume
The IRQ core code will take care of disabling and reenabling
interrupts over suspend resume automatically, therefore we do not need
to do this in the Xen event channel code.
The only exception is those event channels marked IRQF_NO_SUSPEND
which the IRQ core ignores. We must unmask these ourselves, taking
care to obey the current IRQ_DISABLED status. Failure check for
IRQ_DISABLED leads to enabling polled only event channels, such as
that associated with the pv spinlocks, which must never be enabled:
[ 21.970432] ------------[ cut here ]------------
[ 21.970432] kernel BUG at arch/x86/xen/spinlock.c:343!
[ 21.970432] invalid opcode: 0000 [#1] SMP
[ 21.970432] last sysfs file: /sys/devices/virtual/net/lo/operstate
[ 21.970432] Modules linked in:
[ 21.970432]
[ 21.970432] Pid: 0, comm: swapper Not tainted (2.6.32.24-x86_32p-xen-01034-g787c727 #34)
[ 21.970432] EIP: 0061:[<c102e209>] EFLAGS: 00010046 CPU: 3
[ 21.970432] EIP is at dummy_handler+0x3/0x7
[ 21.970432] EAX: 0000021c EBX: dfc16880 ECX: 0000001a EDX: 00000000
[ 21.970432] ESI: dfc02c00 EDI: 00000001 EBP: dfc47e10 ESP: dfc47e10
[ 21.970432] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0069
[ 21.970432] Process swapper (pid: 0, ti=dfc46000 task=dfc39440 task.ti=dfc46000)
[ 21.970432] Stack:
[ 21.970432] dfc47e30 c10a39f0 0000021c 00000000 00000000 dfc16880 0000021c 00000001
[ 21.970432] <0> dfc47e40 c10a4f08 0000021c 00000000 dfc47e78 c12240a7 c1839284 c1839284
[ 21.970432] <0> 00000200 00000000 00000000 f5720000 c1f3d028 c1f3d02c 00000180 dfc47e90
[ 21.970432] Call Trace:
[ 21.970432] [<c10a39f0>] ? handle_IRQ_event+0x5f/0x122
[ 21.970432] [<c10a4f08>] ? handle_percpu_irq+0x2f/0x55
[ 21.970432] [<c12240a7>] ? __xen_evtchn_do_upcall+0xdb/0x15f
[ 21.970432] [<c122481e>] ? xen_evtchn_do_upcall+0x20/0x30
[ 21.970432] [<c1030d47>] ? xen_do_upcall+0x7/0xc
[ 21.970432] [<c102007b>] ? apic_reg_read+0xd3/0x22d
[ 21.970432] [<c1002227>] ? hypercall_page+0x227/0x1005
[ 21.970432] [<c102d30b>] ? xen_force_evtchn_callback+0xf/0x14
[ 21.970432] [<c102da7c>] ? check_events+0x8/0xc
[ 21.970432] [<c102da3b>] ? xen_irq_enable_direct_end+0x0/0x1
[ 21.970432] [<c105e485>] ? finish_task_switch+0x62/0xba
[ 21.970432] [<c14e3f84>] ? schedule+0x808/0x89d
[ 21.970432] [<c1084dc5>] ? hrtimer_start_expires+0x1a/0x22
[ 21.970432] [<c1085154>] ? tick_nohz_restart_sched_tick+0x15a/0x162
[ 21.970432] [<c102f43a>] ? cpu_idle+0x6d/0x6f
[ 21.970432] [<c14db29e>] ? cpu_bringup_and_idle+0xd/0xf
[ 21.970432] Code: 5d 0f 95 c0 0f b6 c0 c3 55 66 83 78 02 00 89 e5 5d 0f 95 \
c0 0f b6 c0 c3 55 b2 01 86 10 31 c0 84 d2 89 e5 0f 94 c0 5d c3 55 89 e5 <0f> 0b \
eb fe 55 80 3d 4c ce 84 c1 00 89 e5 57 56 89 c6 53 74 15
[ 21.970432] EIP: [<c102e209>] dummy_handler+0x3/0x7 SS:ESP 0069:dfc47e10
[ 21.970432] ---[ end trace c0b71f7e12cf3011 ]---
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Diffstat (limited to 'drivers/xen')
-rw-r--r-- | drivers/xen/events.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/drivers/xen/events.c b/drivers/xen/events.c index 97612f548a8e..321a0c8346e5 100644 --- a/drivers/xen/events.c +++ b/drivers/xen/events.c | |||
@@ -1299,9 +1299,6 @@ static void restore_cpu_virqs(unsigned int cpu) | |||
1299 | evtchn_to_irq[evtchn] = irq; | 1299 | evtchn_to_irq[evtchn] = irq; |
1300 | irq_info[irq] = mk_virq_info(evtchn, virq); | 1300 | irq_info[irq] = mk_virq_info(evtchn, virq); |
1301 | bind_evtchn_to_cpu(evtchn, cpu); | 1301 | bind_evtchn_to_cpu(evtchn, cpu); |
1302 | |||
1303 | /* Ready for use. */ | ||
1304 | unmask_evtchn(evtchn); | ||
1305 | } | 1302 | } |
1306 | } | 1303 | } |
1307 | 1304 | ||
@@ -1327,10 +1324,6 @@ static void restore_cpu_ipis(unsigned int cpu) | |||
1327 | evtchn_to_irq[evtchn] = irq; | 1324 | evtchn_to_irq[evtchn] = irq; |
1328 | irq_info[irq] = mk_ipi_info(evtchn, ipi); | 1325 | irq_info[irq] = mk_ipi_info(evtchn, ipi); |
1329 | bind_evtchn_to_cpu(evtchn, cpu); | 1326 | bind_evtchn_to_cpu(evtchn, cpu); |
1330 | |||
1331 | /* Ready for use. */ | ||
1332 | unmask_evtchn(evtchn); | ||
1333 | |||
1334 | } | 1327 | } |
1335 | } | 1328 | } |
1336 | 1329 | ||
@@ -1390,6 +1383,7 @@ void xen_poll_irq(int irq) | |||
1390 | void xen_irq_resume(void) | 1383 | void xen_irq_resume(void) |
1391 | { | 1384 | { |
1392 | unsigned int cpu, irq, evtchn; | 1385 | unsigned int cpu, irq, evtchn; |
1386 | struct irq_desc *desc; | ||
1393 | 1387 | ||
1394 | init_evtchn_cpu_bindings(); | 1388 | init_evtchn_cpu_bindings(); |
1395 | 1389 | ||
@@ -1408,6 +1402,23 @@ void xen_irq_resume(void) | |||
1408 | restore_cpu_virqs(cpu); | 1402 | restore_cpu_virqs(cpu); |
1409 | restore_cpu_ipis(cpu); | 1403 | restore_cpu_ipis(cpu); |
1410 | } | 1404 | } |
1405 | |||
1406 | /* | ||
1407 | * Unmask any IRQF_NO_SUSPEND IRQs which are enabled. These | ||
1408 | * are not handled by the IRQ core. | ||
1409 | */ | ||
1410 | for_each_irq_desc(irq, desc) { | ||
1411 | if (!desc->action || !(desc->action->flags & IRQF_NO_SUSPEND)) | ||
1412 | continue; | ||
1413 | if (desc->status & IRQ_DISABLED) | ||
1414 | continue; | ||
1415 | |||
1416 | evtchn = evtchn_from_irq(irq); | ||
1417 | if (evtchn == -1) | ||
1418 | continue; | ||
1419 | |||
1420 | unmask_evtchn(evtchn); | ||
1421 | } | ||
1411 | } | 1422 | } |
1412 | 1423 | ||
1413 | static struct irq_chip xen_dynamic_chip __read_mostly = { | 1424 | static struct irq_chip xen_dynamic_chip __read_mostly = { |