summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-08-28 10:39:10 -0400
committerTakashi Iwai <tiwai@suse.de>2018-09-13 01:58:43 -0400
commit7064f376d4a10686f51c879401a569bb4babf9c6 (patch)
tree8f9eb08e54211170313e304c9e56a11b4626361d
parent5b03006d5c58ddd31caf542eef4d0269bcf265b3 (diff)
ALSA: intel8x0m: Register irq handler after register initializations
The interrupt handler has to be acquired after the other resource initialization when allocated with IRQF_SHARED. Otherwise it's triggered before the resource gets ready, and may lead to unpleasant behavior. Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/intel8x0m.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sound/pci/intel8x0m.c b/sound/pci/intel8x0m.c
index 943a726b1c1b..c84629190cba 100644
--- a/sound/pci/intel8x0m.c
+++ b/sound/pci/intel8x0m.c
@@ -1171,16 +1171,6 @@ static int snd_intel8x0m_create(struct snd_card *card,
1171 } 1171 }
1172 1172
1173 port_inited: 1173 port_inited:
1174 if (request_irq(pci->irq, snd_intel8x0m_interrupt, IRQF_SHARED,
1175 KBUILD_MODNAME, chip)) {
1176 dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq);
1177 snd_intel8x0m_free(chip);
1178 return -EBUSY;
1179 }
1180 chip->irq = pci->irq;
1181 pci_set_master(pci);
1182 synchronize_irq(chip->irq);
1183
1184 /* initialize offsets */ 1174 /* initialize offsets */
1185 chip->bdbars_count = 2; 1175 chip->bdbars_count = 2;
1186 tbl = intel_regs; 1176 tbl = intel_regs;
@@ -1224,11 +1214,21 @@ static int snd_intel8x0m_create(struct snd_card *card,
1224 chip->int_sta_reg = ICH_REG_GLOB_STA; 1214 chip->int_sta_reg = ICH_REG_GLOB_STA;
1225 chip->int_sta_mask = int_sta_masks; 1215 chip->int_sta_mask = int_sta_masks;
1226 1216
1217 pci_set_master(pci);
1218
1227 if ((err = snd_intel8x0m_chip_init(chip, 1)) < 0) { 1219 if ((err = snd_intel8x0m_chip_init(chip, 1)) < 0) {
1228 snd_intel8x0m_free(chip); 1220 snd_intel8x0m_free(chip);
1229 return err; 1221 return err;
1230 } 1222 }
1231 1223
1224 if (request_irq(pci->irq, snd_intel8x0m_interrupt, IRQF_SHARED,
1225 KBUILD_MODNAME, chip)) {
1226 dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq);
1227 snd_intel8x0m_free(chip);
1228 return -EBUSY;
1229 }
1230 chip->irq = pci->irq;
1231
1232 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) { 1232 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) {
1233 snd_intel8x0m_free(chip); 1233 snd_intel8x0m_free(chip);
1234 return err; 1234 return err;