Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2add9b92 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

[ALSA] hda-intel - Add barrier



Add proper barriers in the RIRB communication code.

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 86d34b7e
Loading
Loading
Loading
Loading
+5 −2
Original line number Original line Diff line number Diff line
@@ -536,8 +536,9 @@ static void azx_update_rirb(struct azx *chip)
		if (res_ex & ICH6_RIRB_EX_UNSOL_EV)
		if (res_ex & ICH6_RIRB_EX_UNSOL_EV)
			snd_hda_queue_unsol_event(chip->bus, res, res_ex);
			snd_hda_queue_unsol_event(chip->bus, res, res_ex);
		else if (chip->rirb.cmds) {
		else if (chip->rirb.cmds) {
			chip->rirb.cmds--;
			chip->rirb.res = res;
			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);
			azx_update_rirb(chip);
			spin_unlock_irq(&chip->reg_lock);
			spin_unlock_irq(&chip->reg_lock);
		}
		}
		if (!chip->rirb.cmds)
		if (!chip->rirb.cmds) {
			smp_rmb();
			return chip->rirb.res; /* the last value */
			return chip->rirb.res; /* the last value */
		}
		if (time_after(jiffies, timeout))
		if (time_after(jiffies, timeout))
			break;
			break;
		if (codec->bus->needs_damn_long_delay)
		if (codec->bus->needs_damn_long_delay)