summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_codec.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-06-11 14:02:49 +0200
committerTakashi Iwai <tiwai@suse.de>2015-06-11 14:02:49 +0200
commita457782a1c694c5c84dac55c9a77789dd741a7e5 (patch)
tree2e870d36cbf154652b38b6d7ee639d0b982cb397 /sound/pci/hda/hda_codec.c
parentdf203a4e46f4cd8cd9f58e926bea462006f9b3a6 (diff)
downloadlinux-a457782a1c694c5c84dac55c9a77789dd741a7e5.tar.bz2
ALSA: hda - Fix link power unbalance at device removal
snd_hdac_link_power() has to be called after unregistering the codec device. Otherwise the device might be already runtime-suspended, thus the refcount goes under zero, triggering a warning like: WARNING: CPU: 7 PID: 2014 at sound/hda/hdac_i915.c:63 snd_hdac_display_power+0x106/0x120 [snd_hda_core]() CPU: 7 PID: 2014 Comm: modprobe Not tainted 4.1.0-rc7-test+ #1 Call Trace: [<ffffffff81697fe3>] dump_stack+0x4c/0x6e [<ffffffff810696da>] warn_slowpath_common+0x8a/0xc0 [<ffffffff810697ca>] warn_slowpath_null+0x1a/0x20 [<ffffffffa02dd526>] snd_hdac_display_power+0x106/0x120 [snd_hda_core] [<ffffffffa030b422>] azx_intel_link_power+0x12/0x20 [snd_hda_intel] [<ffffffffa037139f>] azx_link_power+0x1f/0x30 [snd_hda_codec] [<ffffffffa02d89fe>] snd_hdac_link_power+0x2e/0x40 [snd_hda_core] [<ffffffffa0368524>] snd_hda_codec_dev_free+0x34/0x50 [snd_hda_codec] [<ffffffffa0252061>] __snd_device_free+0x51/0xa0 [snd] ..... Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r--sound/pci/hda/hda_codec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index d70229841156..497bd0f9dcda 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -886,8 +886,8 @@ static int snd_hda_codec_dev_free(struct snd_device *device)
struct hda_codec *codec = device->device_data;
codec->in_freeing = 1;
- snd_hdac_link_power(&codec->core, false);
snd_hdac_device_unregister(&codec->core);
+ snd_hdac_link_power(&codec->core, false);
put_device(hda_codec_dev(codec));
return 0;
}