linux/sound
Takashi Iwai 9780ded39b ALSA: hda: Avoid racy recreation of widget kobjects
The refresh of HD-audio widget sysfs kobjects via
snd_hdac_refresh_widget_sysfs() is slightly racy.
The driver recreates the whole tree from scratch after deleting the
whole.  When CONFIG_DEBUG_KOBJECT_RELEASE option is used, kobject
release doesn't happen immediately but delayed, while the re-creation
of the same named kobject happens soon after invoking kobject_put().
This may end up with the conflicts of duplicated kobjects, as found in
the bug report below.

In this patch, we take another approach to refresh the tree: instead
of recreating the whole tree, just add the new nodes and delete the
non-existing nodes.  Since the refresh happens only once at
initialization, no longer race would happen.

Along with the code change, merge snd_hdac_refresh_widget_sysfs() with
the existing snd_hdac_refresh_widgets() with an additional bool flag
for simplifying the code.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=197307
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-10-19 13:58:36 +02:00
..
aoa ALSA: aoa: Convert to using %pOF instead of full_name 2017-08-29 14:52:17 +02:00
arm ALSA: aaci: constify ac97_pcm structures 2017-08-23 15:53:37 +02:00
atmel ASoC: Updates for v4.14 2017-09-04 14:50:49 +02:00
core Merge branch 'for-linus' into for-next 2017-10-17 10:52:06 +02:00
drivers ALSA: vx: Put missing KERN_CONT prefix 2017-08-31 11:01:17 +02:00
firewire ALSA: firewire: Use common error handling code in snd_motu_stream_start_duplex() 2017-09-12 09:23:26 +02:00
hda ALSA: hda: Avoid racy recreation of widget kobjects 2017-10-19 13:58:36 +02:00
i2c ALSA: ak411x: Use array instead of offsetof() 2017-05-17 07:13:03 +02:00
isa ALSA: isa: make snd_pcm_hardware const 2017-08-17 12:44:11 +02:00
mips ALSA: mips: constify snd_pcm_ops structures 2017-08-19 11:02:18 +02:00
oss vfs: constify path argument to kernel_read_file_from_path 2017-09-14 20:18:45 -07:00
parisc sound updates for 4.14-rc1 2017-09-07 12:44:53 -07:00
pci ALSA: hda: Avoid racy recreation of widget kobjects 2017-10-19 13:58:36 +02:00
pcmcia ALSA: pcmcia: constify snd_pcm_ops structures 2017-08-19 11:02:21 +02:00
ppc ALSA: ppc: constify snd_pcm_ops structures 2017-08-19 11:02:22 +02:00
sh ALSA: sh: aica: Convert timers to use timer_setup() 2017-10-05 08:20:17 +02:00
soc dmi: Mark all struct dmi_system_id instances const 2017-09-14 11:59:30 +02:00
sparc ALSA: sparc: constify snd_pcm_ops structures 2017-08-19 11:02:24 +02:00
spi ALSA: spi: constify snd_pcm_ops structures 2017-08-19 11:02:26 +02:00
synth ALSA: emux: remove unused redundant variable p2 2017-10-16 13:37:38 +02:00
usb ALSA: usb-audio: Convert timers to use timer_setup() 2017-10-17 10:52:22 +02:00
x86 main drm pull for v4.13 2017-07-09 18:48:37 -07:00
ac97_bus.c
Kconfig ALSA: synth: Select snd-emux-synth explicitly 2017-06-09 22:10:06 +02:00
last.c
Makefile
sound_core.c