diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-05-25 12:34:52 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-05-25 12:34:52 -0400 |
commit | 4fcd39207f4c91185cc89e3e6a28cbb643034ff1 (patch) | |
tree | 1d6dd15ca8133528dc4100ca364f305672b5b110 /sound/pci/hda/hda_intel.c | |
parent | fa7979663190240b838ab8c8bad7f59e618bf77c (diff) |
ALSA: hda - Reset CORB/RIRB at retrying the verb communication
When a codec communication error occurs, the CORB/RIRB counters should
be reset first before re-issuing the verb. Simply call azx_free_cmd_io()
and azx_init_cmd_io() to achieve that.
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 | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 49fd973b85cc..3fc75e2061ab 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -522,6 +522,7 @@ static void azx_init_cmd_io(struct azx *chip) | |||
522 | /* RIRB set up */ | 522 | /* RIRB set up */ |
523 | chip->rirb.addr = chip->rb.addr + 2048; | 523 | chip->rirb.addr = chip->rb.addr + 2048; |
524 | chip->rirb.buf = (u32 *)(chip->rb.area + 2048); | 524 | chip->rirb.buf = (u32 *)(chip->rb.area + 2048); |
525 | chip->rirb.wp = chip->rirb.rp = chip->rirb.cmds = 0; | ||
525 | azx_writel(chip, RIRBLBASE, (u32)chip->rirb.addr); | 526 | azx_writel(chip, RIRBLBASE, (u32)chip->rirb.addr); |
526 | azx_writel(chip, RIRBUBASE, upper_32_bits(chip->rirb.addr)); | 527 | azx_writel(chip, RIRBUBASE, upper_32_bits(chip->rirb.addr)); |
527 | 528 | ||
@@ -533,7 +534,6 @@ static void azx_init_cmd_io(struct azx *chip) | |||
533 | azx_writew(chip, RINTCNT, 1); | 534 | azx_writew(chip, RINTCNT, 1); |
534 | /* enable rirb dma and response irq */ | 535 | /* enable rirb dma and response irq */ |
535 | azx_writeb(chip, RIRBCTL, ICH6_RBCTL_DMA_EN | ICH6_RBCTL_IRQ_EN); | 536 | azx_writeb(chip, RIRBCTL, ICH6_RBCTL_DMA_EN | ICH6_RBCTL_IRQ_EN); |
536 | chip->rirb.rp = chip->rirb.cmds = 0; | ||
537 | } | 537 | } |
538 | 538 | ||
539 | static void azx_free_cmd_io(struct azx *chip) | 539 | static void azx_free_cmd_io(struct azx *chip) |
@@ -654,9 +654,11 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus) | |||
654 | 654 | ||
655 | snd_printk(KERN_ERR SFX "azx_get_response timeout (ERROR): " | 655 | snd_printk(KERN_ERR SFX "azx_get_response timeout (ERROR): " |
656 | "last cmd=0x%08x\n", chip->last_cmd); | 656 | "last cmd=0x%08x\n", chip->last_cmd); |
657 | /* re-initialize CORB/RIRB */ | ||
657 | spin_lock_irq(&chip->reg_lock); | 658 | spin_lock_irq(&chip->reg_lock); |
658 | chip->rirb.cmds = 0; /* reset the index */ | ||
659 | bus->rirb_error = 1; | 659 | bus->rirb_error = 1; |
660 | azx_free_cmd_io(chip); | ||
661 | azx_init_cmd_io(chip); | ||
660 | spin_unlock_irq(&chip->reg_lock); | 662 | spin_unlock_irq(&chip->reg_lock); |
661 | return -1; | 663 | return -1; |
662 | } | 664 | } |