Skip to content

Commit

Permalink
ALSA: hda: read CORBWP inside reg_lock
Browse files Browse the repository at this point in the history
This converts the last CORBWP access outside of reg_lock.

Signed-off-by: Wu Fengguang <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
Wu Fengguang authored and tiwai committed Aug 3, 2009
1 parent cdb1fbf commit c32649f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sound/pci/hda/hda_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,15 +588,17 @@ static int azx_corb_send_cmd(struct hda_bus *bus, u32 val)
unsigned int addr = azx_command_addr(val);
unsigned int wp;

spin_lock_irq(&chip->reg_lock);

/* add command to corb */
wp = azx_readb(chip, CORBWP);
wp++;
wp %= ICH6_MAX_CORB_ENTRIES;

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

spin_unlock_irq(&chip->reg_lock);

return 0;
Expand Down

0 comments on commit c32649f

Please sign in to comment.