• Takashi Iwai's avatar
    ALSA: timer: Use mod_timer() for rearming the system timer · 4a07083e
    Takashi Iwai authored
    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: default avatarJiri Slaby <jslaby@suse.cz>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    4a07083e
Name
Last commit
Last update
..
oss Loading commit data...
seq Loading commit data...
Kconfig Loading commit data...
Makefile Loading commit data...
compress_offload.c Loading commit data...
control.c Loading commit data...
control_compat.c Loading commit data...
ctljack.c Loading commit data...
device.c Loading commit data...
hrtimer.c Loading commit data...
hwdep.c Loading commit data...
hwdep_compat.c Loading commit data...
info.c Loading commit data...
info_oss.c Loading commit data...
init.c Loading commit data...
isadma.c Loading commit data...
jack.c Loading commit data...
memalloc.c Loading commit data...
memory.c Loading commit data...
misc.c Loading commit data...
pcm.c Loading commit data...
pcm_compat.c Loading commit data...
pcm_dmaengine.c Loading commit data...
pcm_drm_eld.c Loading commit data...
pcm_iec958.c Loading commit data...
pcm_lib.c Loading commit data...
pcm_memory.c Loading commit data...
pcm_misc.c Loading commit data...
pcm_native.c Loading commit data...
pcm_timer.c Loading commit data...
pcm_trace.h Loading commit data...
rawmidi.c Loading commit data...
rawmidi_compat.c Loading commit data...
rtctimer.c Loading commit data...
sgbuf.c Loading commit data...
sound.c Loading commit data...
sound_oss.c Loading commit data...
timer.c Loading commit data...
timer_compat.c Loading commit data...
vmaster.c Loading commit data...