android_kernel_oneplus_msm8998/sound/core
Takashi Iwai 57f21bd260 ALSA: timer: Use mod_timer() for rearming the system timer
commit 4a07083ed613644c96c34a7dd2853dc5d7c70902 upstream.

ALSA system timer backend stops the timer via del_timer() without sync
and leaves del_timer_sync() at the close instead.  This is because of
the restriction by the design of ALSA timer: namely, the stop callback
may be called from the timer handler, and calling the sync shall lead
to a hangup.  However, this also triggers a kernel BUG() when the
timer is rearmed immediately after stopping without sync:
 kernel BUG at kernel/time/timer.c:966!
 Call Trace:
  <IRQ>
  [<ffffffff8239c94e>] snd_timer_s_start+0x13e/0x1a0
  [<ffffffff8239e1f4>] snd_timer_interrupt+0x504/0xec0
  [<ffffffff8122fca0>] ? debug_check_no_locks_freed+0x290/0x290
  [<ffffffff8239ec64>] snd_timer_s_function+0xb4/0x120
  [<ffffffff81296b72>] call_timer_fn+0x162/0x520
  [<ffffffff81296add>] ? call_timer_fn+0xcd/0x520
  [<ffffffff8239ebb0>] ? snd_timer_interrupt+0xec0/0xec0
  ....

It's the place where add_timer() checks the pending timer.  It's clear
that this may happen after the immediate restart without sync in our
cases.

So, the workaround here is just to use mod_timer() instead of
add_timer().  This looks like a band-aid fix, but it's a right move,
as snd_timer_interrupt() takes care of the continuous rearm of timer.

Reported-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-20 15:41:53 +09:00
..
oss ALSA: pcm: Fix potential deadlock in OSS emulation 2016-02-17 12:30:59 -08:00
seq ALSA: seq: oss: Don't drain at closing a client 2016-03-09 15:34:54 -08:00
compress_offload.c ALSA: compress: Disable GET_CODEC_CAPS ioctl for some architectures 2016-02-17 12:30:58 -08:00
control.c ALSA: control: Avoid kernel warnings from tlv ioctl with numid 0 2016-01-31 11:28:57 -08:00
control_compat.c ALSA: ctl: Fix ioctls for X32 ABI 2016-03-09 15:34:53 -08:00
ctljack.c ALSA: jack: Fix endless loop at unique index detection 2015-06-26 06:59:57 +02:00
device.c
hrtimer.c ALSA: hrtimer: Fix stall by hrtimer_cancel() 2016-01-31 11:28:57 -08:00
hwdep.c ALSA: replace CONFIG_PROC_FS with CONFIG_SND_PROC_FS 2015-05-27 21:25:19 +02:00
hwdep_compat.c
info.c ALSA: info: Drop kerneldoc comment from snd_info_create_entry() 2015-05-18 09:45:11 +02:00
info_oss.c ALSA: core: Clean up OSS proc file management 2015-04-24 17:31:08 +02:00
init.c ALSA: Fix uninintialized error return 2015-06-29 19:08:31 +02:00
isadma.c
jack.c ALSA: jack: Remove MODULE_*() macros 2015-05-21 11:32:51 +02:00
Kconfig ALSA: timer: add config item to export PCM timer disabling for expert 2015-10-16 14:31:38 +02:00
Makefile ALSA: timer: add config item to export PCM timer disabling for expert 2015-10-16 14:31:38 +02:00
memalloc.c genalloc: rename of_get_named_gen_pool() to of_gen_pool_get() 2015-06-30 19:45:01 -07:00
memory.c
misc.c
pcm.c ALSA: pcm: remove structure member of 'struct snd_pcm_hwptr_log *' type because this structure had been removed 2015-09-13 12:03:15 +02:00
pcm_compat.c ALSA: pcm: Fix ioctls for X32 ABI 2016-03-09 15:34:54 -08:00
pcm_dmaengine.c
pcm_drm_eld.c ALSA: pcm: add DRM ELD helper 2015-05-22 16:01:44 +02:00
pcm_iec958.c ALSA: pcm: add IEC958 channel status helper 2015-05-22 16:01:47 +02:00
pcm_lib.c ALSA: pcm: Avoid "BUG:" string for warnings again 2016-04-12 09:08:52 -07:00
pcm_memory.c
pcm_misc.c
pcm_native.c ALSA: pcm: Fix rwsem deadlock for non-atomic PCM stream 2016-02-25 12:01:13 -08:00
pcm_timer.c
pcm_trace.h
rawmidi.c ALSA: rawmidi: Fix race at copying & updating the position 2016-02-17 12:30:58 -08:00
rawmidi_compat.c ALSA: rawmidi: Fix ioctls X32 ABI 2016-03-09 15:34:54 -08:00
rtctimer.c
sgbuf.c
sound.c ALSA: replace CONFIG_PROC_FS with CONFIG_SND_PROC_FS 2015-05-27 21:25:19 +02:00
sound_oss.c ALSA: replace CONFIG_PROC_FS with CONFIG_SND_PROC_FS 2015-05-27 21:25:19 +02:00
timer.c ALSA: timer: Use mod_timer() for rearming the system timer 2016-04-20 15:41:53 +09:00
timer_compat.c ALSA: timer: Fix broken compat timer user status ioctl 2016-03-09 15:34:55 -08:00
vmaster.c