--- ./sound/core/rawmidi.c.orig 2008-11-06 15:26:03.000000000 -0800 +++ ./sound/core/rawmidi.c 2008-11-13 12:31:23.000000000 -0800 @@ -95,7 +95,10 @@ static void snd_rawmidi_input_event_tasklet(unsigned long data) { struct snd_rawmidi_substream *substream = (struct snd_rawmidi_substream *)data; + printk(KERN_ERR "rawmidi: about to run input tasklet\n"); substream->runtime->event(substream); + printk(KERN_ERR "rawmidi: after running input tasklet\n"); + } static void snd_rawmidi_output_trigger_tasklet(unsigned long data) @@ -149,18 +152,28 @@ static inline void snd_rawmidi_output_trigger(struct snd_rawmidi_substream *substream,int up) { if (up) { + printk(KERN_ERR "rawmidi: about to run output tasklet\n"); tasklet_hi_schedule(&substream->runtime->tasklet); + printk(KERN_ERR "rawmidi: run output tasklet\n"); } else { + printk(KERN_ERR "rawmidi: about to kill output tasklet\n"); tasklet_kill(&substream->runtime->tasklet); substream->ops->trigger(substream, 0); + printk(KERN_ERR "rawmidi: killed output tasklet\n"); } } static void snd_rawmidi_input_trigger(struct snd_rawmidi_substream *substream, int up) { + printk(KERN_ERR "rawmidi: before input ops trigger\n"); substream->ops->trigger(substream, up); - if (!up && substream->runtime->event) + printk(KERN_ERR "rawmidi: after input ops trigger\n"); + if (!up && substream->runtime->event) { + + printk(KERN_ERR "rawmidi: about to kill input tasklet\n"); tasklet_kill(&substream->runtime->tasklet); + printk(KERN_ERR "rawmidi: killed input tasklet\n"); + } } int snd_rawmidi_drop_output(struct snd_rawmidi_substream *substream) @@ -861,7 +874,9 @@ snd_printd("snd_rawmidi_receive: input is not active!!!\n"); return -EINVAL; } + printk(KERN_ERR "rawmidi: before receive spinlock\n"); spin_lock_irqsave(&runtime->lock, flags); + printk(KERN_ERR "rawmidi: after receive spinlock\n"); if (count == 1) { /* special case, faster code */ substream->bytes++; if (runtime->avail < runtime->buffer_size) { @@ -901,12 +916,17 @@ } } if (result > 0) { - if (runtime->event) - tasklet_hi_schedule(&runtime->tasklet); + if (runtime->event) { + printk(KERN_ERR "rawmidi: about to run receive tasklet\n"); + tasklet_hi_schedule(&runtime->tasklet); + printk(KERN_ERR "rawmidi: run receive tasklet\n"); + } else if (snd_rawmidi_ready(substream)) wake_up(&runtime->sleep); } + printk(KERN_ERR "rawmidi: before receive spin unlock\n"); spin_unlock_irqrestore(&runtime->lock, flags); + printk(KERN_ERR "rawmidi: after receive spin unlock\n"); return result; } --- ./sound/core/seq/seq_midi.c.orig 2008-11-07 09:53:31.000000000 -0800 +++ ./sound/core/seq/seq_midi.c 2008-11-07 10:21:31.000000000 -0800 @@ -80,6 +80,8 @@ char buf[16], *pbuf; long res, count; + printk(KERN_ERR "seq: snd_midi_input_event called\n"); + if (substream == NULL) return; runtime = substream->runtime; @@ -88,6 +90,9 @@ return; memset(&ev, 0, sizeof(ev)); while (runtime->avail > 0) { + + printk(KERN_ERR "seq: seq_midi_input_event loop begin\n"); + res = snd_rawmidi_kernel_read(substream, buf, sizeof(buf)); if (res <= 0) continue; @@ -115,6 +120,9 @@ } } } + + printk(KERN_ERR "seq: snd_midi_input_event exiting\n"); + } static int dump_midi(struct snd_rawmidi_substream *substream, const char *buf, int count) --- ./sound/core/rawmidi.c.orig 2008-11-06 15:26:03.000000000 -0800 +++ ./sound/core/rawmidi.c 2008-11-13 11:41:46.000000000 -0800 @@ -151,16 +151,22 @@ if (up) { tasklet_hi_schedule(&substream->runtime->tasklet); } else { + printk(KERN_ERR "rawmidi: about to kill output tasklet\n"); tasklet_kill(&substream->runtime->tasklet); substream->ops->trigger(substream, 0); + printk(KERN_ERR "rawmidi: killed output tasklet\n"); } } static void snd_rawmidi_input_trigger(struct snd_rawmidi_substream *substream, int up) { substream->ops->trigger(substream, up); - if (!up && substream->runtime->event) + if (!up && substream->runtime->event) { + + printk(KERN_ERR "rawmidi: about to kill input tasklet\n"); tasklet_kill(&substream->runtime->tasklet); + printk(KERN_ERR "rawmidi: killed input tasklet\n"); + } } int snd_rawmidi_drop_output(struct snd_rawmidi_substream *substream) @@ -861,7 +867,9 @@ snd_printd("snd_rawmidi_receive: input is not active!!!\n"); return -EINVAL; } + printk(KERN_ERR "rawmidi: before receive spinlock\n"); spin_lock_irqsave(&runtime->lock, flags); + printk(KERN_ERR "rawmidi: after receive spinlock\n"); if (count == 1) { /* special case, faster code */ substream->bytes++; if (runtime->avail < runtime->buffer_size) { @@ -901,12 +909,17 @@ } } if (result > 0) { - if (runtime->event) - tasklet_hi_schedule(&runtime->tasklet); + if (runtime->event) { + printk(KERN_ERR "rawmidi: about to run tasklet\n"); + tasklet_hi_schedule(&runtime->tasklet); + printk(KERN_ERR "rawmidi: run tasklet\n"); + } else if (snd_rawmidi_ready(substream)) wake_up(&runtime->sleep); } + printk(KERN_ERR "rawmidi: before receive spin unlock\n"); spin_unlock_irqrestore(&runtime->lock, flags); + printk(KERN_ERR "rawmidi: after receive spin unlock\n"); return result; } --- ./sound/core/seq/seq_midi.c.orig 2008-11-07 09:53:31.000000000 -0800 +++ ./sound/core/seq/seq_midi.c 2008-11-07 10:21:31.000000000 -0800 @@ -80,6 +80,8 @@ char buf[16], *pbuf; long res, count; + printk(KERN_ERR "seq: snd_midi_input_event called\n"); + if (substream == NULL) return; runtime = substream->runtime; @@ -88,6 +90,9 @@ return; memset(&ev, 0, sizeof(ev)); while (runtime->avail > 0) { + + printk(KERN_ERR "seq: seq_midi_input_event loop begin\n"); + res = snd_rawmidi_kernel_read(substream, buf, sizeof(buf)); if (res <= 0) continue; @@ -115,6 +120,9 @@ } } } + + printk(KERN_ERR "seq: snd_midi_input_event exiting\n"); + } static int dump_midi(struct snd_rawmidi_substream *substream, const char *buf, int count) --- ./sound/core/rawmidi.c.orig 2008-11-06 15:26:03.000000000 -0800 +++ ./sound/core/rawmidi.c 2008-11-13 12:31:23.000000000 -0800 @@ -95,7 +95,10 @@ static void snd_rawmidi_input_event_tasklet(unsigned long data) { struct snd_rawmidi_substream *substream = (struct snd_rawmidi_substream *)data; + printk(KERN_ERR "rawmidi: about to run input tasklet\n"); substream->runtime->event(substream); + printk(KERN_ERR "rawmidi: after running input tasklet\n"); + } static void snd_rawmidi_output_trigger_tasklet(unsigned long data) @@ -149,18 +152,28 @@ static inline void snd_rawmidi_output_trigger(struct snd_rawmidi_substream *substream,int up) { if (up) { + printk(KERN_ERR "rawmidi: about to run output tasklet\n"); tasklet_hi_schedule(&substream->runtime->tasklet); + printk(KERN_ERR "rawmidi: run output tasklet\n"); } else { + printk(KERN_ERR "rawmidi: about to kill output tasklet\n"); tasklet_kill(&substream->runtime->tasklet); substream->ops->trigger(substream, 0); + printk(KERN_ERR "rawmidi: killed output tasklet\n"); } } static void snd_rawmidi_input_trigger(struct snd_rawmidi_substream *substream, int up) { + printk(KERN_ERR "rawmidi: before input ops trigger\n"); substream->ops->trigger(substream, up); - if (!up && substream->runtime->event) + printk(KERN_ERR "rawmidi: after input ops trigger\n"); + if (!up && substream->runtime->event) { + + printk(KERN_ERR "rawmidi: about to kill input tasklet\n"); tasklet_kill(&substream->runtime->tasklet); + printk(KERN_ERR "rawmidi: killed input tasklet\n"); + } } int snd_rawmidi_drop_output(struct snd_rawmidi_substream *substream) @@ -861,7 +874,9 @@ snd_printd("snd_rawmidi_receive: input is not active!!!\n"); return -EINVAL; } + printk(KERN_ERR "rawmidi: before receive spinlock\n"); spin_lock_irqsave(&runtime->lock, flags); + printk(KERN_ERR "rawmidi: after receive spinlock\n"); if (count == 1) { /* special case, faster code */ substream->bytes++; if (runtime->avail < runtime->buffer_size) { @@ -901,12 +916,17 @@ } } if (result > 0) { - if (runtime->event) - tasklet_hi_schedule(&runtime->tasklet); + if (runtime->event) { + printk(KERN_ERR "rawmidi: about to run receive tasklet\n"); + tasklet_hi_schedule(&runtime->tasklet); + printk(KERN_ERR "rawmidi: run receive tasklet\n"); + } else if (snd_rawmidi_ready(substream)) wake_up(&runtime->sleep); } + printk(KERN_ERR "rawmidi: before receive spin unlock\n"); spin_unlock_irqrestore(&runtime->lock, flags); + printk(KERN_ERR "rawmidi: after receive spin unlock\n"); return result; } --- ./sound/core/seq/seq_midi.c.orig 2008-11-07 09:53:31.000000000 -0800 +++ ./sound/core/seq/seq_midi.c 2008-11-07 10:21:31.000000000 -0800 @@ -80,6 +80,8 @@ char buf[16], *pbuf; long res, count; + printk(KERN_ERR "seq: snd_midi_input_event called\n"); + if (substream == NULL) return; runtime = substream->runtime; @@ -88,6 +90,9 @@ return; memset(&ev, 0, sizeof(ev)); while (runtime->avail > 0) { + + printk(KERN_ERR "seq: seq_midi_input_event loop begin\n"); + res = snd_rawmidi_kernel_read(substream, buf, sizeof(buf)); if (res <= 0) continue; @@ -115,6 +120,9 @@ } } } + + printk(KERN_ERR "seq: snd_midi_input_event exiting\n"); + } static int dump_midi(struct snd_rawmidi_substream *substream, const char *buf, int count)