aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_intel.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-03-18 04:47:06 -0400
committerTakashi Iwai <tiwai@suse.de>2008-04-24 06:00:26 -0400
commit2add9b925394746eff692ff0875d21ea2d5289e2 (patch)
tree4ce428c5fec4e471726024c4de733c437315276a /sound/pci/hda/hda_intel.c
parent86d34b7ec878ea4b4c9f33ce92f1722c4326dbe7 (diff)
[ALSA] hda-intel - Add barrier
Add proper barriers in the RIRB communication code. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_intel.c')
-rw-r--r--sound/pci/hda/hda_intel.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 9a20fb1bef4f..557f269f83ab 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -536,8 +536,9 @@ static void azx_update_rirb(struct azx *chip)
536 if (res_ex & ICH6_RIRB_EX_UNSOL_EV) 536 if (res_ex & ICH6_RIRB_EX_UNSOL_EV)
537 snd_hda_queue_unsol_event(chip->bus, res, res_ex); 537 snd_hda_queue_unsol_event(chip->bus, res, res_ex);
538 else if (chip->rirb.cmds) { 538 else if (chip->rirb.cmds) {
539 chip->rirb.cmds--;
540 chip->rirb.res = res; 539 chip->rirb.res = res;
540 smp_wmb();
541 chip->rirb.cmds--;
541 } 542 }
542 } 543 }
543} 544}
@@ -556,8 +557,10 @@ static unsigned int azx_rirb_get_response(struct hda_codec *codec)
556 azx_update_rirb(chip); 557 azx_update_rirb(chip);
557 spin_unlock_irq(&chip->reg_lock); 558 spin_unlock_irq(&chip->reg_lock);
558 } 559 }
559 if (!chip->rirb.cmds) 560 if (!chip->rirb.cmds) {
561 smp_rmb();
560 return chip->rirb.res; /* the last value */ 562 return chip->rirb.res; /* the last value */
563 }
561 if (time_after(jiffies, timeout)) 564 if (time_after(jiffies, timeout))
562 break; 565 break;
563 if (codec->bus->needs_damn_long_delay) 566 if (codec->bus->needs_damn_long_delay)