Skip to content

Commit

Permalink
[ALSA] hda-intel - Add barrier
Browse files Browse the repository at this point in the history
Add proper barriers in the RIRB communication code.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Apr 24, 2008
1 parent 86d34b7 commit 2add9b9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sound/pci/hda/hda_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +536,9 @@ static void azx_update_rirb(struct azx *chip)
if (res_ex & ICH6_RIRB_EX_UNSOL_EV)
snd_hda_queue_unsol_event(chip->bus, res, res_ex);
else if (chip->rirb.cmds) {
chip->rirb.cmds--;
chip->rirb.res = res;
smp_wmb();
chip->rirb.cmds--;
}
}
}
Expand All @@ -556,8 +557,10 @@ static unsigned int azx_rirb_get_response(struct hda_codec *codec)
azx_update_rirb(chip);
spin_unlock_irq(&chip->reg_lock);
}
if (!chip->rirb.cmds)
if (!chip->rirb.cmds) {
smp_rmb();
return chip->rirb.res; /* the last value */
}
if (time_after(jiffies, timeout))
break;
if (codec->bus->needs_damn_long_delay)
Expand Down

0 comments on commit 2add9b9

Please sign in to comment.