Skip to content

Commit cbc3e98

Browse files
Yanteng Sitiwai
authored andcommitted
ALSA: hda: Using polling mode for loongson controller by default
On loongson controller, RIRBSTS.RINTFL cannot be cleared, azx_interrupt() is called all the time. We disable RIRB interrupt, and use polling mode by default. Signed-off-by: Yanteng Si <siyanteng@loongson.cn> Signed-off-by: Yingkun Meng <mengyingkun@loongson.cn> Acked-by: Huacai Chen <chenhuacai@loongson.cn> Link: https://lore.kernel.org/r/d309a75424d438b958d90d797b4f1ba45468e090.1686128807.git.siyanteng@loongson.cn Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 28bd137 commit cbc3e98

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

include/sound/hdaudio.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ struct hdac_bus {
347347
bool corbrp_self_clear:1; /* CORBRP clears itself after reset */
348348
bool polling_mode:1;
349349
bool needs_damn_long_delay:1;
350+
bool not_use_interrupts:1; /* prohibiting the RIRB IRQ */
350351

351352
int poll_count;
352353

sound/hda/hdac_controller.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@ void snd_hdac_bus_init_cmd_io(struct hdac_bus *bus)
7979
/* set N=1, get RIRB response interrupt for new entry */
8080
snd_hdac_chip_writew(bus, RINTCNT, 1);
8181
/* enable rirb dma and response irq */
82-
snd_hdac_chip_writeb(bus, RIRBCTL, AZX_RBCTL_DMA_EN | AZX_RBCTL_IRQ_EN);
82+
if (bus->not_use_interrupts)
83+
snd_hdac_chip_writeb(bus, RIRBCTL, AZX_RBCTL_DMA_EN);
84+
else
85+
snd_hdac_chip_writeb(bus, RIRBCTL, AZX_RBCTL_DMA_EN | AZX_RBCTL_IRQ_EN);
8386
/* Accept unsolicited responses */
8487
snd_hdac_chip_updatel(bus, GCTL, AZX_GCTL_UNSOL, AZX_GCTL_UNSOL);
8588
spin_unlock_irq(&bus->reg_lock);

sound/pci/hda/hda_intel.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1875,6 +1875,11 @@ static int azx_first_init(struct azx *chip)
18751875
if (chip->driver_type == AZX_DRIVER_GFHDMI)
18761876
bus->polling_mode = 1;
18771877

1878+
if (chip->driver_type == AZX_DRIVER_LOONGSON) {
1879+
bus->polling_mode = 1;
1880+
bus->not_use_interrupts = 1;
1881+
}
1882+
18781883
err = pcim_iomap_regions(pci, 1 << 0, "ICH HD audio");
18791884
if (err < 0)
18801885
return err;

0 commit comments

Comments
 (0)