diff options
author | Bard Liao <yung-chuan.liao@linux.intel.com> | 2019-05-29 16:59:00 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2019-05-30 05:00:21 -0400 |
commit | ee8829dc609c5c4a425b4a65fbb4cd56fb82f1f4 (patch) | |
tree | 6b53f21b589145d907973c48a559acfe13e79306 /sound/hda | |
parent | 64ca9d9fcb3e3c86b1417e3d17a90b43dd660f81 (diff) |
ALSA: hda: fix: lock reg_lock before calling snd_hdac_bus_update_rirb
The patch is to fix commit 5e13cf6cd64c
(ALSA: hda: add polling mode in snd_hdac_bus_get_response)
spin_lock_irq should be called before snd_hdac_bus_update_rirb.
Fixes: 5e13cf6cd64c ("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>
Diffstat (limited to 'sound/hda')
-rw-r--r-- | sound/hda/hdac_controller.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/hda/hdac_controller.c b/sound/hda/hdac_controller.c index a16ac31bda83..d6a91429c058 100644 --- a/sound/hda/hdac_controller.c +++ b/sound/hda/hdac_controller.c | |||
@@ -239,9 +239,9 @@ int snd_hdac_bus_get_response(struct hdac_bus *bus, unsigned int addr, | |||
239 | timeout = jiffies + msecs_to_jiffies(1000); | 239 | timeout = jiffies + msecs_to_jiffies(1000); |
240 | 240 | ||
241 | for (loopcounter = 0;; loopcounter++) { | 241 | for (loopcounter = 0;; loopcounter++) { |
242 | spin_lock_irq(&bus->reg_lock); | ||
242 | if (bus->polling_mode) | 243 | if (bus->polling_mode) |
243 | snd_hdac_bus_update_rirb(bus); | 244 | snd_hdac_bus_update_rirb(bus); |
244 | spin_lock_irq(&bus->reg_lock); | ||
245 | if (!bus->rirb.cmds[addr]) { | 245 | if (!bus->rirb.cmds[addr]) { |
246 | if (res) | 246 | if (res) |
247 | *res = bus->rirb.res[addr]; /* the last value */ | 247 | *res = bus->rirb.res[addr]; /* the last value */ |