aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2016-02-02 08:14:10 -0500
committerTakashi Iwai <tiwai@suse.de>2016-02-02 18:15:42 -0500
commitf146357f069e71aff8e474c625bcebcd3094b3ab (patch)
treed0240d85093b4f77e0b76b3c25396dd01bddb2e2
parentf784beb75ce82f4136f8a0960d3ee872f7109e09 (diff)
ALSA: timer: Sync timer deletion at closing the system timer
ALSA timer core framework has no sync point at stopping because it's called inside the spinlock. Thus we need a sync point at close for avoiding the stray timer task. This is simply done by implementing the close callback just calling del_timer_sync(). (It's harmless to call it unconditionally, as the core timer itself cares of the already deleted timer instance.) Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/core/timer.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sound/core/timer.c b/sound/core/timer.c
index 12db60dd147b..b419e612f987 100644
--- a/sound/core/timer.c
+++ b/sound/core/timer.c
@@ -1058,11 +1058,21 @@ static int snd_timer_s_stop(struct snd_timer * timer)
1058 return 0; 1058 return 0;
1059} 1059}
1060 1060
1061static int snd_timer_s_close(struct snd_timer *timer)
1062{
1063 struct snd_timer_system_private *priv;
1064
1065 priv = (struct snd_timer_system_private *)timer->private_data;
1066 del_timer_sync(&priv->tlist);
1067 return 0;
1068}
1069
1061static struct snd_timer_hardware snd_timer_system = 1070static struct snd_timer_hardware snd_timer_system =
1062{ 1071{
1063 .flags = SNDRV_TIMER_HW_FIRST | SNDRV_TIMER_HW_TASKLET, 1072 .flags = SNDRV_TIMER_HW_FIRST | SNDRV_TIMER_HW_TASKLET,
1064 .resolution = 1000000000L / HZ, 1073 .resolution = 1000000000L / HZ,
1065 .ticks = 10000000L, 1074 .ticks = 10000000L,
1075 .close = snd_timer_s_close,
1066 .start = snd_timer_s_start, 1076 .start = snd_timer_s_start,
1067 .stop = snd_timer_s_stop 1077 .stop = snd_timer_s_stop
1068}; 1078};