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 <firstname.lastname@example.org>
Acked-by: Jaroslav Kysela <email@example.com>
Tested-by: Pavel Hofman <firstname.lastname@example.org>
Signed-off-by: Takashi Iwai <email@example.com>
Signed-off-by: Greg Kroah-Hartman <firstname.lastname@example.org>