1
0
Fork 0

ALSA: hda: fix: lock reg_lock before calling snd_hdac_bus_update_rirb

The patch is to fix commit 5e13cf6cd6
(ALSA: hda: add polling mode in snd_hdac_bus_get_response)
spin_lock_irq should be called before snd_hdac_bus_update_rirb.

Fixes: 5e13cf6cd6 ("ALSA: hda: add polling mode in snd_hdac_bus_get_response")
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
alistair/sunxi64-5.4-dsi
Bard Liao 2019-05-30 04:59:00 +08:00 committed by Takashi Iwai
parent 64ca9d9fcb
commit ee8829dc60
1 changed files with 1 additions and 1 deletions

View File

@ -239,9 +239,9 @@ int snd_hdac_bus_get_response(struct hdac_bus *bus, unsigned int addr,
timeout = jiffies + msecs_to_jiffies(1000);
for (loopcounter = 0;; loopcounter++) {
spin_lock_irq(&bus->reg_lock);
if (bus->polling_mode)
snd_hdac_bus_update_rirb(bus);
spin_lock_irq(&bus->reg_lock);
if (!bus->rirb.cmds[addr]) {
if (res)
*res = bus->rirb.res[addr]; /* the last value */