diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2010-05-25 03:03:40 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-05-25 14:23:15 -0400 |
commit | 9ef04066b3e7c51ed7edc6010ac039f18f9f3617 (patch) | |
tree | 7581d83c1f06f56f47f461e85ef181e3d3878921 /sound/pci/hda/hda_intel.c | |
parent | 66668b6fb6861fad7f6bfef6646ac84693474c9a (diff) |
ALSA: hda_intel: fix handling of non-completion stream interrupts
Check that the interrupt raised for a stream is actually a buffer
completion interrupt before handling it as one. Otherwise, memory
errors or FIFO xruns would be interpreted as a pointer update and could
break the stream timing.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_intel.c')
-rw-r--r-- | sound/pci/hda/hda_intel.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 14d895bcf3fe..77e22c2a8caa 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -1097,6 +1097,7 @@ static irqreturn_t azx_interrupt(int irq, void *dev_id) | |||
1097 | struct azx *chip = dev_id; | 1097 | struct azx *chip = dev_id; |
1098 | struct azx_dev *azx_dev; | 1098 | struct azx_dev *azx_dev; |
1099 | u32 status; | 1099 | u32 status; |
1100 | u8 sd_status; | ||
1100 | int i, ok; | 1101 | int i, ok; |
1101 | 1102 | ||
1102 | spin_lock(&chip->reg_lock); | 1103 | spin_lock(&chip->reg_lock); |
@@ -1110,8 +1111,10 @@ static irqreturn_t azx_interrupt(int irq, void *dev_id) | |||
1110 | for (i = 0; i < chip->num_streams; i++) { | 1111 | for (i = 0; i < chip->num_streams; i++) { |
1111 | azx_dev = &chip->azx_dev[i]; | 1112 | azx_dev = &chip->azx_dev[i]; |
1112 | if (status & azx_dev->sd_int_sta_mask) { | 1113 | if (status & azx_dev->sd_int_sta_mask) { |
1114 | sd_status = azx_sd_readb(azx_dev, SD_STS); | ||
1113 | azx_sd_writeb(azx_dev, SD_STS, SD_INT_MASK); | 1115 | azx_sd_writeb(azx_dev, SD_STS, SD_INT_MASK); |
1114 | if (!azx_dev->substream || !azx_dev->running) | 1116 | if (!azx_dev->substream || !azx_dev->running || |
1117 | !(sd_status & SD_INT_COMPLETE)) | ||
1115 | continue; | 1118 | continue; |
1116 | /* check whether this IRQ is really acceptable */ | 1119 | /* check whether this IRQ is really acceptable */ |
1117 | ok = azx_position_ok(chip, azx_dev); | 1120 | ok = azx_position_ok(chip, azx_dev); |