Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 34962
b: refs/heads/master
c: 5c79b1f
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai authored and Jaroslav Kysela committed Sep 23, 2006
1 parent db4c7df commit 16420fc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 314634bc81325dcfeb31ed138647d428b1f26cbf
refs/heads/master: 5c79b1f887f8edcd399baa164b66a1c08566c994
46 changes: 22 additions & 24 deletions trunk/sound/pci/hda/hda_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,38 +520,36 @@ static void azx_update_rirb(struct azx *chip)
static unsigned int azx_rirb_get_response(struct hda_codec *codec)
{
struct azx *chip = codec->bus->private_data;
int timeout = 50;
unsigned long timeout;

for (;;) {
again:
timeout = jiffies + msecs_to_jiffies(1000);
do {
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");
chip->rirb.rp = azx_readb(chip, RIRBWP);
chip->rirb.cmds = 0;
/* switch to single_cmd mode */
chip->single_cmd = 1;
azx_free_cmd_io(chip);
return -1;
}
msleep(1);
return chip->rirb.res; /* the last value */
schedule_timeout_interruptible(1);
} while (time_after_eq(timeout, jiffies));

if (!chip->polling_mode) {
snd_printk(KERN_WARNING "hda_intel: azx_get_response timeout, "
"switching to polling mode...\n");
chip->polling_mode = 1;
goto again;
}
return chip->rirb.res; /* the last value */

snd_printk(KERN_ERR "hda_intel: azx_get_response timeout, "
"switching to single_cmd mode...\n");
chip->rirb.rp = azx_readb(chip, RIRBWP);
chip->rirb.cmds = 0;
/* switch to single_cmd mode */
chip->single_cmd = 1;
azx_free_cmd_io(chip);
return -1;
}

/*
Expand Down

0 comments on commit 16420fc

Please sign in to comment.