Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 353052
b: refs/heads/master
c: 3bcce5c
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai committed Jan 12, 2013
1 parent 8a7634d commit cf1753e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 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: aa88a3553eebdcc3ce6801aabb4ed0223bfa198e
refs/heads/master: 3bcce5c0d931bf623adc5974200e4d7636b10bef
10 changes: 8 additions & 2 deletions trunk/sound/pci/hda/hda_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,14 @@ static int codec_exec_verb(struct hda_codec *codec, unsigned int cmd,
again:
snd_hda_power_up(codec);
mutex_lock(&bus->cmd_mutex);
trace_hda_send_cmd(codec, cmd);
err = bus->ops.command(bus, cmd);
for (;;) {
trace_hda_send_cmd(codec, cmd);
err = bus->ops.command(bus, cmd);
if (err != -EAGAIN)
break;
/* process pending verbs */
bus->ops.get_response(bus, codec->addr);
}
if (!err && res) {
*res = bus->ops.get_response(bus, codec->addr);
trace_hda_get_response(codec, *res);
Expand Down
11 changes: 9 additions & 2 deletions trunk/sound/pci/hda/hda_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ static int azx_corb_send_cmd(struct hda_bus *bus, u32 val)
{
struct azx *chip = bus->private_data;
unsigned int addr = azx_command_addr(val);
unsigned int wp;
unsigned int wp, rp;

spin_lock_irq(&chip->reg_lock);

Expand All @@ -806,11 +806,18 @@ static int azx_corb_send_cmd(struct hda_bus *bus, u32 val)
if (wp == 0xffff) {
/* something wrong, controller likely turned to D3 */
spin_unlock_irq(&chip->reg_lock);
return -1;
return -EIO;
}
wp++;
wp %= ICH6_MAX_CORB_ENTRIES;

rp = azx_readw(chip, CORBRP);
if (wp == rp) {
/* oops, it's full */
spin_unlock_irq(&chip->reg_lock);
return -EAGAIN;
}

chip->rirb.cmds[addr]++;
chip->corb.buf[wp] = cpu_to_le32(val);
azx_writel(chip, CORBWP, wp);
Expand Down

0 comments on commit cf1753e

Please sign in to comment.