[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20110330210444.3A55F3E1A05@tassilo.jf.intel.com>
Date: Wed, 30 Mar 2011 14:04:44 -0700 (PDT)
From: Andi Kleen <andi@...stfloor.org>
To: clemens@...isch.de, ak@...ux.intel.com, tiwai@...e.de,
gregkh@...e.de, linux-kernel@...r.kernel.org, stable@...nel.org,
tim.bird@...sony.com
Subject: [PATCH] [48/275] ALSA: hrtimer: handle delayed timer interrupts
2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Clemens Ladisch <clemens@...isch.de>
commit b1d4f7f4bdcf9915c41ff8cfc4425c84dabb1fde upstream.
If a timer interrupt was delayed too much, hrtimer_forward_now() will
forward the timer expiry more than once. When this happens, the
additional number of elapsed ALSA timer ticks must be passed to
snd_timer_interrupt() to prevent the ALSA timer from falling behind.
This mostly fixes MIDI slowdown problems on highly-loaded systems with
badly behaved interrupt handlers.
Signed-off-by: Clemens Ladisch <clemens@...isch.de>
Signed-off-by: Andi Kleen <ak@...ux.intel.com>
Reported-and-tested-by: Arthur Marsh <arthur.marsh@...ernode.on.net>
Signed-off-by: Takashi Iwai <tiwai@...e.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@...e.de>
---
sound/core/hrtimer.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
Index: linux-2.6.35.y/sound/core/hrtimer.c
===================================================================
--- linux-2.6.35.y.orig/sound/core/hrtimer.c 2011-03-29 22:51:50.260437129 -0700
+++ linux-2.6.35.y/sound/core/hrtimer.c 2011-03-29 23:02:59.176321246 -0700
@@ -45,12 +45,13 @@
{
struct snd_hrtimer *stime = container_of(hrt, struct snd_hrtimer, hrt);
struct snd_timer *t = stime->timer;
+ unsigned long oruns;
if (!atomic_read(&stime->running))
return HRTIMER_NORESTART;
- hrtimer_forward_now(hrt, ns_to_ktime(t->sticks * resolution));
- snd_timer_interrupt(stime->timer, t->sticks);
+ oruns = hrtimer_forward_now(hrt, ns_to_ktime(t->sticks * resolution));
+ snd_timer_interrupt(stime->timer, t->sticks * oruns);
if (!atomic_read(&stime->running))
return HRTIMER_NORESTART;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists