diff options
author | Wei Gang <gang.wei@intel.com> | 2011-02-14 10:41:12 +0000 |
---|---|---|
committer | Wei Gang <gang.wei@intel.com> | 2011-02-14 10:41:12 +0000 |
commit | f2cc80444550378a3b202242b2a090d20b5d7dab (patch) | |
tree | 005fa09910d9be15c43a2634e46685511d47848c | |
parent | fb6b4152c90048b2d1014f2762f9f3130c5aa57f (diff) | |
download | xen-f2cc80444550378a3b202242b2a090d20b5d7dab.tar.gz xen-f2cc80444550378a3b202242b2a090d20b5d7dab.tar.bz2 xen-f2cc80444550378a3b202242b2a090d20b5d7dab.zip |
x86: Fix S3 resume for HPET MSI IRQ case
Jan Beulich found that for S3 resume on platforms without ARAT feature
but with MSI capable HPET, request_irq() will be called in
hpet_setup_msi_irq() for irq already setup(no release_irq() called
during S3 suspend), so that always falling back to using
legacy_hpet_event.
Fix it by conditional calling request_irq() for 4.1. Planned to split
the S3 resume path from booting path post 4.1, as Jan suggested.
Signed-off-by: Wei Gang <gang.wei@intel.com>
Acked-by: Jan Beulich <jbeulich@novell.com>
-rw-r--r-- | xen/arch/x86/hpet.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c index d27a4d1c02..af568a3708 100644 --- a/xen/arch/x86/hpet.c +++ b/xen/arch/x86/hpet.c @@ -367,12 +367,20 @@ static int hpet_setup_msi_irq(unsigned int irq) int ret; struct msi_msg msg; struct hpet_event_channel *ch = &hpet_events[irq_to_channel(irq)]; + irq_desc_t *desc = irq_to_desc(irq); - irq_desc[irq].handler = &hpet_msi_type; - ret = request_irq(irq, hpet_interrupt_handler, - 0, "HPET", ch); - if ( ret < 0 ) - return ret; + if ( desc->handler == &no_irq_type ) + { + desc->handler = &hpet_msi_type; + ret = request_irq(irq, hpet_interrupt_handler, + 0, "HPET", ch); + if ( ret < 0 ) + return ret; + } + else if ( desc->handler != &hpet_msi_type ) + { + return -EINVAL; + } msi_compose_msg(NULL, irq, &msg); hpet_msi_write(irq, &msg); |