diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 6e61a01..9c774c5 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -1418,6 +1418,7 @@ static irqreturn_t azx_interrupt(int irq, void *dev_id) return IRQ_NONE; } + printk(KERN_INFO "hda-intel REAL IRQ on %s: we have to poll %d streams\n", pci_name(chip->pci), chip->num_streams); for (i = 0; i < chip->num_streams; i++) { azx_dev = &chip->azx_dev[i]; if (status & azx_dev->sd_int_sta_mask) { @@ -1426,8 +1427,15 @@ static irqreturn_t azx_interrupt(int irq, void *dev_id) if (!azx_dev->substream || !azx_dev->running || !(sd_status & SD_INT_COMPLETE)) continue; + printk(KERN_INFO "hda-intel looking at stream %d\n", i); /* check whether this IRQ is really acceptable */ ok = azx_position_ok(chip, azx_dev); + printk(KERN_INFO "hda-intel azx_position_ok result = %d\n", ok); + if (!chip->bus) + printk(KERN_INFO "hda-intel chip has no bus\n"); + if (!(chip->bus && chip->bus->workq)) + printk(KERN_INFO "hda-intel chip bus has no workq\n"); + if (ok == 1) { azx_dev->irq_pending = 0; spin_unlock(&chip->reg_lock); @@ -2489,19 +2497,26 @@ static int azx_position_ok(struct azx *chip, struct azx_dev *azx_dev) unsigned int pos; wallclk = azx_readl(chip, WALLCLK) - azx_dev->start_wallclk; - if (wallclk < (azx_dev->period_wallclk * 2) / 3) + printk(KERN_INFO "hda-intel azx_position_ok: wallclk = %u, period_wallclk = %u\n", wallclk, azx_dev->period_wallclk); + if (wallclk < (azx_dev->period_wallclk * 2) / 3) { + printk(KERN_INFO "hda-intel azx_position_ok: bogus (too early) interrupt\n"); return -1; /* bogus (too early) interrupt */ + } pos = azx_get_position(chip, azx_dev, true); + printk(KERN_INFO "hda-intel azx_position_ok: pos = %u, period_bytes = %u\n", pos, azx_dev->period_bytes); if (WARN_ONCE(!azx_dev->period_bytes, "hda-intel: zero azx_dev->period_bytes")) return -1; /* this shouldn't happen! */ if (wallclk < (azx_dev->period_wallclk * 5) / 4 && - pos % azx_dev->period_bytes > azx_dev->period_bytes / 2) + pos % azx_dev->period_bytes > azx_dev->period_bytes / 2) { /* NG - it's below the first next period boundary */ + printk(KERN_INFO "hda-intel azx_position_ok: dubious interrupt\n"); return bdl_pos_adj[chip->dev_index] ? 0 : -1; + } azx_dev->start_wallclk += wallclk; + printk(KERN_INFO "hda-intel azx_position_ok: good interrupt\n"); return 1; /* OK, it's fine */ } @@ -2524,13 +2539,16 @@ static void azx_irq_pending_work(struct work_struct *work) for (;;) { pending = 0; spin_lock_irq(&chip->reg_lock); + printk(KERN_INFO "hda-intel PENDING IRQ on %s: we have to poll %d streams\n", pci_name(chip->pci), chip->num_streams); for (i = 0; i < chip->num_streams; i++) { struct azx_dev *azx_dev = &chip->azx_dev[i]; if (!azx_dev->irq_pending || !azx_dev->substream || !azx_dev->running) continue; + printk(KERN_INFO "hda-intel looking at stream %d\n", i); ok = azx_position_ok(chip, azx_dev); + printk(KERN_INFO "hda-intel azx_position_ok result = %d\n", ok); if (ok > 0) { azx_dev->irq_pending = 0; spin_unlock(&chip->reg_lock); @@ -2544,6 +2562,7 @@ static void azx_irq_pending_work(struct work_struct *work) spin_unlock_irq(&chip->reg_lock); if (!pending) return; + printk(KERN_INFO "hda-intel PENDING IRQ on %s: sleeping\n", pci_name(chip->pci)); msleep(1); } }