ALSA: ice1724 - Fix TX IRQ lockup

MPU TX causes IRQ floods on VT172x devices mysteriously.
Disable TX IRQ if the IRQ flood is detected.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2008-08-11 10:18:39 +02:00
parent c872e8cab5
commit 1083206ff4
1 changed files with 12 additions and 8 deletions

View File

@ -382,23 +382,25 @@ static irqreturn_t snd_vt1724_interrupt(int irq, void *dev_id)
unsigned char status_mask = unsigned char status_mask =
VT1724_IRQ_MPU_RX | VT1724_IRQ_MPU_TX | VT1724_IRQ_MTPCM; VT1724_IRQ_MPU_RX | VT1724_IRQ_MPU_TX | VT1724_IRQ_MTPCM;
int handled = 0; int handled = 0;
#ifdef CONFIG_SND_DEBUG
int timeout = 0; int timeout = 0;
#endif
while (1) { while (1) {
status = inb(ICEREG1724(ice, IRQSTAT)); status = inb(ICEREG1724(ice, IRQSTAT));
status &= status_mask; status &= status_mask;
if (status == 0) if (status == 0)
break; break;
#ifdef CONFIG_SND_DEBUG
if (++timeout > 10) { if (++timeout > 10) {
printk(KERN_ERR status = inb(ICEREG1724(ice, IRQSTAT));
"ice1724: Too long irq loop, status = 0x%x\n", printk(KERN_ERR "ice1724: Too long irq loop, "
status); "status = 0x%x\n", status);
if (status & VT1724_IRQ_MPU_TX) {
printk(KERN_ERR "ice1724: Disabling MPU_TX\n");
outb(inb(ICEREG1724(ice, IRQMASK)) &
~VT1724_IRQ_MPU_TX,
ICEREG1724(ice, IRQMASK));
}
break; break;
} }
#endif
handled = 1; handled = 1;
if (status & VT1724_IRQ_MPU_TX) { if (status & VT1724_IRQ_MPU_TX) {
spin_lock(&ice->reg_lock); spin_lock(&ice->reg_lock);
@ -2351,7 +2353,7 @@ static int __devinit snd_vt1724_create(struct snd_card *card,
{ {
struct snd_ice1712 *ice; struct snd_ice1712 *ice;
int err; int err;
unsigned char mask; /* unsigned char mask; */
static struct snd_device_ops ops = { static struct snd_device_ops ops = {
.dev_free = snd_vt1724_dev_free, .dev_free = snd_vt1724_dev_free,
}; };
@ -2413,8 +2415,10 @@ static int __devinit snd_vt1724_create(struct snd_card *card,
} }
/* unmask used interrupts */ /* unmask used interrupts */
#if 0 /* these are enabled/disabled dynamically */
mask = VT1724_IRQ_MPU_RX | VT1724_IRQ_MPU_TX; mask = VT1724_IRQ_MPU_RX | VT1724_IRQ_MPU_TX;
outb(mask, ICEREG1724(ice, IRQMASK)); outb(mask, ICEREG1724(ice, IRQMASK));
#endif
/* don't handle FIFO overrun/underruns (just yet), /* don't handle FIFO overrun/underruns (just yet),
* since they cause machine lockups * since they cause machine lockups
*/ */