]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: hda: Fix racy display power access
authorTakashi Iwai <tiwai@suse.de>
Wed, 10 Apr 2019 11:03:22 +0000 (13:03 +0200)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 10 Apr 2019 13:13:47 +0000 (14:13 +0100)
commit56b89da5f08fcd2bb3995d146e30550964c6d75c
tree6facb4080bed4da06e3f2384820e7f2dbb4ec1e5
parent521e06121fc0e099f3d74359ed7943168b18e815
ALSA: hda: Fix racy display power access

snd_hdac_display_power() doesn't handle the concurrent calls carefully
enough, and it may lead to the doubly get_power or put_power calls,
when a runtime PM and an async work get called in racy way.

This patch addresses it by reusing the bus->lock mutex that has been
used for protecting the link state change in ext bus code, so that it
can protect against racy display state changes.  The initialization of
bus->lock was moved from snd_hdac_ext_bus_init() to
snd_hdac_bus_init() as well accordingly.

Testcase: igt/i915_pm_rpm/module-reload #glk-dsi
Reported-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Imre Deak <imre.deak@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/s5h8swiunph.wl-tiwai@suse.de
sound/hda/ext/hdac_ext_bus.c
sound/hda/hdac_bus.c
sound/hda/hdac_component.c