[ALSA] ASoC force running of delayed PM work at suspend() and remove()
authorLiam Girdwood <lg@opensource.wolfsonmicro.com>
Wed, 31 Jan 2007 13:14:57 +0000 (14:14 +0100)
committerJaroslav Kysela <perex@suse.cz>
Fri, 9 Feb 2007 08:03:27 +0000 (09:03 +0100)
commit965ac42ce919db225ee64678f0be02f2fdf5b5e4
tree832436b24c8a02a879de8efc7869bbfe06de2018
parentbeb60119bcc9cbd80bc5b4f7feec419e067d3e46
[ALSA] ASoC force running of delayed PM work at suspend() and remove()

This patch fixes a bug whereby the power management delayed work would
never be run at driver suspend() or module remove(). Delayed work would
be created (after audio had finished) with a long delay (~5 secs) and
was sometimes never queued before flush_scheduled_work() was being
called at suspend or module remove. This caused the delayed work to
queued after the module had been removed or after resume.
This patch forces any delayed work to complete by cancelling it (timer
cannot fire and add it to queue later), scheduling it for now and
waiting on it's completion.
This is something I probably would like to add to workqueue.c in the
next merge window, however it's here atm because it can oops.

Signed-off-by: Liam Girdwood <lg@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
sound/soc/soc-core.c