linux/sound/hda
Takashi Iwai c3aeda6287 ALSA: hda - Fix another race in runtime PM refcounting
Although some races in runtime PM refcount was fixed by the commit
[664c715573: ALSA: hda - Work around races of power up/down with
runtime PM], there is still a race in the following case:

CPU0:                   CPU1 :
runtime suspend:
  codec->in_pm = 1
                        snd_hdac_power_up_pm():
                          pm_runtime_get_sync() skipped
suspend finished:
  codec->in_pm = 0
                        snd_hdac_power_down_pm():
                          pm_runtime_put_*() is called!

For avoiding this situation, increment in_pm flag atomically when it's
non-zero, and decrement accordingly, to ensure that in_pm is set
consistently for the whole concurrent operations.

Also, since atomic_inc_not_zero() and atomic_dec_if_positive() are
lengthy inline functions, move snd_hdac_power_up_pm() and _down_pm()
to sound/hda/hdac_device.c as no inline functions.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-04-13 11:07:20 +02:00
..
array.c ALSA: hda - Move generic array helpers to core lib 2015-03-23 13:19:35 +01:00
hda_bus_type.c ALSA: hda - Make snd_hda_bus_type public 2015-03-23 13:15:51 +01:00
hdac_bus.c ALSA: hda - Re-add tracepoints to HD-audio core driver 2015-03-23 13:17:58 +01:00
hdac_device.c ALSA: hda - Fix another race in runtime PM refcounting 2015-04-13 11:07:20 +02:00
hdac_regmap.c ALSA: hda - Always allow access for POWER_STATE verbs via regmap 2015-04-09 08:24:51 +02:00
hdac_sysfs.c ALSA: hda - Expose codec type sysfs 2015-04-13 10:43:54 +02:00
Kconfig ALSA: hda - Add regmap support 2015-03-23 13:19:36 +01:00
local.h ALSA: hda - Add widget sysfs tree 2015-03-23 13:17:27 +01:00
Makefile ALSA: hda - Add regmap support 2015-03-23 13:19:36 +01:00
trace.c ALSA: hda - Re-add tracepoints to HD-audio core driver 2015-03-23 13:17:58 +01:00
trace.h ALSA: hda - Re-add tracepoints to HD-audio core driver 2015-03-23 13:17:58 +01:00