diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-01-13 04:53:20 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-01-28 16:29:20 -0500 |
commit | 4161b4505f1690358ac0a9ee59845a7887336b21 (patch) | |
tree | 627a37684dae207307c59322d7673371d7f346a0 /include/sound | |
parent | 0767e95bb96d7fdddcd590fb809e6975d93aebc5 (diff) |
ALSA: ak411x: Fix stall in work callback
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>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/ak4113.h | 2 | ||||
-rw-r--r-- | include/sound/ak4114.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/include/sound/ak4113.h b/include/sound/ak4113.h index 2609048c1d44..3a34f6edc2d1 100644 --- a/include/sound/ak4113.h +++ b/include/sound/ak4113.h | |||
@@ -286,7 +286,7 @@ struct ak4113 { | |||
286 | ak4113_write_t *write; | 286 | ak4113_write_t *write; |
287 | ak4113_read_t *read; | 287 | ak4113_read_t *read; |
288 | void *private_data; | 288 | void *private_data; |
289 | unsigned int init:1; | 289 | atomic_t wq_processing; |
290 | spinlock_t lock; | 290 | spinlock_t lock; |
291 | unsigned char regmap[AK4113_WRITABLE_REGS]; | 291 | unsigned char regmap[AK4113_WRITABLE_REGS]; |
292 | struct snd_kcontrol *kctls[AK4113_CONTROLS]; | 292 | struct snd_kcontrol *kctls[AK4113_CONTROLS]; |
diff --git a/include/sound/ak4114.h b/include/sound/ak4114.h index 52f02a60dba7..069299a88915 100644 --- a/include/sound/ak4114.h +++ b/include/sound/ak4114.h | |||
@@ -168,7 +168,7 @@ struct ak4114 { | |||
168 | ak4114_write_t * write; | 168 | ak4114_write_t * write; |
169 | ak4114_read_t * read; | 169 | ak4114_read_t * read; |
170 | void * private_data; | 170 | void * private_data; |
171 | unsigned int init: 1; | 171 | atomic_t wq_processing; |
172 | spinlock_t lock; | 172 | spinlock_t lock; |
173 | unsigned char regmap[6]; | 173 | unsigned char regmap[6]; |
174 | unsigned char txcsb[5]; | 174 | unsigned char txcsb[5]; |