Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 148397
b: refs/heads/master
c: b613291
h: refs/heads/master
i:
  148395: bf4b517
v: v3
  • Loading branch information
Takashi Iwai committed Apr 21, 2009
1 parent f035695 commit b6fc740
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 14 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: 92c7c8a7d6e03eb4c0a3c5888e35dbc45f24744c
refs/heads/master: b613291fb21a2d74eb8323d97fe9aa5d281b306c
17 changes: 13 additions & 4 deletions trunk/sound/pci/hda/hda_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,23 @@ unsigned int snd_hda_codec_read(struct hda_codec *codec, hda_nid_t nid,
unsigned int verb, unsigned int parm)
{
struct hda_bus *bus = codec->bus;
unsigned int res;
unsigned int cmd, res;
int repeated = 0;

res = make_codec_cmd(codec, nid, direct, verb, parm);
cmd = make_codec_cmd(codec, nid, direct, verb, parm);
snd_hda_power_up(codec);
mutex_lock(&bus->cmd_mutex);
if (!bus->ops.command(bus, res))
again:
if (!bus->ops.command(bus, cmd)) {
res = bus->ops.get_response(bus);
else
if (res == -1 && bus->rirb_error) {
if (repeated++ < 1) {
snd_printd(KERN_WARNING "hda_codec: "
"Trying verb 0x%08x again\n", cmd);
goto again;
}
}
} else
res = (unsigned int)-1;
mutex_unlock(&bus->cmd_mutex);
snd_hda_power_down(codec);
Expand Down
1 change: 1 addition & 0 deletions trunk/sound/pci/hda/hda_codec.h
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,7 @@ struct hda_bus {
/* misc op flags */
unsigned int needs_damn_long_delay :1;
unsigned int shutdown :1; /* being unloaded */
unsigned int rirb_error:1; /* error in codec communication */
};

/*
Expand Down
19 changes: 10 additions & 9 deletions trunk/sound/pci/hda/hda_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus)
}
if (!chip->rirb.cmds) {
smp_rmb();
bus->rirb_error = 0;
return chip->rirb.res; /* the last value */
}
if (time_after(jiffies, timeout))
Expand All @@ -623,8 +624,10 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus)
chip->irq = -1;
pci_disable_msi(chip->pci);
chip->msi = 0;
if (azx_acquire_irq(chip, 1) < 0)
if (azx_acquire_irq(chip, 1) < 0) {
bus->rirb_error = 1;
return -1;
}
goto again;
}

Expand All @@ -644,14 +647,12 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus)
return -1;
}

snd_printk(KERN_ERR "hda_intel: azx_get_response timeout, "
"switching to single_cmd mode: last cmd=0x%08x\n",
chip->last_cmd);
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);
snd_printk(KERN_ERR "hda_intel: azx_get_response timeout (ERROR): "
"last cmd=0x%08x\n", chip->last_cmd);
spin_lock_irq(&chip->reg_lock);
chip->rirb.cmds = 0; /* reset the index */
bus->rirb_error = 1;
spin_unlock_irq(&chip->reg_lock);
return -1;
}

Expand Down

0 comments on commit b6fc740

Please sign in to comment.