[ALSA] Fix sleep in atomic in virmidi driver
authorTakashi Iwai <tiwai@suse.de>
Wed, 22 Feb 2006 16:14:34 +0000 (17:14 +0100)
committerJaroslav Kysela <perex@suse.cz>
Wed, 22 Mar 2006 09:30:58 +0000 (10:30 +0100)
Modules: ALSA sequencer

 Debug: sleeping function called from invalid context at /usr/src/linux/include/linux/rwsem.h:43
 in_atomic():1, irqs_disabled():0
  [<f999d15e>] snd_seq_deliver_event+0xb4/0x1a8 [snd_seq]
  [<f999d2be>] snd_seq_kernel_client_dispatch+0x6c/0x7c [snd_seq]
  [<f93321fc>] snd_virmidi_output_trigger+0xca/0xe5 [snd_seq_virmidi]

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/seq/seq_virmidi.c

index 14fd1a608e14ffcbde41136d4f738fad3da97aac..f4edec603b8f7036e464d8b91c6782751afa817d 100644 (file)
@@ -167,7 +167,7 @@ static void snd_virmidi_output_trigger(struct snd_rawmidi_substream *substream,
                        return;         /* ignored */
                }
                if (vmidi->event.type != SNDRV_SEQ_EVENT_NONE) {
                        return;         /* ignored */
                }
                if (vmidi->event.type != SNDRV_SEQ_EVENT_NONE) {
-                       if (snd_seq_kernel_client_dispatch(vmidi->client, &vmidi->event, 0, 0) < 0)
+                       if (snd_seq_kernel_client_dispatch(vmidi->client, &vmidi->event, in_atomic(), 0) < 0)
                                return;
                        vmidi->event.type = SNDRV_SEQ_EVENT_NONE;
                }
                                return;
                        vmidi->event.type = SNDRV_SEQ_EVENT_NONE;
                }
@@ -186,7 +186,7 @@ static void snd_virmidi_output_trigger(struct snd_rawmidi_substream *substream,
                                pbuf += res;
                                count -= res;
                                if (vmidi->event.type != SNDRV_SEQ_EVENT_NONE) {
                                pbuf += res;
                                count -= res;
                                if (vmidi->event.type != SNDRV_SEQ_EVENT_NONE) {
-                                       if (snd_seq_kernel_client_dispatch(vmidi->client, &vmidi->event, 0, 0) < 0)
+                                       if (snd_seq_kernel_client_dispatch(vmidi->client, &vmidi->event, in_atomic(), 0) < 0)
                                                return;
                                        vmidi->event.type = SNDRV_SEQ_EVENT_NONE;
                                }
                                                return;
                                        vmidi->event.type = SNDRV_SEQ_EVENT_NONE;
                                }