From: Takashi Iwai Date: Tue, 18 Mar 2008 08:47:06 +0000 (+0100) Subject: [ALSA] hda-intel - Add barrier X-Git-Tag: v2.6.26-rc1~1087^2~115 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2add9b925394746eff692ff0875d21ea2d5289e2;p=linux-2.6 [ALSA] hda-intel - Add barrier Add proper barriers in the RIRB communication code. Signed-off-by: Takashi Iwai --- diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 9a20fb1bef..557f269f83 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) 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--; } } } @@ -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)