]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ALSA: ak411x: Fix stall in work callback
authorTakashi Iwai <tiwai@suse.de>
Tue, 13 Jan 2015 09:53:20 +0000 (10:53 +0100)
committerZefan Li <lizefan@huawei.com>
Tue, 14 Apr 2015 09:33:59 +0000 (17:33 +0800)
commit574b59db6504ed3867c2f566f167f764e97ee402
treeac73d735ebf5f73944c55cda49f0970554f2349d
parentb278df5446192f83a6a371d031360c00501ab558
ALSA: ak411x: Fix stall in work callback

commit 4161b4505f1690358ac0a9ee59845a7887336b21 upstream.

When ak4114 work calls its callback and the callback invokes
ak4114_reinit(), it stalls due to flush_delayed_work().  For avoiding
this, control the reentrance by introducing a refcount.  Also
flush_delayed_work() is replaced with cancel_delayed_work_sync().

The exactly same bug is present in ak4113.c and fixed as well.

Reported-by: Pavel Hofman <pavel.hofman@ivitera.com>
Acked-by: Jaroslav Kysela <perex@perex.cz>
Tested-by: Pavel Hofman <pavel.hofman@ivitera.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
[lizf: Backported to 3.4: snd_ak4113_reinit() and snd_ak4114_reinit()
used flush_delayed_work_sync() instead of flush_delayed_work()]
Signed-off-by: Zefan Li <lizefan@huawei.com>
include/sound/ak4113.h
include/sound/ak4114.h
sound/i2c/other/ak4113.c
sound/i2c/other/ak4114.c