sound: emu10k1 - fix system hang with Audigy2 ZS Notebook PCMCIA card
authorJaroslav Franek <jarin.franek@post.cz>
Sun, 8 Jun 2008 07:27:26 +0000 (09:27 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 16 Jun 2008 20:19:50 +0000 (13:19 -0700)
commit01891b7ca1373846a8ef2dfedce2bfe21369b81b
tree22107e8cf8fb92a5703f15b2a1ec5321a998aa93
parent605cdaa471b8304fef3f89b317d2696e5567fb8d
sound: emu10k1 - fix system hang with Audigy2 ZS Notebook PCMCIA card

upstream commit: 868e15dbd2940f9453b4399117686f408dc77299

When the Linux kernel is compiled with CONFIG_DEBUG_SHIRQ=y,
the Soundblaster Audigy2 ZS Notebook PCMCIA card causes the
system hang during boot (udev stage) or when the card is hot-plug.
The CONFIG_DEBUG_SHIRQ flag is by default 'y' with all Fedora
kernels since 2.6.23. The problem was reported as
https://bugzilla.redhat.com/show_bug.cgi?id=326411

The issue was hunted down to the snd_emu10k1_create() routine:

/* pseudo-code */
snd_emu10k1_create(...) {
...
request_irq(... IRQF_SHARED ...) {
register the irq handler
#ifdef CONFIG_DEBUG_SHIRQ
call the irq handler: snd_emu10k1_interrupt() {
poll I/O port   // <---- !! system hangs
...
}
#endif
}
...
snd_emu10k1_cardbus_init(...) {
initialize I/O ports
}
...
}

The early access to I/O port in the interrupt handler causes
the freeze. Obviously it is necessary to init the I/O ports
before accessing them. This patch moves the registration of
the irq handler after the initialization of the I/O ports.

Signed-off-by: Jaroslav Franek <jarin.franek@post.cz>
Acked-by: James Courtier-Dutton <James@superbug.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
sound/pci/emu10k1/emu10k1_main.c