Skip to content

Commit

Permalink
[ALSA] hda-intel - Switch to polling mode for CORB/RIRB communication
Browse files Browse the repository at this point in the history
Automatically switch to polling mode for CORB/RIRB communication
if the irq-driven mode seems not working well.  If the polling
mode still doesn't work, switch to single_cmd mode as fallback.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
  • Loading branch information
Takashi Iwai authored and Jaroslav Kysela committed Sep 23, 2006
1 parent 81d3dbd commit e96224a
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion sound/pci/hda/hda_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ struct azx {
int position_fix;
unsigned int initialized: 1;
unsigned int single_cmd: 1;
unsigned int polling_mode: 1;
};

/* driver types */
Expand Down Expand Up @@ -518,8 +519,23 @@ static unsigned int azx_rirb_get_response(struct hda_codec *codec)
struct azx *chip = codec->bus->private_data;
int timeout = 50;

while (chip->rirb.cmds) {
for (;;) {
if (chip->polling_mode) {
spin_lock_irq(&chip->reg_lock);
azx_update_rirb(chip);
spin_unlock_irq(&chip->reg_lock);
}
if (! chip->rirb.cmds)
break;
if (! --timeout) {
if (! chip->polling_mode) {
snd_printk(KERN_WARNING "hda_intel: "
"azx_get_response timeout, "
"switching to polling mode...\n");
chip->polling_mode = 1;
timeout = 50;
continue;
}
snd_printk(KERN_ERR
"hda_intel: azx_get_response timeout, "
"switching to single_cmd mode...\n");
Expand Down

0 comments on commit e96224a

Please sign in to comment.